It turns a Raspberry Pi into a router:
- Connect to internet via Wifi - this is a one time manual step.
- Route traffic from devices connected via ethernet to internet - automatic step as long as devices are connected via ethernet port
Notice it's more like a wireless bridge router but do NAT for all connected devices.
- setup the wifi network on Pi - via either UI or editing
wpa_supplicant.conf
sudo apt update & sudo apt install dnsmasq
- save
start-wifi-eth-route-2023-06-08.sh
andstop-wifi-eth-route-2023-06-08.sh
under/usr/local/bin
and change ownership to root:sudo chown root:root /usr/local/bin/*-wifi-eth-route-2023-06-08.sh
- save
wifi-to-eth-route.service
under/etc/systemd/system/
and enable it:sudo systemctl daemon-reload sudo systemctl enable wifi-to-eth-route
You can manually start it by running sudo systemctl start wifi-to-eth-route
or stop it via sudo systemctl stop wifi-to-eth-route
Or simply reboot your Pi.
https://github.com/arpitjindal97/raspbian-recipes/blob/master/wifi-to-eth-route.sh