PDA

View Full Version : Knoppix fails to obtain an IP via DHCP from the ADSL Router.



drekidd
08-17-2004, 02:04 AM
Ok, I have tried this alone and by using this [great] forum but I give-up!
I am using Knoppix as a learning exercise so far and havent played with it much.. apart from this annoying problem, and installing it in the first place :wink:

I have a made a dual-boot laptop build (XP and Knoppix 3.3) and when in XP, the machine will get a DHCP address from the ADSL router (its address is 192.168.200.254).

When I boot into knoppix HD install, the card (eth0) comes up but does not obtain an address.
Pump seems to try and do something as it appears in memory after every boot..

If I set the IP details manually, all works well... but as soon as I try DHCP, all fails.. Netcardconfig does not work - always fails..

My /etc/network/interfaces has:
"auto eth0
iface eth0 inet dhcp"
(I added these after installation).

My resolve.conf has
"nameserver 192.168.200.254"
which is what helps me connect to the net when I use manual IP addressing..

ifconfig does not show any ip details, naturally.


Someone, please explain why DHCP is not working for me!!

Thanks in advance guys (and girls?)

shah
08-17-2004, 02:48 AM
Your /etc/network/interfaces should look something like this:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

OR you can set a static I.P. and use gateway which refer to your router i.p. Then your /etc/network/interfaces should look something like this:

auto lo eth0
iface lo inet loopback

auto lo eth0
iface eth0 inet static
address 192.168.x.x
netmask 255.255.255.0
network 192.168.x.0
broadcast 192.168.x.255
gateway 192.168.x.x (what was set on your router)

You /etc/resolve.conf is wrong. The nameserver must be something that provided by your isp.
Usually ISP will give you two DNS IP. You can check using your Windows by running comannd : nslookup or ipconfig.

shah
08-17-2004, 02:51 AM
Sorry i made a mistake, your /etc/network/interface if using static ip should look like this:

auto lo eth0
iface lo inet loopback

iface eth0 inet static
address 192.168.x.x
netmask 255.255.255.0
network 192.168.x.0
broadcast 192.168.x.255
gateway 192.168.x.x (what was set on your router)

drekidd
08-17-2004, 07:49 AM
Thanks for the reply Shah,

But as I said, I can get connectivity if I assign a manual IP address but thats not what I want! I want to know why simple DHCP is not working..

I use PPPoA (my router gets RJ11 presentation, not ethernet) and so the nameserver I use does work (all clients get DHCP from the router, the router learns DNS settings from the ISP). I could change to the DNS servers my ISP gave me but that wont fix the DHCP problem and is not necessary as the router (not modem) learns the DNS server entries from the (Pipex) network.

I did not enter the loopback settings of my adapter as Im trying to concentrate on the eth0 issue, but please tell me if there's anything else you need?

Could you/someone please tell me what I need to configure to gaurantee DHCP to work as it happily does in Windows??????

Thanks again!

://DK

tearinghairout
08-17-2004, 11:54 AM
What happens if you try manually running
pump -i eth0on the command line?
(Must be done as root.)

drekidd
08-17-2004, 12:28 PM
'tearinghairout' - I like it :wink:
Call me tearinghairout2 :o)

I think the pump command is run by netcardconfig?... the result is the same none-the-less, the process fails... but pump stays in memory.

Something is defintely wrong.. not sure what as I did a HD install straight from the CD and all files were default.

Are you saying pump -i... should be enough? that's the feeling I have, but no joy :(

p.s - why is there not a crying smiley for me to choose? that's what I'm doing now!

sokminer
08-17-2004, 01:18 PM
try
# route add default gw 192.168.xxx.xxx

Can't remember your router's IP

drekidd
08-17-2004, 02:10 PM
try
# route add default gw 192.168.xxx.xxx

Can't remember your router's IP

Thanks Sokminer - that works when I have an IP (if I set one statically, or via dhcp), but as I havent gotten one via DHCP, there's no way of interacting with a default gw [192.168.200.254] or having a route!
Yes, I could use static IP entries but I'm really looking to get DHCP working..

I might grab a syslog trace when I get home and post it - if it contains any useful data.. I'm feeling it could be down to the embedded Intel card of my IBM stinkpad T30.. (Doesnt work with my T40 either)..
HOWEVER - it used to work when I booted from my third PC into the Knoppix CD which had a 3Com card.. I'll try that again tonight and see.. (didnt work the last time I tried when I started having trouble with the new HD install though)

baldyeti
08-17-2004, 02:40 PM
Does your ethernet adapter actually work when configured statically? I don't mean as reported by ifconfig, but can you actually ping other machines and use your router's services?

Some chipsets (notably some realtek) need the noapic cheat-code before actually working - even though they're recognised and eth0 is reported. If it doesn't work, then it might not even be able to broadcast to a DHCP server and get its parameters in return...

drekidd
08-17-2004, 02:46 PM
Does your ethernet adapter actually work when configured statically? I don't mean as reported by ifconfig, but can you actually ping other machines and use your router's services?

Some chipsets (notably some realtek) need the noapic cheat-code before actually working - even though they're recognised and eth0 is reported. If it doesn't work, then it might not even be able to broadcast to a DHCP server and get its parameters in return...

Yes, sorry, maybe I should've been clearer:
When I configure IP [192.168.200.3], subnet, default gw [192.168.200.254] and DNS is set as 192.168.200.254 in resolv.conf statically I can browse the internet and LAN.
I have tried the noapic I'm sure.. but will try again :)

If the noapic boot option does not work (as I think it may not do), do you have any other ideas of what it could be?
(P.s - what script file do I edit for the noapic? I may have only tried it with the bootCD!)

baldyeti
08-17-2004, 02:56 PM
> If the noapic boot option does not work (as I think it may not do), do you have any other ideas of what it could be?

I think I remember reading (on the knoppix or mepis dev-list) about the relative merits of pump and other dhcp client implementations, and some users having better luck with one rather than the other. Maybe you're just being unlucky with pump...

You could try the following (as root):
kill the background "pump" process
check if "ifconfig" reports eth0; otherwise "ifconfig eth0 up"
pump -i eth0

> (P.s - what script file do I edit for the noapic? I may have only tried it with the bootCD!)[/quote]
Try again from CD to see it works before bothering to make it permanent

user unknown
08-17-2004, 04:50 PM
For 'noapic', if you boot via lilo, you edit /etc/lilo.conf, and instert
append='noapic' to your linux-section.

Why don't you like static-settings?
I prefer static ones over dynamic.
It's more stable, more reliable, I don't need to look for my own IP, because it's allways the same.

And I can use /etc/hosts to specify my own hosts.
How do you get the other IPs when working with dhcp, to use ssh or ftp in your own network?

drekidd
08-17-2004, 05:04 PM
ahh.. thanks User unknown - saved me some time there ;)

To be honest I have always used DHCP even though the leases rarely expire and get re-used! The point for me is that I am (like most others) using Knoppix to learn Linux in a familiar Intel environment, and under windows all 3 of my workstations can get DHCP address's. I even have a wireless access point setup on 192.168.200.253 and it allows attached clients to request DHCP through it, to 192.168.200.254 which is the nets default gw.
DHCP is reliable and automated, so if I want to change the address's of all wireless clients and all local clients on the edge, I just change the DHCP settings and scope and they all change!

If it works in Windows, I want it to work in Knoppix/linux or at least know why it doesnt work! It's not like I'm trying to get Netbios or some other quirky thing to work, DHCP is not windows specific/reliant...

To answer the SSH/FTP question - I use NAT and filters on the Router to push FTP/HTTP requests to local IP address's - keeps things transparent :)

Thanks for your help U_UK..

user unknown
08-17-2004, 08:45 PM
I don't know NAT - perhaps it's the point.

My question is: I have a /etc/host:
192.168.4.2 desktop
192.168.4.3 laptop

To make a filetransfer, I start ftpd on the desktop, and
ftp desktop
on the laptop.

When I use dhcp (and NAT?) the laptop will find the desktop too?
How?

drekidd
08-17-2004, 10:47 PM
I don't know NAT - perhaps it's the point.

My question is: I have a /etc/host:
192.168.4.2 desktop
192.168.4.3 laptop

To make a filetransfer, I start ftpd on the desktop, and
ftp desktop
on the laptop.

When I use dhcp (and NAT?) the laptop will find the desktop too?
How?

Thanks for the reply Unknown.

..You seem to be talking about LAN-side DNS name resolution (resolving the name 'desktop' to an IP address) using the static hosts mechanism.. this is bit off-topic re: my LAN-side DHCP client issue with Knoppix.
My N.A.T (In-fact should've been P.A.T!) is a side-issue and not related to DHCP within the LAN - it is not affecting the clients ability to obtain an IP address.

PM me and I'll discuss, but I think we should leave this thread in the direction of working out why DHCP is not working in Knoppix (with my config/instance) when it works on the same machine when booting into Windows..

noapic
Also, I tried putting the 'noapic' option into my lilo.conf - no joy unfortunately ;(

Syslog [tail]
I ran syslog whilst running
pump -i eth0 after killing any pump instances in memory, and this is the common output:



Aug 17 22:38:49 Knoppix pumpd[811]: PUMP: sending discover
Aug 17 22:38:49 Knoppix pumpd[811]: reject: xid: 0x41332561 <--> 0x536b10f1
Aug 17 22:38:49 Knoppix pumpd[1054]: starting at (uptime 0 days, 0:07:22) Tue Aug 17 22:38:49 2004 (I restarted eth0 here as it keeps going down)
Aug 17 22:38:49 Knoppix pumpd[1054]: PUMP: sending discover
Aug 17 22:38:49 Knoppix pumpd[1054]: reject: xid: 0x37254133 <--> 0x536b1048


Thanks again everyone who has and may contribute to this thread :)

user unknown
08-18-2004, 08:25 AM
drekidd:

apic: perhaps "noapic apic=off" will work.

I would prefer discuss the question of 'why use dhcp in the lan' public, so more people might tell their thoughts. I'll open a new thread and try to cite my question.

drekidd
08-18-2004, 10:00 AM
Sure thing U_Unknown.. post/pm the thread link..
(Im not being difficult, just trying not to digress!)

Thanks again man..

p.s - Do you know what the 'noapic' option ommits from the h/w detection??
The cheat-codes doc doesnt say much!

p.p.s - I'm gonna try the DHCP request from another DHCP server today..

tearinghairout
08-18-2004, 12:46 PM
OK drekidd/tearinghairout2

This is a long shot, but the best I could come up with.

A bit of extended googling with 'dhcp reject xid' seems to suggest that the xid is something generated by the client (in this case pump) - that it presumably sends to the server in each request, and the server sends back in the response - so that it (the client) can keep track of which responses belong to which requests.
Apparently the client is supposed to generate the xid in such a way that no two values are ever used one after the other.

Now maybe (and this is complete guessing) your Knoppix dhcp client (pump) is basing the xid on the mac address (or part thereof) and since the same network card, with the same mac address is used in dual booting computer, it looks to your dhcp server that two different clients are trying to use the same xid, hence the reject message in your dmesg.

What if you try doing a complete reset of everything? Power down your dual boot computer, power down your nat/router/dhcp thingy, unplug the power cables from the wall, put them back in their original boxes, put the boxes outside your front door for a while, perhaps move houses, maybe think about emigrating. Then plug it all back in and boot Knoppix first (without booting XP).
Alternatively, try the DHCP request from another DHCP server today..

Please let us know how it goes - I love a challenge.
THO

drekidd
08-18-2004, 06:01 PM
LOL!!!! Yeah, I like it!!

You are right - a router (or switch, workstation etc.) will store an ARP entry, which is a record of your IP/MAC translation (Layer 2 to Layer 3 translation). In my Routers ARP cache I will see an entry.. so I actually did this before creating this thread:
released my ip in windows.
unplugged network cable.
shutdown.
shut down Router (clear ARP cache)
Start router (no reference to PC or IP in the router)
Start laptop - boot into linux
watched ARP cache - entry for Linux client appears but occassionally disappears depending on time and my attempts.

Tried pump -i eth0 etc. - no joy.

However, I like the sound of emigrating!!

I will try the other DHCP server here at work before I go home in a minute... edge of the seat stuff ;)

Thanks T.H.Out..

drekidd
08-18-2004, 07:48 PM
UPDATE!

Ok, so today I have my work laptop (Thinkpad T40) with me. The Laptop with the aforementioned HD install of Knoppix is at home (IBM Thinkpad T30).

I had tried the CD version of knoppix on my two laptops and my Windows 2000 PC. none of them currently obtain IP address's from my ADSL Router.
The 2000 pc did once me thinks, but not anymore.

So anyway, before emmigrating (!) I tried the CD version of Knoppix on my laptop at work. plugged my PC into the corporate network which uses DHCP and knoppix booted with an IP and Im now writing thjs damn message using Mozilla in Knoppix!!

So.. it seems it could be the DHCP of my Router versus my corporate switch on Linux (works in Windows remember!).. Hmm... gonna require some sniffing of some kind to work out if there are differences in DHCP options or something..

Anyway, this thread is not over!!
1) it might not be my router (Stop laughing!),
2) we/I need to know what it is that causes this.. I think I've seen others mention this in their threads...
3) My Router works fine in Windows.. so it could be the Router being crap or Linux having specific requirements..

Later peeps - Im tireddddddddd

://DK

Harry Kuhman
08-18-2004, 08:02 PM
So.. it seems it could be the DHCP of my Router versus my corporate switch on Linux (works in Windows remember!)..

You're right, it could well be your router conflicting with how Linix expects DHCP to work. Now that you say this I recall that over a year ago I tried a real hunk of junk Belkin wireless router on my network. It never could DHCP properly with Knoppix on my notebook (not sure if I even tried it with the desktop), although the same computer works fine with windows. I could make it work by manually setting the IP and related stuff. The router had other problems and they were so serious I had to stop using it. They never did issue a firmware fix for it; Belkin replaced the hardware with v2 hardware and started upgrading the firmware for that, but left all of us v1 hardware users abandoned with defective stuff.

Three guesses if I or my friends will ever buy Belkin routers again.

So anyway, you very well may find that your router doesn't quite work for DHCP with all system (was likely tested only under windows and doesn't exactly confirm with the DHCP spec). There is precident for this.

If it's any comfort, I've also tried Linksys, SMC, Netgear, Nextlan, and Dlink routers, and the models I've tried have all worked fine with Knoppix.

baldyeti
08-18-2004, 08:50 PM
Most probably you've tried already, but I don't think we've asked you yet: are you seeing this problem with both 2.4 and 2.6 kernels?

user unknown
08-19-2004, 06:49 AM
p.s - Do you know what the 'noapic' option ommits from the h/w detection??
The cheat-codes doc doesnt say much!
No - sorry. I just made trial-error with the cheat-codes on my system. (And found a hint, that apic=off and noapic might do different things here in the forum, but at least a month ago.

drekidd
08-20-2004, 02:50 PM
Most probably you've tried already, but I don't think we've asked you yet: are you seeing this problem with both 2.4 and 2.6 kernels?

No, I have only tried the one Kernel version on this build... You could have a point there.. But changing kernels will be another mamoth task for me to learn.. as I'm sure I read it's more than copying files :)

I haven't done anything else with this but over the weekend I will try and find the time and get traces from the Router and tcpdump etc.

It will probably turn-out to be the Router on reflection.. it is an old one (3Com Office Connect 812 ADSL Router) and hasn't been supported by them in a few years.. Their recent routers of the same type are by far better to use & feature rich.. I will get-hold of one of those and test..

Thanks again to you all.. I hope this thread is of some use to those having problems with a correctly setup Knoppix DHCP client.

://DK

baldyeti
08-20-2004, 03:23 PM
No, I have only tried the one Kernel version on this build...
Which build are you referring to? If you've got a recent enough version of knoppix, it'll have both kernels and you can try just booting from the CD and see if by any chance dhcp/pump works better under one version than the other.

I wonder under linux how to try dhcp by default, then fallback to static settings after a reasonable timeout?

drekidd
08-20-2004, 05:02 PM
No, I have only tried the one Kernel version on this build...
Which build are you referring to? If you've got a recent enough version of knoppix, it'll have both kernels and you can try just booting from the CD and see if by any chance dhcp/pump works better under one version than the other.

I wonder under linux how to try dhcp by default, then fallback to static settings after a reasonable timeout?

Knoppix 3.3..

I'll search the forum and see how to switch - I remember seeing the command set somewhere...

Ciao

baldyeti
08-25-2004, 09:12 PM
Knoppix 3.3 only came with a 2.4.x kernel; you'd need 3.4 for 2.6.x
You could download the latest version (don't forget to statically configure IP 1st ;-) or try installing the 2.6.8 kernel from kanotix (http://kanotix.com/files/kernel/).

But if I were you, I'd first try one of the alternative dhcp client implementations. "apt-cache search dhcp" reveals several, eg dhcp-client, dhcpcd, udhcpc... These are tiny downloads, worth a try.