I'm running ubuntu and I have apache running, however, I can't ping internally to my static IP nor browse http://207.40.XXX.XX
the web server using my static IP. I can only ping/browse localhost, 127.0.0.1, and 192.168.0.120
OR 207.40.XXX.XX
only from the outside world.
# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 my-server.myhost.com my-server
# hostname
my-server
# netstat -tapn
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:29754 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
Any ideas why this is not working?
Best Answer
Your NAT-gateway is not behaving in such a way as to allow it. This is how it is probably working:
Ping
HTTP
Note, it is possible that the reason ping is failing is because of the same reason HTTP is also failing. This is called 'NAT Hairpinning'.
What you need is a NAT gateway smart enough that at step 6 it also rewrites the source address.