LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-10-2007, 08:00 AM   #1
max2004
Member
 
Registered: Feb 2005
Posts: 57

Rep: Reputation: 15
DHCP: no valid response


Hi,

suddenly when my gentoo box boots, it doesn't (times out) get a valid dhcp reponse anymore. i use dhcpcd and in my net file, there is only one line: config_eth0=( "dhcp" ).

I am connected to the internet over a consumer router that also runs a dhcp server and all the other computers in my subnet get an IP without problems.

When I boot Windows (on the same computer), there is no problem, neither when I use some Linux live CD like Knoppix or gentoo's livecd. The last network related thing I remember I did was to emerge (= install) vpnc. I haven't done anything to the kernel (2.6) lately.

It seems to me (=not an expert) that I somehow disabled the interface.

Additional information:
- the device is correctly listed when I run "lspci"
- it is an onboard (ASUS mainboard) ethernet interface by Marvell
- when I run "ip addr", eth0 is listed (but of cause without an IP)
- when I set an IP manually, the command succeeds, but I still cannot ping the router, another computer in the subnet or in the internet
- when I run "ip route" there is only the loopback listed
- during boot, the LED next to the ethernet port is on, but later it is off


Hope somebody can help, I feel so naked without my internet connection...

Max
 
Old 01-10-2007, 10:17 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
What do you get if you run the command /sbin/ifconfig ??? Does your ehternet card show up?

If it shows up, do you have an IP address?

If not, try and run as root ifconfig eth0 up and see what happens. Does the link light come on and stay on? Is there any activity on the act light on the card?
 
Old 01-10-2007, 11:50 AM   #3
max2004
Member
 
Registered: Feb 2005
Posts: 57

Original Poster
Rep: Reputation: 15
Hi,

it didn't show up when I ran ifconfig, so I used your hint and set it to up. Running dhcpcd still timed out while waiting for a valid answer and more interesting: after I ran it, eth0 didn't show up anymore.

So I assigned an ip manually (ip a add 192.168.0.4/24 broadcast 192.168.0.255 dev eth0) and then i could ping the router and the other computers in the subnet (not the internet however).

Any idea?

Thanks!
Max
 
Old 01-10-2007, 07:00 PM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
If you can ping anything outside your box, the ethernet interface must be active, and show up with /sbin/ifconfig.

Have you got a default route set? Could you run the command 'route' as root and post the results. This will show if you have a default route set, and what it is pointing at.

What about DNS? What have you got in your /etc/resolv.conf file?
 
Old 01-11-2007, 06:20 AM   #5
max2004
Member
 
Registered: Feb 2005
Posts: 57

Original Poster
Rep: Reputation: 15
Hi camorri,

thanks a lot for your post!

Quote:
If you can ping anything outside your box, the ethernet interface must be active, and show up with /sbin/ifconfig.
I cannot ping anything outside my box after I booted. But after setting the interface up with /sbin/ifconfig and assigning an IP manually I can ping all hosts in my subnet. However not outside my subnet. (I think(!) this is due to the fact that the router/dhcp server doesn't know that it has to do NAT for me, since it didn't assign the IP to me, but I assigned it myself. So I think this problem will disappear once I get the IP from the router.)

Quote:
Have you got a default route set? Could you run the command 'route' as root and post the results. This will show if you have a default route set, and what it is pointing at.
I set the default route using "route add 0.0.0.0 eth0" and it shows up in the kernel's routing table as the default route. However when I try to ping outside the subnet, I still get "connect: Network unreachable".

Quote:
What about DNS? What have you got in your /etc/resolv.conf file?
It says

# Generated by dhcpcd for interface eth0
search
nameserver 192.168.0.1

(192.168.0.1 = the router)

Thanks again and I hope you're not running out of ideas what I could try...

Max
 
Old 01-11-2007, 09:18 AM   #6
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
We are making some progress, you now know how to enable your ethernet card, and set a static IP address.

NAT. I don't think as a user you have any control over NAT. You see addresses in the range of 192.168.x.y are class C private addresses. What this means is they are not routable over the internet. If a router running a subnet in this address range is requested to route a packett to the ISP over a sub net that is a routable IP address ( not private ) then NAT kicks in, and does address translation. Your 192.168.x.y addresses are never forwarded to the internet.

