LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-01-2005, 03:52 PM   #1
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Rep: Reputation: 30
Question Cannot obtain DHCP lease


Hi,

Im using Debian 2.6.9 and it has worked fine for at long time. Now the box has been moved to a new network, and I cannot obtain an ipadress.
The windows computer next to it tells me the following about the network:

Code:
 IP Address. . . . . . . . . . . . : 192.168.1.34
 Subnet Mask . . . . . . . . . . . : 255.255.255.0
 Default Gateway . . . . . . . . . : 192.168.1.1
 DHCP Server . . . . . . . . . . . : 192.168.1.1
 DNS Servers . . . . . . . . . . . : 212.54.64.170
                                          212.54.64.171
When I run ifup -av, the output is:

Code:
Internet Systems Consortium DHCP Client v.3.0.1
...
Listening on LPF/eth0/00:e0....
Sending on LPF/eth0/00:e0....
Listening on LPF/lo/
Sending on LPF/lo/
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER.......
DHCPDISCOVER.......
DHCPDISCOVER.......
DHCPDISCOVER.......
DHCPDISCOVER.......
No DHCPOFFERS received

I think the configuration file is /etc/network/interfaces. This file has the following in it:

Code:
audo lo
iface lo inet loopback

hostname myname
auto eth0
iface eth0 inet dhcp
What can I do to get an ip address ????

thank you very much in advance
 
Old 06-01-2005, 06:33 PM   #2
vimico
Member
 
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118

Rep: Reputation: 15
The config seems ok... it did work before, didn't it?

Have you checked the hardware?

I know it sounds lame, but have you checked the cable? Does the cable of your Debian box is connected to the same hub/switch/router than the Windows computer next to you?

Is the LED on your ethernet card switched on?
Is the LED of the port used by the Debian box on the hub/switch/router switched on? (Perhaps you used the wrong input)

If you use a switch, have you made a reset? (Switches remember the ID of the ethernet card they are connected to. If you unplug one and plug in another, you might not get through).

I presume eth0 is the only network card in your system....
 
Old 06-02-2005, 02:37 AM   #3
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Original Poster
Rep: Reputation: 30
Thanks you very much for the kind reply :-)

1. Hardware has not been checked, but I will check it asap.
2. Led and Cable connection is OK.
3. Switch has been reset - no change.

What I've noticed is that the subnet mask is : 255.255.255.0 on the windows system and seems to be 255.255.255.255 on the linux system ??
 
Old 06-02-2005, 02:39 AM   #4
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Original Poster
Rep: Reputation: 30
Oh - and it was on a different system that it used to work! (also DHCP based though, but this time it is a router not a linux box which handles the ip adresses).
 
Old 06-02-2005, 10:25 AM   #5
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Original Poster
Rep: Reputation: 30
anyone ?
 
Old 06-02-2005, 11:04 AM   #6
0pal_t0ad
Member
 
Registered: Feb 2004
Location: Southampton, England
Distribution: Laptop:Gentoo-i686-2.6.9-r9 Desktop:Slackware10 2.4.26
Posts: 298

Rep: Reputation: 30
i've had problems with dhclient before. try dhcpcd -d

*oh! you're not using dhclient but still, give dhcpcd a go

Last edited by 0pal_t0ad; 06-02-2005 at 11:06 AM.
 
Old 06-03-2005, 04:16 AM   #7
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Original Poster
Rep: Reputation: 30
Thank you very much, I will try this asap :-)
dhclient is actually what I am using (what should work), ifup/ifdown is just additional tools.

Honestly I believe that it is a setup problem though... we'll c.
 
Old 06-04-2005, 03:43 AM   #8
0pal_t0ad
Member
 
Registered: Feb 2004
Location: Southampton, England
Distribution: Laptop:Gentoo-i686-2.6.9-r9 Desktop:Slackware10 2.4.26
Posts: 298

Rep: Reputation: 30
did it work?
 
Old 06-04-2005, 12:34 PM   #9
vimico
Member
 
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118

Rep: Reputation: 15
Quote:
Originally posted by TroelsSmit
What I've noticed is that the subnet mask is : 255.255.255.0 on the windows system and seems to be 255.255.255.255 on the linux system ??
255.255.255.255 is not the subnet mask. The subnet mask is provided by the DHCP server, after it has been found.

My guess is, that this is a broadcast address, meaning: "to anybody out there".

Broadcasts are dropped at some point - otherwise the Internet would be filled with them. Is the Windows computer connected to the same switch as your Debian box? (This would give them the same start position).

My suggestions for a more systematic approach to find the fault in your system:

Download the Knoppix Live CD.
Knoppix starts a DHCP client during the boot process.

Boot your Windows computer with the Knoppix CD. Verify that you have Internet access.

Back to the Linux box:
Boot your Linux box with the Knoppix CD. Check if you have Internet access or not.

If you get access on the Windows machine, but not on the Linux box, try to plug the network cable of the Windows machine into the Linux machine and reboot. This combination (Knoppix + Windows cable) should work.

From there, you can try the various combinations to find the component which is responsible.
(Debian + Windows cable)
(Knoppix + Linux cable)

Note: This all assumes that there IS a DHCP server available and that it uses some vanilla configuration. (DHCP servers can be configured to be very restrictive on whose queries to answer).
 
