Can ping internet and local network, but not gateway

Issues related to configuring your network
Post Reply
ohaya
Posts: 7
Joined: 2011/04/29 02:18:15

Can ping internet and local network, but not gateway

Post by ohaya » 2011/04/29 22:26:58

Hi,

First of all, I'll say that the problem I'm having is actually on Centos 4.8 (64-bit), but I noticed that there're hardly any recent posts on the networking section for Centos 4, so I'm posting this here. Hopefully that'll be ok.

The problem that I'm having is that from Centos, I can ping both the internet and machines on my local network using IP address.

I can also ping the Centos machine from other machines on my local network.

It's just that, from the Centos machine, I can't ping the gateway (192.168.0.1) on my local network. That's also my router's (and DNS).

Here's netstat -rn:
[code]
[root@oamoidoifservice ~]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.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 192.168.0.1 0.0.0.0 UG 0 0 0 eth0[/code]

and ifconfig -a:
[code]
[root@oamoidoifservice ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:F0:F0:DE
inet addr:192.168.0.223 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fef0:f0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1492 Metric:1
RX packets:1317 errors:0 dropped:0 overruns:0 frame:0
TX packets:252 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:358965 (350.5 KiB) TX bytes:23523 (22.9 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:760 (760.0 b) TX bytes:760 (760.0 b)

sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[/code]

Here's a ping to a local machine:

[root@oamoidoifservice ~]# ping 192.168.0.231
PING 192.168.0.231 (192.168.0.231) 56(84) bytes of data.
64 bytes from 192.168.0.231: icmp_seq=0 ttl=128 time=1.41 ms
64 bytes from 192.168.0.231: icmp_seq=1 ttl=128 time=0.943 ms

--- 192.168.0.231 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.943/1.179/1.416/0.238 ms, pipe 2

This Centos machine is running as a guest under VMware workstation, and networking for the guest is configured for "bridging".

At first, I thought that it might be something with VMware, but I have another, Windows 2003 guest, running under the same VMware workstation, and I can ping 192.168.0.1 fine from that.


I've been googling, and it was suggested to try enabling IP forwarding using "echo 1 /proc.../", which I did, but that didn't fix the problem.

So, I was wondering if anyone might be able to tell me what's wrong?

Thanks, and apologies for posting here instead of under the Centos 4 Networking area...

Jim
[Moderator edit: Added [i]code[/i] tags to preserve formatting.]

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Can ping internet and local network, but not gateway

Post by pschaff » 2011/04/30 00:57:07

Welcome to the CentOS fora. Reading [url=https://www.centos.org/modules/newbb/viewforum.php?forum=47]FAQ & Readme First[/url] is recommended for new users.

Despite the paucity of posts in "CentOS 4 - Networking Support" that is the proper home for a CentOS-4 networking question, so this thread now resides there.

I can't spot any errors, and I fail to understand how you could access the Internet if you cannot reach the gateway. The default route shows the gateway.

IP forwarding on the guest does not seem appropriate.

How is the IP address being configured? Fixed address or DHCP? What is the host OS? Can you ping by hostname, for instance[code]ping www.centos.org[/code]?

You have already covered some of the bases, but please read [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=25128&forum=47]How to provide information about your system[/url] and show the results of "./getinfo.sh [b]network[/b]".

ohaya
Posts: 7
Joined: 2011/04/29 02:18:15

Re: Can ping internet and local network, but not gateway

Post by ohaya » 2011/04/30 04:08:36

Phil,

Ok, thanks re. the area to post.

The host OS is Windows 7 Ultimate 64-bit.

The guest is configured for static IP address.

I had seen mention of that getinfo.sh, but I can't find it on my guest (Centos 4.8 64-bit).


I know that it's weird that I can ping the internet (and local machines) via IP address, and yet not be able to ping the gateway :)...


Jim

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Can ping internet and local network, but not gateway

Post by pschaff » 2011/04/30 11:40:11

So you can ping via IP address but not resolve hostnames? That was not clear before. I would suggest using DHCP if possible as that automates more of the network setup process. If you want a deterministic IP address on the internal network, see the Wiki article [url=http://wiki.centos.org/TipsAndTricks/EmulateFixedAddressByDHCP]TipsAndTricks/EmulateFixedAddressByDHCP[/url].

The script, and the description of its use, can be found via the [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=25128&forum=47]link[/url] I gave you in my last post.

ohaya
Posts: 7
Joined: 2011/04/29 02:18:15

Re: Can ping internet and local network, but not gateway

Post by ohaya » 2011/04/30 14:55:57

Hi,

I just did a couple of tests, to answer your last question:


1) Pinging www.google.com using IP address... response immediate

[root@oamoidoifservice tmp]# ping 74.125.91.99
PING 74.125.91.99 (74.125.91.99) 56(84) bytes of data.
64 bytes from 74.125.91.99: icmp_seq=0 ttl=54 time=31.5 ms
64 bytes from 74.125.91.99: icmp_seq=1 ttl=54 time=28.8 ms
64 bytes from 74.125.91.99: icmp_seq=2 ttl=54 time=31.1 ms

--- 74.125.91.99 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 28.854/30.495/31.515/1.189 ms, pipe 2



2) Pinging www.google.com using hostname... long delay before FIRST response

[root@oamoidoifservice tmp]# ping www.google.com
PING www.google.com (74.125.91.99) 56(84) bytes of data.
64 bytes from 74.125.91.99: icmp_seq=0 ttl=54 time=29.9 ms
64 bytes from 74.125.91.99: icmp_seq=1 ttl=54 time=25.2 ms
64 bytes from 74.125.91.99: icmp_seq=2 ttl=54 time=29.5 ms
64 bytes from 74.125.91.99: icmp_seq=3 ttl=54 time=30.1 ms
64 bytes from 74.125.91.99: icmp_seq=4 ttl=54 time=29.9 ms

--- www.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 13033ms
rtt min/avg/max/mdev = 25.244/28.999/30.179/1.894 ms, pipe 2




3) Pinging gateway/192.168.0.1 using IP address... no response at all...

[root@oamoidoifservice tmp]# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.

--- 192.168.0.1 ping statistics ---
95 packets transmitted, 0 received, 100% packet loss, time 93986ms



So:

- I can ping internet using IP address fine.
- I can ping internet using hostname, but first response takes a really long time
- If I ping 192.168.0.1, I get no response (ping hangs)


I also did some nslookup:

[root@oamoidoifservice tmp]# nslookup
> server
Default server: 192.168.0.1
Address: 192.168.0.1#53
> www.google.com
Server: 192.168.0.1
Address: 192.168.0.1#53

Non-authoritative answer:
Name: www.google.com
Address: 74.125.91.99
> www.yahoo.com
Server: 192.168.0.1
Address: 192.168.0.1#53

Non-authoritative answer:
Name: www.yahoo.com
Address: 69.147.125.65
> www.centos.org
Server: 192.168.0.1
Address: 192.168.0.1#53

Non-authoritative answer:
Name: www.centos.org
Address: 72.232.194.162
> www.abc.com
Server: 192.168.0.1
Address: 192.168.0.1#53

Non-authoritative answer:
Name: www.abc.com
Address: 199.181.132.250


The responses in each case came back immediately.


Here's the output of "./getInfo.sh network":


Information for network problems.
[code]
== BEGIN uname -rmi ==
2.6.9-89.EL x86_64 x86_64
== END uname -rmi ==

== BEGIN rpm -qa \*-release\* ==
centos-release-4-8
== END rpm -qa \*-release\* ==

== BEGIN cat /etc/redhat-release ==
CentOS release 4.8 (Final)
== END cat /etc/redhat-release ==

== BEGIN getenforce ==
Disabled
== END getenforce ==

== BEGIN free -m ==
total used free shared buffers cached
Mem: 2946 503 2443 0 18 224
-/+ buffers/cache: 260 2685
Swap: 2047 0 2047
== END free -m ==

== BEGIN lspci ==
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
00:11.0 PCI bridge: VMware PCI bridge (rev 02)
00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.7 PCI bridge: VMware PCI Express Root Port (rev 01)
02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
== END lspci ==

== BEGIN lspci -n ==
00:00.0 Class 0600: 8086:7190 (rev 01)
00:01.0 Class 0604: 8086:7191 (rev 01)
00:07.0 Class 0601: 8086:7110 (rev 08)
00:07.1 Class 0101: 8086:7111 (rev 01)
00:07.3 Class 0680: 8086:7113 (rev 08)
00:07.7 Class 0880: 15ad:0740 (rev 10)
00:0f.0 Class 0300: 15ad:0405
00:10.0 Class 0100: 1000:0030 (rev 01)
00:11.0 Class 0604: 15ad:0790 (rev 02)
00:15.0 Class 0604: 15ad:07a0 (rev 01)
00:15.1 Class 0604: 15ad:07a0 (rev 01)
00:15.2 Class 0604: 15ad:07a0 (rev 01)
00:15.3 Class 0604: 15ad:07a0 (rev 01)
00:15.4 Class 0604: 15ad:07a0 (rev 01)
00:15.5 Class 0604: 15ad:07a0 (rev 01)
00:15.6 Class 0604: 15ad:07a0 (rev 01)
00:15.7 Class 0604: 15ad:07a0 (rev 01)
00:16.0 Class 0604: 15ad:07a0 (rev 01)
00:16.1 Class 0604: 15ad:07a0 (rev 01)
00:16.2 Class 0604: 15ad:07a0 (rev 01)
00:16.3 Class 0604: 15ad:07a0 (rev 01)
00:16.4 Class 0604: 15ad:07a0 (rev 01)
00:16.5 Class 0604: 15ad:07a0 (rev 01)
00:16.6 Class 0604: 15ad:07a0 (rev 01)
00:16.7 Class 0604: 15ad:07a0 (rev 01)
00:17.0 Class 0604: 15ad:07a0 (rev 01)
00:17.1 Class 0604: 15ad:07a0 (rev 01)
00:17.2 Class 0604: 15ad:07a0 (rev 01)
00:17.3 Class 0604: 15ad:07a0 (rev 01)
00:17.4 Class 0604: 15ad:07a0 (rev 01)
00:17.5 Class 0604: 15ad:07a0 (rev 01)
00:17.6 Class 0604: 15ad:07a0 (rev 01)
00:17.7 Class 0604: 15ad:07a0 (rev 01)
00:18.0 Class 0604: 15ad:07a0 (rev 01)
00:18.1 Class 0604: 15ad:07a0 (rev 01)
00:18.2 Class 0604: 15ad:07a0 (rev 01)
00:18.3 Class 0604: 15ad:07a0 (rev 01)
00:18.4 Class 0604: 15ad:07a0 (rev 01)
00:18.5 Class 0604: 15ad:07a0 (rev 01)
00:18.6 Class 0604: 15ad:07a0 (rev 01)
00:18.7 Class 0604: 15ad:07a0 (rev 01)
02:01.0 Class 0200: 8086:100f (rev 01)
== END lspci -n ==

== BEGIN ifconfig -a ==
eth0 Link encap:Ethernet HWaddr 00:0C:29:F0:F0:DE
inet addr:192.168.0.223 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fef0:f0de/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1465 errors:0 dropped:0 overruns:0 frame:0
TX packets:897 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:288266 (281.5 KiB) TX bytes:111937 (109.3 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1781 errors:0 dropped:0 overruns:0 frame:0
TX packets:1781 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:290708 (283.8 KiB) TX bytes:290708 (283.8 KiB)

sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

== END ifconfig -a ==

== BEGIN route -n ==
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.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 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
== END route -n ==

== BEGIN cat /etc/resolv.conf ==
nameserver 192.168.0.1
== END cat /etc/resolv.conf ==

== BEGIN grep net /etc/nsswitch.conf ==
#networks: ldap [NOTFOUND=return] files
netmasks: files
networks: files
netgroup: files
== END grep net /etc/nsswitch.conf ==

== BEGIN chkconfig --list | grep -Ei 'network|wpa' ==
wpa_supplicant 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off
== END chkconfig --list | grep -Ei 'network|wpa' ==

[/code]



So, I guess that, at this point, the things that I'm now puzzled about are:

1) Why, when I ping 192.168.0.1, is that hanging?

2) Why, when I ping an internet hostname, is the first response taking a really long time?


Jim

ohaya
Posts: 7
Joined: 2011/04/29 02:18:15

Re: Can ping internet and local network, but not gateway

Post by ohaya » 2011/04/30 15:23:31

Hi,

BTW, I forgot to mention: Earlier, before I posted, I already tried setting it to use DHCP. When I did that, it was able to get an IP address (192.168.0.8), but still couldn't ping 192.1689.0.1...

Jim

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Can ping internet and local network, but not gateway

Post by pschaff » 2011/04/30 18:40:47

I am at a loss to explain this. What VMware product are you using? Have you installed VMware tools. Obviously you can reach the router via DNS or the lookups would have failed. Perhaps someone else can spot something we are missing.

My best guess it that the problem has something to do with the host firewall - not a subject for this forum.

Not sure it is relevant to the problem, but that is a [b][i]very[/i][/b] obsolete 4.8 original kernel. Updating to 4.9 with the latest security and bug-fix patches via "yum update" is advisable.

As it is pretty easy to create a new VM I'd try installing 5.6 and see how that acts.

ohaya
Posts: 7
Joined: 2011/04/29 02:18:15

Re: Can ping internet and local network, but not gateway

Post by ohaya » 2011/04/30 18:54:03

Hi,

It's VMware Workstation 6.5.5, the latest of the "6" versions (VMware has a 7 version, but I haven't purchased an upgrade to that yet).

And yes, I have VMware tools installed on the guest.

Also, re. the Centos version. I know that 4.8 is old, but I have to use it because I'm trying to match our Redhat version at work to do some test Oracle installations.

Thanks for the help. If I ever find an answer, I'll try to remember to post back here.

Jim

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Can ping internet and local network, but not gateway

Post by pschaff » 2011/04/30 19:04:29

Please do update the thread, and I hope your systems at work are not exposed to the Wild and Woolly Web as they will be at risk. By not updating you are implicitly accepting that you will live with numerous bugs and security issues (and associated known exploits) that have subsequently been fixed.

Post Reply