My CentOS 5.7 server can't access the internet

I have a CentOS 5.7 server setup in my office. I have recently moved to a new router (Linksys E3200) and I don't seem to be able to access the web at all through it (git, yum etc.). All the other computers, phone iPads work fine. Just this Linux box. It was ok on my old ADSL modem router on, but I've switched to a different broadband supplier and needed a new router.

I can reach the Linux box fine from across the LAN, ssh & http but I can't connect to the www from it or to it from outside either, despite port forwarding being configured on the E3200.

Any help would be marvellous. Thank you


Solution 1:

If you can hit your LAN okay, then the first thing I'd check is your gateway. You need to set your gateway so it knows how to get "out" to the Internet. Edit /etc/sysconfig/network. Here is an example:

root@myhost:~> cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=myhost
GATEWAY=192.168.1.1

GATEWAY should be set to your router's IP. Then restart the network service:

service network restart