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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
06-01-2005, 03:52 PM
|
#1
|
Member
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223
Rep:
|
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
|
|
|
06-01-2005, 06:33 PM
|
#2
|
Member
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118
Rep:
|
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....
|
|
|
06-02-2005, 02:37 AM
|
#3
|
Member
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223
Original Poster
Rep:
|
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 ??
|
|
|
06-02-2005, 02:39 AM
|
#4
|
Member
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223
Original Poster
Rep:
|
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).
|
|
|
06-02-2005, 10:25 AM
|
#5
|
Member
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223
Original Poster
Rep:
|
anyone ?
|
|
|
06-02-2005, 11:04 AM
|
#6
|
Member
Registered: Feb 2004
Location: Southampton, England
Distribution: Laptop:Gentoo-i686-2.6.9-r9 Desktop:Slackware10 2.4.26
Posts: 298
Rep:
|
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.
|
|
|
06-03-2005, 04:16 AM
|
#7
|
Member
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223
Original Poster
Rep:
|
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.
|
|
|
06-04-2005, 03:43 AM
|
#8
|
Member
Registered: Feb 2004
Location: Southampton, England
Distribution: Laptop:Gentoo-i686-2.6.9-r9 Desktop:Slackware10 2.4.26
Posts: 298
Rep:
|
did it work?
|
|
|
06-04-2005, 12:34 PM
|
#9
|
Member
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118
Rep:
|
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).
|
|
|
06-08-2005, 04:39 PM
|
#10
|
Member
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223
Original Poster
Rep:
|
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.
|
|
|
06-09-2005, 03:08 AM
|
#11
|
Member
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223
Original Poster
Rep:
|
Debian gurus, please assist :-)
|
|
|
06-13-2005, 12:43 PM
|
#12
|
Member
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118
Rep:
|
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
|
|
|
06-13-2005, 07:32 PM
|
#13
|
Member
Registered: Aug 2003
Location: Denver, CO
Distribution: CentOS, Debian
Posts: 825
Rep:
|
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...
|
|
|
06-14-2005, 11:41 AM
|
#14
|
Member
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118
Rep:
|
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.
|
|
|
06-14-2005, 01:51 PM
|
#15
|
Member
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223
Original Poster
Rep:
|
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 :-)
|
|
|
All times are GMT -5. The time now is 02:04 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|