Save the changes sudo sh -c "iptables-save > /etc/" Sudo iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT Sudo iptables -A FORWARD -i wlan0 -o eth0 -m state -state RELATED,ESTABLISHED -j ACCEPT Uncommend this line by removing # character: _forward=1 sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"Ĭhange iptables sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE To share Raspberry Pi internet from wifi, we have to configure ipv4 forward and set iptables routing connection from wlan0 to eth0. Start the service systemctl start dnsmasq SHARING INTERNET FROM WIFI AND SHARE TO LAN To configure, stop the service first systemctl stop dnsmasqīackup the default configuration: sudo mv /etc/nf /etc/ĭhcp-range=192.168.5.50,192.168.5.100,12h We’ll choose Dnsmasq application sudo apt install dnsmasq Wpa-conf /etc/wpa_supplicant/wpa_nfĮnable networking service sudo systemctl enable networkingĭeny interfaces on dhcpcd denyinterfaces eth0 Now that we are sure we are connected on wifi and with static ip configured, we can now start to change from DHCP to NETWORKING static ip address method. To check where the wifi ssid and password is saved: sudo nano /etc/wpa_supplicant/wpa_nf SET STATIC IP ADDRESS Here’s my configuration sudo nano /etc/nf I’m having static ip address using DHCPCD method. Let’s begin by connecting on Raspberry Pi wifi and update the system. You may check my tutorial about how to install Raspberry PI OS Lite and setup static Ip address.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |