Hi,
 
I've configured my RedHat 7.1 linux system with a customised 2.4.9 kernel, Intel EtherPro100 network card and a Terayon Terajet cablemodem.
 
When I try to obtain an IP address from my ISP (NTL in the UK) using dhclient v3.0rc12 I see DHCPDISCOVER messages going out but no DHCPOFFERs, DCHPRESPONSEs, or DHCPACKs are being returned. I know the connection is working as my Win2k system works fine. So, I decided to monitor the network to see what Win2k was sending and try reproduce that on my linux system to see if I could get it to work.
 
This is what my Win2k system sends:
Frame    Time      Src MAC Addr    Dst MAC Addr    Protocol    Description      Src Other Addr     Dst Other Addr     Type Other Addr
 
2       2.234375     LOCAL      *BROADCAST      DHCP      Discover           (xid=5AD055E0)      0.0.0.0      255.255.255.255    
+ Frame: Base frame properties
+ ETHERNET: ETYPE = 0x0800 : Protocol = IP:  DOD Internet Protocol
+ IP: ID = 0xC6E; Proto = UDP; Len: 328
+ UDP: IP Multicast: Src Port: BOOTP Client, (68); Dst Port: BOOTP Server (67); Length = 308 (0x134)
  DHCP: Discover           (xid=5AD055E0)
      DHCP: Op Code           (op)     = 1 (0x1)
      DHCP: Hardware Type     (htype)  = 1 (0x1) 10Mb Ethernet
      DHCP: Hardware Address Length (hlen) = 6 (0x6)
      DHCP: Hops              (hops)   = 0 (0x0)
      DHCP: Transaction ID    (xid)    = 1523602912 (0x5AD055E0)
      DHCP: Seconds           (secs)   = 0 (0x0)
      DHCP: Flags             (flags)  = 0 (0x0)
          DHCP: 1............... = Broadcast
      DHCP: Client IP Address (ciaddr) = 0.0.0.0
      DHCP: Your   IP Address (yiaddr) = 0.0.0.0
      DHCP: Server IP Address (siaddr) = 0.0.0.0
      DHCP: Relay  IP Address (giaddr) = 0.0.0.0
      DHCP: Client Ethernet Address (chaddr) = <my NT MAC address>
      DHCP: Server Host Name  (sname)  = <Blank>
      DHCP: Boot File Name    (file)   = <Blank>
      DHCP: Magic Cookie = 99.130.83.99
      DHCP: Option Field      (options)
          DHCP: DHCP Message Type      = DHCP Discover
          DHCP: AutoConfigure          = YES
          DHCP: Client-identifier      = (Type: 1) <my NT MAC address>
          DHCP: Requested Address      = <a previously registered IP address>
          DHCP: Host Name              = <NT hostname>
          DHCP: Client Class information = (Length: 8) 4d 53 46 54 20 35 2e 30
          DHCP: Parameter Request List = (Length: 10) 01 0f 03 06 2c 2e 2f 1f 21 2b
          DHCP: End of this option field
 
This is how I've configured my dhclient.conf file to try and reproduce the above:
    option autoconfigure code 251 = boolean;
 
    interface "eth0" {
        send autoconfigure on;
        send dhcp-client-identifier 01:<my registered MAC address>;
        send host-name "<Linux hostname>";
        send vendor-class-identifier "MSFT 5.0";
        request subnet-mask, domain-name, routers, domain-name-servers, netbios-name-servers, netbios-node-type, netbios-scope, router-discovery, static-routes, vendor-encapsulated-options;
        prepend domain-name-servers 194.168.4.100, 194.168.8.100;
        media "media 10baseT/UTP";
       }
 
And now, this is what my Linux system sends using dhclient v3.0rc12 and the above config file:
Frame    Time    Src MAC Addr    Dst MAC Addr    Protocol    Description    Src Other Addr    Dst Other Addr    Type Other Addr
 
