Ubuntu, Port Forwarding
I have no idea what i do wrong. Ive ubuntu 10.04 LTS desktop version. (2 times)
One (let we call it [SERVER]) has 2 nics.
Two (let we call it [WEBSERVER] has 1 nic
(here is a website running)
From my SERVER I can ping 10.0.0.100 and 10.0.0.104
From my SERVER I can visit the website at 10.0.0.104
From somewhere else (not in the network) I can ping 192.XX.XX.XX but not 10.0.0.100 or 10.0.0.104
What I want is, if I browse toe 192.XX.XX.XX:4000 (randomport number) I want that i can see the website at the WEBSERVER 10.0.0.104
What did i did
but I got "Failed to open page"
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 4000 -j DNAT --to 10.0.0.104:80
What did i wrong, or didn't see.
I am not prof at iptables, but maybe I will be helpfu. Worth giving a try. Are You sure, the requests are comming from eth0 interface? Maybe it's the other one and the webserver is attavched to eth0.
Moreover, to my opinion, You will not get ping responses, since You forward only port 4000, whereas ping works for ip addresses (I think it's not tcp/ip layer).
So far I can understand you have a signal but do not have Internet connection.
Call the Internet service provider and check whether everything is O.K. there (from time to time there is prophylactics).
If the Internet service provider is O.K. try the following: right-mouse-click and select 'Hidden Internet Connection'.
See whether your connection appears there. If YES - select it and go to the browser to test (open some famous web pages), if NO - from the desktop menu navigate to Network and make the settings, after that restart the computer WITH switched in advance router and/or modem.
If the settings of the computer are O.K. - check the router.
Log to the router's admin page (write the address in the browser).
From the main page or in separate 'network status' section check whether the Internet protocols are transmitted properly.
If the problem persists - test the computer with different network connection.
add this rule also
Originally Posted by MarkRaats
iptables -t nat -i eth0 -A POSTROUTING -j MASQUERADE
hope it will work