Go to main content

Working With DHCP in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

DHCP Client Administration

The dhcpagent daemon 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 should not manually start and stop the dhcpagent daemon directly. Instead, as a privileged user on the DHCP client, you can use the ipadm command to affect the dhcpagent daemon's management of the network interface, if necessary.

ipadm Command Options for Working With the DHCP Client

This section summarizes actions that you can accomplish by using ipadm command options. These options are documented in the ipadm(8) man page.

  • Create the IP interface – The ipadm create-ip command creates the IP interface which you then configure with IP addresses. The addresses can either be static or dynamic. Creating the IP interface is a prerequisite command before you can assign the addresses.

  • Start the DHCP client – The ipadm create-addr -T dhcp DHCP-addrobj command initiates the interaction between the dhcpagent daemon 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.

    To specify a DHCP tunable parameter when a DHCP address is created, use the ipadm create-addr -T dhcp -p param=value DHCP-addrobj command. See the examples in Option Negotiation.

  • Request network configuration information only – The ipadm refresh-addr -i static-addrobj command 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 static IP address, but the 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 systems on the network. This option does not work with DHCP addresses.

  • Request a lease extension – The ipadm refresh-addr DHCP-addrobj command causes dhcpagent to issue a request to renew the lease. The DHCP 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 ipadm delete-addr -r DHCP-addrobj command 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 with a laptop, for example, when leaving a network and planning to start the system on a new network.

  • Drop the IP address – The ipadm delete-addr DHCP-addrobj command causes dhcpagent to take down the network interface without informing the DHCP server and cache the lease in the file system. This command enables the DHCP client to use the same IP address when it reboots.


Note -  Currently, the ipadm command has no equivalent functionality for the ifconfig [inet6] interface status command.

DHCP Protocol Details

With DHCPv4, the DHCP server supplies the subnet mask to be used with the assigned address. With DHCPv6, the subnet mask (also known as "prefix length") is assigned by the Router Advertisements, and is not controlled by the DHCP server.

DHCPv4 supplies a Hostname option that is used to set the system-wide node name. DHCPv6 has no such option.

MAC Address and Client ID

DHCPv4 uses the MAC address and an optional client ID to identify the DHCP client for purposes of assigning an address. Each time the same client arrives on the network, it gets the same address, if possible.

DHCPv6 uses basically the same scheme but makes the client ID mandatory and imposes structure on it. The client ID in DHCPv6 consists of two parts: a DHCP Unique Identifier (DUID) and an Identity Association Identifier (IAID) . The DUID identifies the system (rather than just an interface, as in DHCPv4), and the IAID identifies the interface on that system.

DUID+IAID can also be used with DHCPv4. These can be concatenated together unambiguously so that they can serve as the client ID. For compatibility reasons, this is not done for regular IPv4 interfaces. However, for logical interfaces (net0:1), DUID+IAID is used if no client ID is configured.

To configure a client ID for DHCPv6 you must specify a DUID rather than allowing the system to choose one automatically. You can do this globally for the daemon or on a per-interface basis. Use the following format to set the global DUID:

ipadm set-prop -p client-id=DUID dhcpv6

Use the following command to set a particular interface to use a given DUID when creating that DHCP interface and to make the system appear to be multiple independent clients to a DHCPv6 server:

ipadm create-addr -T addrconf -p client-id=DUID net0/v6

For an interface that already exists, to change the DUID for that interface when it is next enabled after reboot, change the client-id property as follows:

ipadm set-addrprop -p client-id=DUID net0/v6

Each Identity Association (IA) holds one type of address. For example, an identity association for temporary addresses (IA_TA) holds temporary addresses, while an identity association for non-temporary addresses (IA_NA), carries assigned addresses that are permanent. The version of DHCPv6 described in this guide provides only IA_NA associations.

Oracle Solaris assigns one IAID to each interface on demand. The IAID is stored in a file in the root file system so that it remains constant for the life of the system.

Logical Interfaces

In the DHCPv4 client, each logical interface is independent and is an administrative unit. You can configure specific logical interfaces to run DHCP by specifying a different value for the client-id when creating that interface. For example:

ipadm create-addr -T dhcp -p client-id=DUID net0/v4

DHCPv6 works differently because the zeroth logical interface (also known as the "physical" interface) on an IPv6 interface, unlike IPv4, is always a link-local. A link-local is used to automatically assign an IP address to a device in an IP network when no other assignment method is available, such as a DHCP server. Because the zeroth logical interface cannot be under DHCP control, even though DHCPv6 is run on the zeroth logical interface it assigns addresses only on non-zero logical interfaces.

In response to a DHCPv6 client request, the DHCPv6 server returns a list of addresses for the DHCP client to configure.

Option Negotiation

DHCPv6 has an Option Request option that provides a hint to the DHCP server of what the DHCP client prefers to see. If all possible options were sent from the DHCP server to the client, so much information could be sent that some of it would have to be dropped on the way to the client. The DHCP server can either use the hint to choose among the options to include in the reply, or ignore the hint and choose other items to include. On Oracle Solaris, for example, the preferred options might include the DNS address domain but would probably not include the net BIOS server.

The same type of hint is also provided for DHCPv4, but without the special Option Request option. Instead DHCPv4 uses the param_request_list property in ipadm. For more details, see the DHCP and Addrconf address properties as well as the DHCPv4 and DHCPv6 protocol properties in the ipadm(8) man page.

param_request_list Property Configuration Syntax

You configure a DHCPv6 client in much like a DHCPv4 client.

To set the global IPv4 option request list:

# ipadm set-prop -p param-request-list=1,3,6,12,15,17,28,43 dhcpv4

To add to the global IPv4 option request list:

# ipadm set-prop -p param-request-list+=50 dhcpv4

To configure an individual interface to omit the hostname option:

# ipadm create-addr -T dhcp -p param-request-list=1,3,6,15,17,28,43 net0/v4

To create a global request list for DHCPv6:

# ipadm set-prop -p param-request-list=23,24 dhcpv6 

To set an individual interface:

# ipadm create-addr -T addrconf -p param-request-list=21,22,23,24 net0/v6

Setting DHCP Client Configurations

The following sections cover the configurations for DHCPv4 and DHCPv6. In addition, information about the default IPV4 configuration is included.

Configurations for DHCPv4 and DHCPv6

  • The system uses DHCP on one physical network interface.

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

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

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

Default DHCPv4 Configuration

The DHCP client does not require a particular host name. If you want a client to request a specific host name, see DHCPv4 Client Host Names.