7    5.805000    INTEL nanana    *BROADCAST    DHCP    Discover           (xid=0784194B)    0.0.0.0    255.255.255.255    
+ Frame: Base frame properties
+ ETHERNET: ETYPE = 0x0800 : Protocol = IP:  DOD Internet Protocol
+ IP: ID = 0x0; Proto = UDP; Len: 328
+ UDP: IP Multicast: Src Port: BOOTP Client, (68); Dst Port: BOOTP Server (67); Length = 308 (0x134)
  DHCP: Discover           (xid=0784194B)
      DHCP: Op Code           (op)     = 1 (0x1)
      DHCP: Hardware Type     (htype)  = 1 (0x1) 10Mb Ethernet
      DHCP: Hardware Address Length (hlen) = 6 (0x6)
      DHCP: Hops              (hops)   = 0 (0x0)
      DHCP: Transaction ID    (xid)    = 126097739 (0x784194B)
      DHCP: Seconds           (secs)   = 0 (0x0)
      DHCP: Flags             (flags)  = 0 (0x0)
          DHCP: 0............... = No Broadcast
      DHCP: Client IP Address (ciaddr) = 0.0.0.0
      DHCP: Your   IP Address (yiaddr) = 0.0.0.0
      DHCP: Server IP Address (siaddr) = 0.0.0.0
      DHCP: Relay  IP Address (giaddr) = 0.0.0.0
      DHCP: Client Ethernet Address (chaddr) = <my Linux MAC address>
      DHCP: Server Host Name  (sname)  = <Blank>
      DHCP: Boot File Name    (file)   = <Blank>
      DHCP: Magic Cookie = 99.130.83.99
      DHCP: Option Field      (options)
          DHCP: DHCP Message Type      = DHCP Discover
          DHCP: Host Name              = <Linux hostname>
          DHCP: AutoConfigure          = YES
          DHCP: Parameter Request List = (Length: 10) 01 0f 03 06 2c 2e 2f 1f 21 2b
          DHCP: Client Class information = (Length: 8) 4d 53 46 54 20 35 2e 30
          DHCP: Client-identifier      = (Type: 1) <my registered MAC address>
          DHCP: End of this option field
 
With the output from running dhclient below:
[root@<Linux hostname> /root]# dhclient -1
Internet Software Consortium DHCP Client V3.0rc12
Copyright 1995-2001 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
 
Listening on LPF/eth0/<my Linux MAC address>
Sending on   LPF/eth0/<my Linux MAC address>
Sending on   Socket/fallback
Trying medium "media 10baseT/UTP" 1
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
Trying medium "media 10baseT/UTP" 1
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
Trying medium "media 10baseT/UTP" 1
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
Trying medium "media 10baseT/UTP" 1
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
Trying medium "media 10baseT/UTP" 1
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
Trying medium "media 10baseT/UTP" 1
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
No DHCPOFFERS received.
Unable to obtain a lease on first try.  Exiting.
[root@<Linux hostname> /root]#
 
As you can see the DHCPDISCOVER packets are pretty simular, apart from the Broadcast flag and Request IP address option being set on my NT system. Reading the RFC2131 (DHCP) it suggests that the Broadcast flag should be set if a computer systems IP stack cannot handle being passed a unicast packet before an IP address has been registered. Here's an extract
 
    A client that cannot receive unicast IP datagrams until its protocol software has been configured with an IP address SHOULD
    set the BROADCAST bit in the 'flags' field to 1 in any DHCPDISCOVER or DHCPREQUEST messages that client sends.
    The BROADCAST bit will provide a hint to the DHCP server and BOOTP relay agent to broadcast any messages to the client
    on the client's subnet. A client that can receive unicast IP datagrams before its protocol software has been configured SHOULD
    clear the BROADCAST bit to 0. The BOOTP clarifications document discusses the ramifications of the use of the BROADCAST bit [21].
 
Consequently, I believe if I set the Broadcast flag on my linux system I will recieve a DHCPOFFER and things will burst into life (wishful thinking)!!!
Therefore, I need to know whether this behaviour is a bug/feature of dhclient 3.0rc12 or for someone to explain to me how I go about setting the broadcast flag on my linux system to true (hacking the source code of dhclient 3.0rc12 is NOT an option). Please can anyone assist me.
 
Thanks,
Andrew Leach

Reply via email to