Click to See Complete Forum and Search --> : can't see internet, but have IP assigned via dhcp from router


prothumian
08-01-2002, 09:28 PM
Hello,

I have a redhat box connecting via a wired port to a router, which in turn is hooked to my cable modem.

The box is receiving an ip address from the router via dhcp just fine, but I can't ping or anything else.

resolve.conf is set to the name servers of my isp, and the gateway is set (I forget which file - I used netcfg to do this) to the router's IP of 192.168.0.1... still no dice.

The router is working fine for the winxp box that's also hooked into it. I can surf, send e-mail, and work over a vpn.

...the light on the redhat's nic is lit up as well.

Where else should I look?

thanks
Paul

Radar
08-01-2002, 11:02 PM
post the results of route -n and ifconfig on the linux box.

prothumian
08-02-2002, 11:37 AM
Results of route -n:

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0. 255.0.0.0 U 0 0 0 lo

results of ifconfig:

eth0 Link encap: Ethernet HWaddr 00:10:4B:7C:8C:31
inet addr: 192.168.1.127 Bcast: 192.168.1.255 Mask: 255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:35 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:11 Base address:0x400

lo Link encap:Local Loopback
inet addr 12.0.0.1 Mask 255.0.0.0
UP LOOPGBACK RUNNING MTU:3924 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

Thank you

cowanrl
08-02-2002, 12:24 PM
Your biggest problem is that your IP address and the IP address of your default gateway are on different subnets. Your IP address is 192.168.1.127 with a netmask of 255.255.255.0. You said your default gateway is supposed to be 192.168.0.1. With the same netmask, that puts your Linux computer and the router on different subnets. That will never work.

So, unless you made a typo in your original post, you need to see why your DHCP server is giving out IP addresses that are on a different subnet than your default gateway.

prothumian
08-02-2002, 12:52 PM
Good observation. :)

At the command line I ran netconfig, checked the dhcp box and then selected OK. After a long pause, I was returned to the console. I now have an address on 192.168.0.119...

eth0 Link encap: Ethernet HWaddr 00:10:4B:7C:8C:31
inet addr: 192.168.0.119 Bcast: 192.168.0.255 Mask: 255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 carrier:0
TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:11 Base address:0x400

lo Link encap:Local Loopback
inet addr 127.0.0.1 Mask 255.0.0.0
UP LOOPGBACK RUNNING MTU:3924 Metric:1
RX packets:106 errors:0 dropped:0 overruns:0 frame:0
TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

but route -n yields this info with an additional eth0 entry at the end.

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
127.0.0.0 0.0.0.0. 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0

I can ping my windows box (after a long delay) and now the win box can ping this linux box. Still unable to ping router.

thanks

cowanrl
08-02-2002, 01:07 PM
That last entry in the route table is the default gateway entry. Your route table looks correct now.

When you ping the windows box, try using:

ping -n xxx.xxx.xxx.xxx

The -n keeps linux from trying to do a reverse lookup on the IP address when you do the ping. If it can't find the hostname, it waits till it times out.

So your problem now is that you can't ping 192.168.0.1 from 192.168.0.19. Is that correct?

prothumian
08-02-2002, 01:21 PM
Yes - and I had gone back to edit my post. The ping -n worked as indicated :)

The actual IP of the linux box is 192.168.0.119, and is getting a response of

From 192.168.0.119: Destination Host Unreachable

Thanks
Paul

cowanrl
08-02-2002, 01:35 PM
What's the IP address, netmask and default gateway setting on the WinXP machine that you can ping?

prothumian
08-02-2002, 02:42 PM
What's the IP address, netmask and default gateway setting on the WinXP machine that you can ping?

IP Address: 192.168.0.124
Netmask: 255.255.255.0
default gateway: 192.168.0.1

cowanrl
08-02-2002, 03:08 PM
Sometimes that error message is a result of the machine not getting a response to it's arp request for an IP address on the same subnet.

After you execute the command to ping the router, execute the arp command to look at the arp cache on your Linux computer. Just enter:

/sbin/arp -n

at the command line. You should see a list of IP addresses and the hardware addresses beside them. You should see a listing for 192.168.0.1. If not, then your router is not responding to arp requests from your Linux box for some reason.

If you do see it, then do the same thing from a Windows machine. On it, execute arp -a. Compare the hardware address for your router on both machines to be sure they are the same.

It could be a problem with the arp cache on the router. I have seen some routers have arp caches that don't clear themselves for a very long time. It's possible that your router thinks that some other computer on the network has the IP address of 192.168.0.119. The first thing I would do is reset your router, if that's possible. Either with a reset button if it has one or by just cycling the power off and on. That should clear the arp cache.
Don't initialize the router to factory defaults or anything like that, just reset it.

See if any of that helps and let me know what you find out.

prothumian
08-02-2002, 04:12 PM
Yeah, I tried /sbin/arp -n and got {incomplete} under HWaddress. Iface listed eth0 and Address listed 192.168.0.1

I cycled the power, and nothing came about. The router is the d-link 713p 3-port wired switch + WAP. I have the linux box plugged in via ethernet to it.

If this is more of a hardware issue, and the linux box is properly set up, I can ask the D-link support forums on dslreports.com for more info on this side.

I've learned some good things through this process. Either way, thanks for your help. :D

Paul

cowanrl
08-02-2002, 05:24 PM
Your welcome. Good luck!