Hi,
I have setup my Raspberry Pi 3 as an additional router in my house. The goal was to allow it to work as a Wireless Access Point, so that people who connect to it, can surf the internet. I followed the latest instructions to do that and that part works fine.
Part of the instructions require me to make changes inside this config file:
sudo nano /etc/network/interfaces
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.201 (1 higher than the ethernet port)
netmask 255.255.255.0
network 192.168.0.200
broadcast 192.168.0.255
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
up sysctl -w net.ipv4.ip_forward=1
# restart hostapd and dnsmasq
up /etc/init.d/hostapd restart
up /etc/init.d/dnsmasq restart
After rebooting which runs the above code, it breaks my ssh ability (using Putty). I am attempting to connect to the pi from my main router inside my local network. The Pi has it's eth0 set to static 192.168.0.200. It also has it's wlan0 set to static 192.168.0.201. My main router which stands between the pi and the internet has static 192.168.0.2. As I attempt to initiate the ssh connection, it just hangs and eventually times out. If I remove the sudo iptables commands from inside the above file, I am able to successfully connect with ssh.
Can anyone please help me to correct the problem?
Thanks !
Paul