We have a web server on a private network behind a router (with wlan0 and eth0 interfaces) , connected wirelessly (interface wlan0) to our home router by WiFi. This web server is serving (listening) on address 10.0.0.50 as per router DHCP assignment.
Now, we want to access this web server on our home network , yet no success.
Our commands on the router:
sudo iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j DNAT --to-destination 10.0.0.50:80
sudo iptables -t nat -A POSTROUTING -p tcp -d 10.0.0.50 --dport 80 -j SNAT --to-source 10.0.0.1
The address 10.0.0.1 is the router’s eth0 device IP.
Been struggling with this for a few days, the solution given seems simple enough but does not work!
Now, we want to access this web server on our home network , yet no success.
Our commands on the router:
sudo iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j DNAT --to-destination 10.0.0.50:80
sudo iptables -t nat -A POSTROUTING -p tcp -d 10.0.0.50 --dport 80 -j SNAT --to-source 10.0.0.1
The address 10.0.0.1 is the router’s eth0 device IP.
Been struggling with this for a few days, the solution given seems simple enough but does not work!