Open KamiCreed opened 1 year ago
From ChatGPT, this can help with testing with internet with static IPs:
Yes, if your Raspberry Pi is using the dhcpcd service for network configuration, you can still set up NAT to allow other devices on the network connected by Ethernet to access the Internet through the Raspberry Pi's WiFi. Here's how you can do it:
Install the iptables-persistent package by running the following command in the terminal:
sudo apt-get install iptables-persistent
Edit the /etc/dhcpcd.conf file using your favorite text editor (e.g., nano or vim) and add the following lines at the end of the file:
interface br0
static ip_address=192.168.0.1/24
nohook wpa_supplicant
These lines define a new interface called br0 with a static IP address of 192.168.0.1 and a netmask of 255.255.255.0. This interface will be used to bridge the WiFi and Ethernet interfaces together.
Save the file and exit the text editor.
Restart the dhcpcd service by running the following command in the terminal:
sudo systemctl restart dhcpcd
Enable NAT by running the following commands in the terminal:
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
sudo netfilter-persistent save
These commands configure NAT on the Raspberry Pi. The first command sets up NAT for the outgoing traffic on the wlan0 interface. The second and third commands allow traffic to be forwarded between the wlan0 and eth0 interfaces. The last command saves the configuration.
Reboot the Raspberry Pi to make sure the changes take effect.
After completing these steps, other devices connected to the Raspberry Pi via Ethernet should be able to access the Internet through the Raspberry Pi's WiFi connection.
I figured out a way to stream substreams to Amazon Kinesis Video streams and also access it through a web-form through Amazon Amplify. Requires their docker images and a third party webviewer.
Still need to test on the deployable raspis.