I just recently installed RHEL 5 on a virtual machine. The server is set up to use a static IP, which I've configured in the Network Configuration GUI. There is only ethernet interface set up called eth0 which is set to activate on boot. After restarting Linux, I went to check to make sure that it was indeed activated, but it wasn't so I manually activated the device.
Going into the command line, I tried:
- Iinging google.com but got 100% packet loss.
- Pinged the IP address of the router the server is using for the gateway (set in Network Configuration Manager), which came back with 0% packet loss.
- I tried pinging the IP address of the server itself, which again came back with 0% packet loss.
However, if I try opening up Firefox and navigating to a site, nothing will come up. Any suggestions?
UPDATE 1: When I ping www.google.com, I don't get "Unknown host", so the DNS should be fine.
Following Matt's advice, I issued the command route -n and got the following output:
> Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.X.X.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 10.X.X.1 0.0.0.0 UG 0 0 0 eth0
UPDATE 2: After issuing the command:
traceroute -n www.google.com
I am seeing IP addresses for #1 and #2, but the rest of them have three asterisks where the IP addresses should be. Plus, I couldn't even connect to www.google.com using the telnet command. So it does look like a network firewall is most likely causing the problem. I think that's about all the information I can provide until I can confirm whether or not the cause is indeed a firewall.
When you ping google.com, did it resolve? In other words, did it come up and say
Or did it say
Assuming it said the first, your DNS is fine. At that point, lets look into the routing:
Here's mine:
Since I'm on an internal network, everything destined for 10.x.x.0/24 (the /24 comes from the "genmask" column) goes out the local ethernet card.
Everything else (0.0.0.0/0) goes to 10.x.x.1, my gateway. My guess is that this line is probably absent or messed up on yours.
If you have a relatively simple network configuration, and that line is missing, you can issue this command as root:
Where 10.x.x.1 is your default gateway.
EDIT
Alright, given the new information, it looks like your routes are fine. Where is the server that you were pinging located? On the local segment, or remote?
Anyway, lets see where the connection dies:
Chances are really good that you'll at least get a response from your gateway, 10.x.x.1. Anything past that means your gateway is routing traffic to you. If you don't get responses, that may indicate a network firewall causing the problem.
Of course, there's still the chance that you're getting traffic, but that your gateway is filtering ICMP packets. It would be diagnostic to try telnetting to google and pretending to be a web browser:
You type the "GET / HTTP/1.0" then hit enter twice...though really, if you get the "connected to..." part, you're probably good.
Update once you've tried this!
Two things come to mind right away:
DNS:
Is DNS working? Can you ping the IP of www.google.com? If www.google.com is not resolving to an IP, then DNS is not set up correctly.
Run 'cat /etc/resolv.conf' and make sure your DNS server is listed, if it is not configure resolv.conf using these instructions.
Default Gateway:
If DNS is working but you can't ping www.google.com then you may not have the default gateway set, and can only ping things on your network.
Too add a default gateway, add a line like GATEWAY=192.168.1.1 to your /etc/sysconfig/network and then restart networking with:
get DNS fixed (/etc/resolv.conf) to get the NIC to start up every time, edit /etc/sysconfig/network-scripts/ifcfg-eth0 and change the ONBOOT=no line to ONBOOT=yes