sun.com docs.sun.com My Sun Worldwide Sites

Previous Previous     Contents     Index     Next Next

DHCP Client Administration

The Solaris DHCP client software does not require administration under normal system operation. The dhcpagent daemon automatically starts when the system boots, renegotiates leases, and stops when the system shuts down. You cannot manually start and stop the dhcpagent daemon directly. However, as superuser on the client system, you can use the ifconfig command to affect dhcpagent's management of the network interface, if necessary.

ifconfig Command Options Used With the DHCP Client

The ifconfig command enables you to do the following:

  • Start the DHCP client - The command ifconfig interface dhcp start initiates the interaction between dhcpagent and the DHCP server to obtain an IP address and a new set of configuration options. This command is useful when you change information that you want a client to use immediately, such as when you add IP addresses or change the subnet mask.

  • Request network configuration information only - The command ifconfig interface dhcp inform causes dhcpagent to issue a request for network configuration parameters, with the exception of the IP address. This command is useful when the network interface has a valid IP address, but the client system needs updated network options. For example, this command is useful if you do not use DHCP to manage IP addresses, but you do use it to configure hosts on the network.

  • Request a lease extension - The command ifconfig interface dhcp extend causes dhcpagent to issue a request to renew the lease. The client does automatically request to renew leases. However, you might want to use this command if you change the lease time and want clients to use the new lease time immediately, rather than waiting for the next attempt at lease renewal.

  • Release the IP address - The command ifconfig interface dhcp release causes dhcpagent to relinquish the IP address used by the network interface. Release of the IP address happens automatically when the lease expires. You might want to issue this command if the lease time is long and you need to take down the network interface for an extended period of time. You should use this command when you remove the system from the network.

  • Drop the IP address - The command ifconfig interface dhcp drop causes dhcpagent to take down the network interface without informing the DHCP server. This command enables the client to use the same IP address when it reboots.

  • Ping the network interface - The command ifconfig interface dhcp ping lets you determine if the interface is under the control of DHCP.

  • View the DHCP configuration status of the network interface - The command ifconfig interface dhcp status displays the current state of the DHCP client. The display indicates the following items:

    • If an IP address has been bound to the client

    • The number of requests sent, received, and declined

    • If this interface is the primary interface

    • Times when the lease was obtained, when it expires, and when renewal attempts are scheduled to begin

    For example:

    # ifconfig hme0 dhcp status
    Interface  State         Sent  Recv  Declined  Flags 
    hme0       BOUND            1     1         0   [PRIMARY]  
    (Began,Expires,Renew)=(08/16/2005 15:27, 08/18/2005 13:31, 08/17/2005 15:24)

Setting DHCP Client Configuration Parameters

The /etc/default/dhcpagent file on the client system contains tunable parameters for the dhcpagent. You can use a text editor to change several parameters that affect client operation. The /etc/default/dhcpagent file is well documented, so for more information, you should refer to the file as well as to the dhcpagent(1M) man page.

The /etc/dhcp.interface file is another location in which parameters affecting the DHCP client are set. Parameters set in this file are used by system startup scripts with the ifconfig command.

By default, the DHCP client is configured as follows:

  • The client system uses DHCP on one physical network interface.

    If you want to use DHCP on more than one physical network interface, see DHCP Client Systems With Multiple Network Interfaces.

  • The client system does not require a particular host name.

    If you want a client to request a specific host name, see DHCP Client Host Names.

  • The client is not automatically configured as a name service client if the DHCP client was configured after the Solaris installation.

    See DHCP Client Systems and Name Services for information about using name services with DHCP clients.

  • The client requests only the subnet mask, router IP address, client host name, and encapsulated vendor options.

    The DHCP client's parameter file can be set up to request more options in the PARAM_REQUEST_LIST keyword in the /etc/default/dhcpagent file. The DHCP server can be configured to provide options that were not specifically requested. See About DHCP Macros and Working With DHCP Macros (Task Map) for information about using DHCP server macros to send information to clients.

DHCP Client Systems With Multiple Network Interfaces

The DHCP client can simultaneously manage several different interfaces on one system. The interfaces can be physical interfaces or logical interfaces. Each interface has its own IP address and lease time. If more than one network interface is configured for DHCP, the client issues separate requests to configure them. The client maintains a separate set of network configuration parameters for each interface. Although the parameters are stored separately, some of the parameters are global in nature. The global parameters apply to the system as a whole, rather than to a particular network interface.

The host name, NIS domain name, and time zone are global parameters and should have the same values for each interface. However, these values may differ due to errors in the information specified by the DHCP administrator. To ensure that there is only one answer to a query for a global parameter, only the parameters for the primary network interface are requested. You can insert the word primary in the /etc/dhcp.interface file for the interface that you want to be treated as the primary interface. If the primary keyword is not used, the first interface in alphabetical order is considered to be the primary interface.

The DHCP client manages leases for logical interfaces and physical interfaces identically, except for the following limitations on logical interfaces:

  • The DHCP client does not manage the default routes that are associated with logical interfaces.

    The Solaris kernel associates routes with physical interfaces, not logical interfaces. When a physical interface's IP address is established, the necessary default routes should be placed in the routing table. If DHCP is used subsequently to configure a logical interface associated with that physical interface, the necessary routes should already be in place. The logical interface uses the same routes.

    When a lease expires on a physical interface, the DHCP client removes the default routes that are associated with the interface. When a lease expires on a logical interface, the DHCP client does not remove the default routes associated with the logical interface. The associated physical interface and possibly other logical interfaces might need to use the same routes.

    If you need to add or remove default routes that are associated with a DHCP-controlled interface, you can use the DHCP client event script mechanism. See DHCP Client Event Scripts.

  • The DHCP client does not automatically generate client identifiers for logical interfaces.

    The client identifier is used to uniquely identify a DHCP client so that it can receive configuration information that is specifically targeted to that client. For physical interfaces, the DHCP client identifier is derived from the media access control (MAC) address of the system's network interface hardware. However, no Internet standard exists for the format of DHCP client identifiers for physical interfaces that have multiple leases. You must create your own client identifier for any logical interface that you want to be configured through DHCP. The client identifier must be specified in the /etc/default/dhcpagent file with the interface.CLIENT_ID keyword. For example, to specify the client identifier orangutan-ce0-1 for the logical interface ce0:1, you would use the following entry:

    ce0:1.CLIENT_ID=orangutan-ce0-1

    See the /etc/default/dhcpagent file and the dhcpagent(1M) man page for more information about the parameters you can set in the file.

    If you do not configure a client identifier, ifconfig fails when it tries to configure the logical interface to use DHCP. The error message is:

    ifconfig: ce0:1: interface does not have a configured DHCP client id

DHCP Client Host Names

By default, the Solaris DHCP client does not supply its own host name, because the client expects the DHCP server to supply the host name. The Solaris DHCP server is configured to supply host names to DHCP clients by default. When you use the Solaris DHCP client and server together, these defaults work well. However, when you use the Solaris DHCP client with some third-party DHCP servers, the client might not receive a host name from the server. If the Solaris DHCP client does not receive a host name through DHCP, the client system looks at the /etc/nodename file for a name to use as the host name. If the file is empty, the host name is set to unknown.

If the DHCP server supplies a name in the DHCP Hostname option, the client uses that host name, even if a different value is placed in the /etc/nodename file. If you want the client to use a specific host name, you can enable the client to request that name. See the following procedure.

Previous Previous     Contents     Index     Next Next
Company Info Contact Terms of Use Privacy Copyright 1994-2007 Sun Microsystems, Inc.