At this point the IP addresses you are using (on your side local lan) are fine. Understand routers have at least two subnet sides. One side connects to your ISP, that side has its own sub-net, its own IP address, it can be static, or assigned by DHCP. That is usually configurable, and your ISP should be telling you what to do here. Your lan side is a private sub-net.

Quote:
I set the default route using "route add 0.0.0.0 eth0"
This won't work. Your router has an IP address set for your side of the router. It will be something like 192.168.0.1 ( just a guess on my part, you can verify this ), that IP address is what you want to set in linux with a route add command. Here is what my wroking route table looks like. ( as an example ).

Code:
 route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     2      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         192.168.1.1     0.0.0.0         UG    2      0        0 eth0
My side of my router's IP addr is 192.168.1.1 so set the default route to match. How this works in a nut shell, the system looks in the /etc/hosts file to look for the IP address to send a packett to. This is good because you can add names of each machine on your local lan, and it will equate a name to IP addr of any local machine you add. If the system can not find the destination, in the /etc/hosts file, then it will forward it to the "default" route. This is why you want it pointed to your router. From here the packett is sent by your router.

Quote:
# Generated by dhcpcd for interface eth0
search
nameserver 192.168.0.1
This won't work either. You need the DNS addresses from your ISP. Your router is not a DNS server. So your router can not give a IP address for a name. ( URL ).

Many routers can pass the using systems the DNS information, once they have it. Probably some do not. Your ISP will know the DNS addresses for his network. You can call and ask. If you have a windoze machine that works, you can look at the network setup there. You can also look at the router configuration and see if you can find it in there. Mine shows it, I don't know if yours does or not.

Once you have those addresses, edit the /etc/resolv.conf file as root, and add them. Here is what mine looks like. Note the addresses are not private addresses, like your lan side.

Code:
cat /etc/resolv.conf
# search cliffshome.org
nameserver 206.47.244.52
nameserver 206.47.244.108
These addresses are good for Symaptico.ca, they won't work for any other network.

Hope this gets you going.
 
Old 01-11-2007, 02:09 PM   #7
max2004
Member
 
Registered: Feb 2005
Posts: 57

Original Poster
Rep: Reputation: 15
Quote:
Quote:
I set the default route using "route add 0.0.0.0 eth0"
This won't work.
You are right. The correct command that produces the routing table entry you posted is "route add default gw 192.168.0.1".

Now I can access the internet! Yeah! Thanks a lot!

Quote:
Quote:
# Generated by dhcpcd for interface eth0
search
nameserver 192.168.0.1
This won't work either. You need the DNS addresses from your ISP. Your router is not a DNS server.
I think it is. Since the address resolution works fine (now) and my /etc/resolv.conf file still looks that way, I guess the router runs a little dns server that itself asks a "real" dns server if it cannot find the IP in it's local cache.


So now if I statically configure my network settings it works again. But the dhcp still doesn't work. When I run "dhcpcd eth0" it still times out to get an IP (even if the network is configured statically) and after I ran the command, the interface is set down again. I wonder why this is, because (as I said) the computer never had trouble with the network and I didn't change any settings lately (the only thing I did was to install a vpn deamon, vpnc).

So I say thanks a lot to you and if you (or anyone else) should have an idea what I could do about the dhcp problem, I'd be happy to hear about it.

Max
 
Old 04-26-2007, 09:32 AM   #8
UhhMaybe
Member
 
Registered: Jul 2004
Location: Salt Lake City, Utah
Distribution: Absolute 12.0 Studio 64 1.3.0
Posts: 470

Rep: Reputation: 30
Cool

DHCP does not work with Static IP's. See here for the differences between DHCP and Static IP set up. http://tldp.org/HOWTO/HOWTO-INDEX/howtos.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP response timeout kam_kenneth Linux - Newbie 4 11-02-2004 03:28 PM
no DHCP response with ndiswrapper 0.11 and RealTek 8180 tbkih Linux - Wireless Networking 6 10-27-2004 06:41 AM
No valid DHCP response - Linux or Windows mrflora Linux - Networking 1 02-19-2004 03:14 PM
DHCP Requests and Discovers not receiving Response xmnemonic Linux - Networking 1 01-10-2004 09:01 PM
Linux times out waiting for a valid dhcp response enigma Z Linux - Networking 11 10-29-2003 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration