Bug 199687 - dhcp does not work in FC5 but it does on windowsxp (same network/nic)
dhcp does not work in FC5 but it does on windowsxp (same network/nic)
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
5
All Linux
medium Severity urgent
: ---
: ---
Assigned To: Jason Vas Dias
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-21 08:58 EDT by drago01
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-26 12:20:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
capture from ethreal (103.82 KB, application/octet-stream)
2006-07-21 08:58 EDT, drago01
no flags Details
tcpdump log (74.78 KB, text/plain)
2006-07-22 07:39 EDT, drago01
no flags Details

  None (edit)
Description drago01 2006-07-21 08:58:07 EDT
Description of problem:
My ISP gives the option using a static IP or dhcp. If I use the static IP
everything works fine. But using dhcp is no go.
dhclient always fails leaving the nic with no IP adress.
Version-Release number of selected component (if applicable):
dhclient-3.0.3-28

How reproducible:
always!!

Steps to Reproduce:
1. try  to get a dhcp offer from the network
2. you don't get one
3. no ip
  
Actual results:
system does not gets an ip adress.

Expected results:
system should get an ip adress.

Additional info:
I found this in /var/log/messages
Jul 19 09:08:39 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 6
Jul 19 09:08:45 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 9
Jul 19 09:08:54 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 10
Jul 19 09:09:04 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 12
Jul 19 09:09:16 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 19
Jul 19 09:09:35 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 5
Jul 19 09:09:40 chello062178124144 dhclient: No DHCPOFFERS received. 
I disabled my firewall and selinux still the same.
Comment 1 drago01 2006-07-21 08:58:08 EDT
Created attachment 132803 [details]
capture from ethreal
Comment 2 Jason Vas Dias 2006-07-21 19:49:33 EDT
Hi - 
I went ahead and installed ethereal on FC-5 to decode your capture.
(Please, in future, use tcpdump - eg. a tcpdump command like:
 $ tcpdump -nl -i ethX -vvv -s 8192 -X port bootpc or port bootps 2>&1 | 
   tee /tmp/tcpdump.dhcp.log
 when reporting dhcp bugs (where ethX is your ethernet interface, eg. 'eth0').
).

Anyway, it appears your dhcp server is sick / most un-RFC compliant - it IS
sending the OFFER, but it is sending it to the broadcast IP address AND the
broadcast ethernet address as the destination. So how is the client meant to
know for whom is the packet intended? Compliant DHCP servers are meant to 
send the offer to the ethernet address of the client, and usually also set
the destination IP address to the lease address - your dhcp server does neither.

Windoze DHCP clients by default explicitly send their ethernet addresses as the
'dhcp-client-identifier' ; this is not required by any RFC, yet old windoze
DHCP servers insisted upon this convention, in contravention of the RFCs, which
state that in the absence of an explicit dhcp-client-identifier option, the
ethernet address is to be used as the dhcp-client-identifier. 

It appears that your cable modem / router is also insisting on a 
dhcp-client-identifier from its clients.

Try making dhclient send the dhcp-client-identifier option :

1. In /etc/dhclient-ethX.conf (where ethX is the interface you are using,
   eg. 'eth0', add this line:
     send dhcp-client-identifier "00:11:09:e7:cb:c5";
  
   where "00:11:09:e7:cb:c5" appears, from the ethereal log, to be your
   interface ethernet address . Verify this by running
   # ip link
   ...
   N: ethX: ...
       link/ether 00:11:09:e7:cb:c5 brd ff:ff:ff:ff:ff:ff
 
2. Now try bringing up the interface
   # ifup ethX

Did it work?

Really nasty uncompliant old windoze-type DHCP servers also required you
to prepend a '1:' to the ethernet address dhcp-client-identifier string,
so if the above still does not work, try changing the dhclient-ethX.conf line
to:
  send dhcp-client-identifier "1:00:11:09:e7:cb:c5";
 
I hope the above solves the problem - if not, please gather a tcpdump log of
the DHCP traffic using the tcpdump command above and send me the 
/tmp/tcpdump.dhcp.log - thanks.
Comment 3 drago01 2006-07-22 07:39:18 EDT
Created attachment 132859 [details]
tcpdump log

I hav tryed both and they seem to fail; also my ISP does restrict me only to
connect 1 PC to the internet and they have stored my mac adress for this
purpose. (don't now if this matters here).
Comment 4 drago01 2006-07-22 08:04:58 EDT
dhclient -cf /etc/dhclient-eth0.conf eth0
shows in /var/log/messages:
Jul 22 14:09:45 chello062178124144 dhclient: Sending on   LPF/eth0/00:11:09:e7:cb:c5
Jul 22 14:09:45 chello062178124144 dhclient: Sending on   Socket/fallback
Jul 22 14:09:45 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 4
Jul 22 14:09:49 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 10
Jul 22 14:09:59 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 15
Jul 22 14:10:14 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 7
Jul 22 14:10:21 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 11
Jul 22 14:10:32 chello062178124144 dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 port 67 interval 14
Jul 22 14:10:46 chello062178124144 dhclient: No DHCPOFFERS received.
Jul 22 14:10:46 chello062178124144 dhclient: No working leases in persistent
database - sleeping.
(using both configs you suggested)
Comment 5 Jason Vas Dias 2006-07-25 14:25:49 EDT
Thanks for sending the log - yes, it shows your 00:11:09:e7:cb:c5 client 
sending DISCOVERs, and the server sending no OFFERs.

I've booted up an windoze-xp-pro client to verify exactly what they do send,
and it seems I made a mistake in the dhcp-client-identifier setting I
recommended in Comment #2 above - there should be no quotes around the 
'send dhcp-client-identifier xx;' xx value.

I was able to duplicate the packet sent by an XP client with a linux client
with these statements in the linux client's /etc/dhclient-ethX.conf:

'send dhcp-client-identifier 01:00:11:09:e7:cb:c5;
 send host-name "myhost";
 send vendor-class-identifier "MSFT 5.0";
'
where '00:11:09:e7:cb:c5' is your ethernet address (prepend '01:' to this), 
and "myhost" is the host name of your windows client (without the domain-name 
- ie. with no dots).

Try sending the DHCP options as above. 

It might also help if you first power-cycle the dhcp server cable modem / router
and ensure no other host on your network boots up first.

If this still fails, then please try to gather a trace of the packets sent by
the windows client when it successfully gets a dhcp lease (you might try 
ethereal for Windows); that will enable us to see what the linux dhcp client 
is missing - thanks.
Comment 6 drago01 2006-07-26 02:00:23 EDT
adding 
send dhcp-client-identifier 01:00:11:09:e7:cb:c5; 
seems to be enough and works fine...
question does this hurt other dhcp servers? if not I would suggest doing this by
default, because my provider (chello.at) is the most used broadbound ISP here in
Vienna.
Comment 7 Jason Vas Dias 2006-07-26 12:20:48 EDT
I'm glad to hear your linux client is finally able to obtain a DHCP lease.

No, I don't think the client should send the old windows style 
dhcp-client-identifier by default - it is required only by 
servers that are not in compliance with the DHCP RFCs (ie. servers
to which the name 'DHCP server' should not properly be applied,
because they do not implement the DHC Protocol correctly as specified
by the RFCs) - also modern windows DHCP servers have been fixed to not
require this option.

Also, making the client send this option by default, besides being 
in contravention of the RFCs, would confuse users who do not expect it 
and make sending non-windows style identifiers more difficult; we also
do not want to ship a dhclient.conf by default, because dhclient.conf
is meant for special-case customization, and those who need it will
already have their own customized dhclient.conf; also dhclient.conf
is potentially created by initscripts; also, how would an RPM install of a
dhclient.conf determine which ethernet address to use for the
dhcp-client-identifier - it can't know in advance which interface will be
used for dhcp; believe me, shipping a dhclient.conf in the RPM would open up 
a whole can of worms and we don't want to go there.

I will consider adding a '-W' option to the rawhide / FC-6 dhclient to 
make adding the old-Windoze-style dhcp-client-identifier much easier.
Comment 8 drago01 2006-07-27 09:23:39 EDT
ok thx for your help ;)
in anaconda this might not be so easy (using dhcp) but here I will just stick
with  a static IP (don't install so often so it does not really matters)

Note You need to log in before you can comment on or make changes to this bug.