I have a wifi hotspot that serves a web page from a local server to mobile devices that connect to the hotspot. When any
http://domain.com is called I want the file server on the resident server to respond. The following iptables line works to do that (if eth0 router connected).
iptables -t nat -A PREROUTING -s 192.168.150.0/24 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 4444
The line in the iptables works if at boot the eth0 cables is plugged in and gets set up by a ethernet router. Actually, it starts working if the ethernet cable is plugged in at anytime after booting and it works thereafter even if the cable is disconnected. I don't understand why that should cause the wlan0 traffic to not route properly. The route table looks the same when working after disconnecting the eth0 router as it does on a boot without eth0.
Without the eth0 connected to a router the wlan0 clients asking for 192.168.150.1:4444 works but some
http://whatever.com name does not. However with a router connected (once after boot) to eth0 then if a client asks for
http://whatever.com will have the request forwarded to 192.168.150.1:4444
What can I do to make this work without an eth0 connection?