Old 06-08-2005, 04:39 PM   #10
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Original Poster
Rep: Reputation: 30
I guess the cable was loose or something, today almost everything seem to work, just the last part needed. Nameserver lookup and gateway :-)

First of all, everything works when I use knoppix!!

After having booted Debian, ifconfig tells me that I have an ipadress: 192.168.1.105

I can ping the rooter: ping 192.168.1.1 and get response !!
I can ping my windows machine and get response: 192.168.1.106

Now, when I write:

ping erlang.gbar.dtu.dk (university server) this fails with:
ping: unknown host erlang.gbar.dtu.dk

when I try to contact the ip directly:
ping 192.38.95.25
it tells me:
connect: Network is unreachable


As already mentioned I am using Debian - what do I have to do, to setup gateway/nameserver - and whatever more I might be missing ??

Thanks :-)

Last edited by TroelsSmit; 06-08-2005 at 04:45 PM.
 
Old 06-09-2005, 03:08 AM   #11
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Original Poster
Rep: Reputation: 30
Question

Debian gurus, please assist :-)
 
Old 06-13-2005, 12:43 PM   #12
vimico
Member
 
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118

Rep: Reputation: 15
To summarize:

If you use Debian, you can reach the local network only. If you use Knoppix, you can also reach the rest of the world.

Quote:
when I try to contact the ip directly:
ping 192.38.95.25
it tells me:
connect: Network is unreachable
This means there is no route to the outside world.

Quote:
ping erlang.gbar.dtu.dk (university server) this fails with:
ping: unknown host erlang.gbar.dtu.dk
This means, that the name resolution is not working. Possible causes:
  • no DNS server has been defined
  • a DNS server has been defined, but it does not exist
  • the host name itself does not exist

The fact that a DHCP server should be contacted is defined in /etc/network/interfaces, as you mentioned earlier:

Code:
...
iface eth0 inet dhcp
...
Another config file controls which information supplied by the DHCP server will actually be used: /etc/dhclient.conf. As mentioned earlier, the DHCP server not only provides the IP number, but also the IP of the DNS server (2nd problem), the IP of the router to the rest of the world (1st problem), etc.

dhclient.conf controls what info will be used and what info will be ignored.

The following options are useful:
  • request ... selects what info should be used
  • require ... if the options mentioned here are not provided by the DHCP server, the client aborts with an error message
  • send host-name "your host name": sends your host-name to the server, so that a DNS server can make "your host-name" accessible to others

Other hints: man dhclient.conf
 
Old 06-13-2005, 07:32 PM   #13
mcd
Member
 
Registered: Aug 2003
Location: Denver, CO
Distribution: CentOS, Debian
Posts: 825

Rep: Reputation: 33
you probably also need to tell your linux box that it should use the router (192.168.1.1) as the default gateway:

route add default gw 192.168.1.1

this can be specified in a config file, and i can tell you that in slackware that file is /etc/rc.d/rc.inet1.conf. i have a feeling it's gonna be different for you though...
 
Old 06-14-2005, 11:41 AM   #14
vimico
Member
 
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118

Rep: Reputation: 15
Quote:
Originally posted by mcd
you probably also need to tell your linux box that it should use the router (192.168.1.1) as the default gateway:

route add default gw 192.168.1.1
This shouldn't be necessary. It did work under Knoppix (a Live-CD) without manually setting a default gateway. This information is being offered by the DHCP server (otherwise Knoppix wouldn't know about it), but apparently not used by his Debian installation.
 
Old 06-14-2005, 01:51 PM   #15
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Original Poster
Rep: Reputation: 30
regarding: dhclient.conf

request ... selects what info should be used
require ... if the options mentioned here are not provided by the DHCP server, the client aborts with an error message
send host-name "your host name": sends your host-name to the server, so that a DNS server can make "your host-name" accessible to others

I have enabled all three lines with the standard debian arguments. I then ran "sudo ifconfig eth0 down" and then up.
According to dmesg there are no errors only: eth0: link up, 100 Mbps, full-duplx, lpa 0x45E1.

ifconfig shows that I indeed have an ip address.

the command: "sudo route add default gw 192.168.1.1" was tried - where should this be added so I don't have to run it after every boot ?

if I do a traceroute 192.38.95.25
I can then move through the router - but DNS still doesnt work.
192.168.1.1 1.996 ms
213.237.127.74 46 ms
*** *** *** ***
*** *** *** ***
130.225.244.209 333 ms
* * *
* * *
* * *
* * *
zzzZZzzzZZ ????

Doesn't a tool to setup these things exist ? I mean, I have all the information Im just not sure where to put it ??

Thanks for all the replys :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 lease unavailable bwilliam79 Linux - Networking 9 01-31-2008 05:37 AM
DHCP Lease Delete! kofi Linux - Networking 2 07-29-2004 07:00 PM
Renewing DHCP Lease JimKyle Linux - Networking 10 07-18-2004 06:54 PM
dhcp - get new IP when lease renewed chrisnewey Linux - Networking 0 03-30-2004 05:41 AM
CAN'T obtain a IP from DHCP neo_aj Linux - Networking 0 02-17-2004 04:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:04 PM.

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