SuSE GmbH

SuSE Support Database

Title: Client configuration of DHCP

----------

Mainpage o Searchform o History o Versions o Categories o Contents

----------

Client configuration of DHCP

Applies to

SuSE Linux: Version 6.2

Note: If you are using a version of SuSE Linux older than 6.2, please refer to the earlier version of this document.

Symptom:

You have attempted to configure your Linux system as a DHCP client, but it is not working as you expect.

Reason:

There can be many reasons why the DHCP client is not working.

If you are setting up your own network, you must be sure that the DHCP server is local accessible. For simple, local-area networks, this means that the client and server should be on the same physical network and logical network. In other words, there should be no routers between the client and server. More advanced networks may have DHCP relay agents on the local network. For example, most Internet Service providers selling service over Digital Subscriber Lines (xDSL) and Cable Modems in the United States have DHCP relay agents in their supplied hardware.

Another common problem is that the DHCP server is sending incomplete information when it sends the DHCP_OFFER to the client.

Lastly, there a special case exists for SuSE 6.2, in that some DHCP servers run by US providers seem unresponsive to DHCP requests from the network address configured in the 6.2 DHCP client package.

Solution:

  1. The most common problem heard in the United States prior to the release of 6.3 seems to be related to the IP address of the interface. The interface was set to addresses similar to 192.168.1.254, while some DHCP servers seem to require the more traditional address of 0.0.0.0.

    To eliminate this as a problem, you will need to modify the file /sbin/init.d/dhclient. Open the file in any text editor, and comment out and replace the line which reads

    	    ifconfig $NETDEV 192.168.1.254 broadcast 192.168.1.255 netmask 255.255.255.0 up
    
    so that it reads
    #	    ifconfig $NETDEV 192.168.1.254 broadcast 192.168.1.255 netmask 255.255.255.0 up
                ifconfig $NETDEV 0.0.0.0 up
    

    Now test the client again.

  2. The DHCP server is working...right? The best way to verify this with another client such as another Linux client which has already been configured, or another operating system environment which can acquire dhcp leases.

    If you are using your SuSE Linux as the DHCP server, make sure that you have installed the package "dhcp" which is located in the Series "n" ( Network-Support (TCP/IP, UUCP, Mail, News)). The main configuration file is /etc/dhcpd.conf and it must be modified to fit your network environment (ie available IP address range, DNS servers, gateways, etc.) The config file contains well documented examples, and there are also man pages for dhcpd and dhcpd.conf. You need to start the service with the script:

    /sbin/init.d/dhcp start 
    
    This service can also be automatically started on bootup, by modifying the /etc/rc.config file and setting the variables as necessary:
     
    START_DHCPD="yes"
    DHCPD_INTERFACE="eth0"
    
    It is recommended that these variables are set from YaST -> System Administration -> Change Configuration file, as this will automatically run SuSEconfig.

  3. Make sure that you have installed the DHCP client package "dhclient" which is located in the Series "n" ( Network-Support (TCP/IP, UUCP, Mail, News)). Once the package is installed, you need to configure the interface to be a DHCP interface. This can easily be done from YaST -> System Administration -> Network Configuration -> DHCP client.

  4. Use the utility traceroute to see if the DHCP server is on the same subnet and reachable, or if there is a host in between. If you are testing from the DHCP client, you will obviously need to temporarily configure it with a static address. More than one numbered line of output from traceroute indicates that your client and the server are not on the same subnet. If the DHCP server is on the other side of a router, you will either have to change your network topology or install and configure a DHCP relay agent.

    Note that in the case of Cable Modem providers and xDSL providers, their provided hardware is likely already configured as a DHCP relay agent. If unsure, you may wish to ask the provider how they enable your machines to reach the DHCP server.

  5. The DHCP client does not receive the full set of information it has asked for. You may need to modify the DHCP client configuration file /etc/dhclient.conf so that the clients request to the server will not require information that the servers are not set up to deliver, for example subnet mask and DNS. This is appropriate when the DHCP server is not under your control.

    In the configuration /etc/dhclient.conf file, add a comment mark , or # symbol, to the front of the line:

    require subnet-mask, domain-name-servers;
    

    The other, preferred, option is to change the configuration of the DHCP server so that it automatically offers this information.

  6. Does the DHCP_REQUEST packet even make it to the server? You can verify this by having a look in the /var/log/messages file on the server. In this file you can see the entire DHCP transaction taking place.

  7. If you have two or more network interfaces and only some of them should be set up via dhcp, proceed as follows:

    Note that this has changed with 6.2, and should continue to be the method for 6.3 (and perhaps future versions beyond).

    Configure both interfaces in YaST for the appropriate driver. For example, use YaST -> System Administration -> Integrate hardware into system -> Configure networking device, to select the correct driver for each network interface. If you have multiple ethernet cards of the same type, you will, as usual, need to describe them both in the one options line. This is not specific to DHCP; please refer to the SuSE handbook for further details.

    Next, use YaST to configure all networking interfaces in YaST -> System administration -> Network configuration -> Network base configuration. Select the type of interface for all of them names (in most cases eth0, eth1, ...). Also, enter IP address information for all interfaces you wish to statically configure (ie. those which will not be set up with DHCP.)

    Then, set the DHCP client to start on bootup from YaST -> System administration -> Network configuration -> DHCP Client. Note that this will cause Network base configuration to be greyed out. This is normal and does not indicate a problem.

    Finally, you must indicate the interfaces you wish to have configured via DHCP. You can do this by editing the file /etc/rc.config directly, or go to YaST -> System administration -> Change configuration file, which is at the bottom of the System administration menu. The important values are IFCONFIG_0 through IFCONFIG_4. For each of the four interfaces to be configured via DHCP, enter the value dhcpclient. Please be careful to enter the value exactly as written.

    After you reboot your system you should notice that your dhcp interfaces are up. You can verify this with the command ifconfig.

----------

See also:

----------

Keywords: DHCP, CLIENT, BOOTP

----------

Categories: DHCP

----------

Mainpage o Searchform o History o Versions o Categories o Contents

----------

SDB-dhcp_client62, Copyright SuSE GmbH, Nuremberg, Germany - Version: 02. Nov 1999
SuSE GmbH - Last generated: 09. Dec 1999 02:08:27 by jrodman with sdb_gen 1.00.0