This is a script I developed to access a Ruida controller with ethernet via WiFi. A raspberry pi 3 is required to perform the port forwarding. You will need some familiarity with the basic setup of the WiFi, but the script works great once that is completed. I recommend that you start with a clean install of the latest Buster distribution and work from there. Setup of a RPi is outside the scope of this forum, I suggest that you search for additional information on the internet.
Paul
The updated script here will forward all UDP traffic sent to the RPi to the laser controller. This was tested with a Ruida controller, but should work with any other controller that uses UDP as the transport.
#!/bin/bash
#
# laser-bridge.sh
#
# 1 October 2020 Paul D. Fincato
# Updated 2 October 2020 - PDF
#
# This is based upon a collection of scripts and ideas found on the internet
# - https://github.com/arpitjindal97/raspbian-recipes/blob/master/wifi-to-eth-route.sh
# - https://www.raspberrypi.org/forums/viewtopic.php?t=286841
#
# Allows access to a Ruida based ethernet controller
# over WiFi with a Raspberry pi3. wlan0 is connected to your existing WiFi network
# eth0 is connected to the laser.
#
# This should work with no changes with the default Ruida controller IP address.
# The only changes should be to the configuration of your wireless network
# outside of this script (sudo raspi-config - the wireless network wlan0)
#
# PREREQS :
# Clean install of 2020-08-20-raspios-buster-armhf-lite installed on Rpi3
# wlan0 already configured for your existing wireless network (i.e. You can SSH to Rpi wireless)
# Install dnsmasq i.e. - sudo apt-get install dnsmasq
# Execute this script on boot - i.e. sudo crontab -e add the line @reboot /home/pi/laser-bridge.sh
#
# The wlan0 address becomes the IP address for the Ruida laser controller
# and should be used in your laser software setup
# ifconfig -a
# wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
# inet 192.168.0.241 netmask 255.255.255.0 broadcast 192.168.0.255
#
# Since only UDP is being forwarded, you retain the abilty to SSH (TCP) to the Rpi
# for any maintenance required
#
#
# Remember to: chmod +x laser-bridge.sh
#
#===============================================================
# Addresses of eth0 on rpi and the laser (same subnet)
ip_address="192.168.1.50"
laser="192.168.1.100"
#---------------------------------------------------------------
# Really shouldn't need to change anything below here on a Rpi 3
# and default Ruida address of 192.168.1.100 YMMV...
#---------------------------------------------------------------
netmask="255.255.255.0"
dhcp_range_start="192.168.1.51"
dhcp_range_end="192.168.1.99"
dhcp_time="12h"
eth="eth0"
wlan="wlan0"
sudo systemctl start network-online.target &> /dev/null
sudo iptables -F
sudo iptables -t nat -F
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -t nat -A PREROUTING -p udp -m udp -i $wlan -j DNAT --to $laser
sudo iptables -t nat -A POSTROUTING -o $eth -j MASQUERADE
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo ifconfig $eth $ip_address netmask $netmask
sudo systemctl stop dnsmasq
sudo rm -rf /etc/dnsmasq.d/* &> /dev/null
sudo route add -net default gw $ip_address netmask 0.0.0.0 dev eth0 metric 1
echo -e "interface=$eth\n\
bind-interfaces\n\
server=8.8.8.8\n\
domain-needed\n\
bogus-priv\n\
dhcp-range=$dhcp_range_start,$dhcp_range_end,$dhcp_time" > /tmp/custom-dnsmasq.conf
sudo cp /tmp/custom-dnsmasq.conf /etc/dnsmasq.d/custom-dnsmasq.conf
sudo systemctl start dnsmasq