Layer 3 - IP Services Configuration Guide

HomeSupportWirelessH3C WA2200 Series WLAN Access PointsConfigure & DeployConfiguration GuidesH3C WA Series WLAN Access Points Configuration Guide-6W100Layer 3 - IP Services Configuration Guide
03-DHCP Configuration
Title Size Download
03-DHCP Configuration 362.79 KB

Table of Contents

1 DHCP Overview·· 1-1

Introduction to DHCP· 1-1

DHCP Address Allocation· 1-2

Allocation Mechanisms· 1-2

Dynamic IP Address Allocation Process· 1-2

IP Address Lease Extension· 1-3

DHCP Message Format 1-3

DHCP Options· 1-4

DHCP Options Overview· 1-4

Introduction to DHCP Options· 1-5

Self-Defined Options· 1-5

Protocols and Standards· 1-9

2 DHCP Server Configuration· 2-1

Introduction to DHCP Server 2-1

Application Environment 2-1

DHCP Address Pool 2-1

IP Address Allocation Sequence· 2-3

DHCP Server Configuration Task List 2-3

Configuring an Address Pool for the DHCP Server 2-4

Configuration Task List 2-4

Creating a DHCP Address Pool 2-4

Configuring an Address Allocation Mode for a Common Address Pool 2-5

Configuring Dynamic Address Allocation for an Extended Address Pool 2-7

Configuring a Domain Name Suffix for the Client 2-8

Configuring DNS Servers for the Client 2-8

Configuring WINS Servers and NetBIOS Node Type for the Client 2-8

Configuring Gateways for the Client 2-9

Configuring the TFTP Server and Bootfile Name for the Client 2-9

Configuring Self-Defined DHCP Options· 2-10

Enabling DHCP· 2-11

Enabling the DHCP Server on an Interface· 2-11

Applying an Extended Address Pool on an Interface· 2-12

Configuring the DHCP Server Security Functions· 2-12

Configuration Prerequisites· 2-13

Enabling Unauthorized DHCP Server Detection· 2-13

Configuring IP Address Conflict Detection· 2-13

Displaying and Maintaining the DHCP Server 2-14

DHCP Server Configuration Examples· 2-14

Static IP Address Assignment Configuration Example· 2-15

Dynamic IP Address Assignment Configuration Example· 2-15

Self-Defined Option Configuration Example· 2-17

Troubleshooting DHCP Server Configuration· 2-17

3 DHCP Client Configuration· 3-1

Introduction to DHCP Client 3-1

Enabling the DHCP Client on an Interface· 3-1

Displaying and Maintaining the DHCP Client 3-2

DHCP Client Configuration Example· 3-2

 


l          Support of the H3C WA series WLAN access points (APs) for features may vary by AP model. For more information, see Feature Matrix.

l          The interface types and the number of interfaces vary by AP model.

l          The term AP in this document refers to common APs, wireless bridges, and mesh APs.

l          The models listed in this document are not applicable to all regions. Please consult your local sales office for the models applicable to your region.

 

DHCP Overview

This chapter includes these sections:

l          Introduction to DHCP

l          DHCP Address Allocation

l          DHCP Message Format

l          DHCP Options

l          Protocols and Standards

Introduction to DHCP

The fast expansion and growing complexity of networks result in scarce IP addresses assignable to hosts. Meanwhile, as many people need to take their laptops across networks, the IP addresses need to be changed accordingly. Therefore, related configurations on hosts become more complex. The Dynamic Host Configuration Protocol (DHCP) was introduced to solve these problems.

DHCP is built on a client-server model, in which a client sends a configuration request and then the server returns a reply to send configuration parameters such as an IP address to the client.

A typical DHCP application, as shown in Figure 1-1, includes a DHCP server and multiple clients (PCs and laptops).

Figure 1-1 A typical DHCP application

 

A DHCP client can get an IP address and other configuration parameters from the server on another subnet via a DHCP relay agent.

 

DHCP Address Allocation

Allocation Mechanisms

DHCP supports three mechanisms for IP address allocation.

l          Manual allocation: The network administrator assigns an IP address to a client like a WWW server, and DHCP conveys the assigned address to the client.

l          Automatic allocation: DHCP assigns a permanent IP address to a client.

l          Dynamic allocation: DHCP assigns an IP address to a client for a limited period of time, which is called a lease. Most clients obtain their addresses in this way.

Dynamic IP Address Allocation Process

Figure 1-2 Dynamic IP address allocation process

 

As shown in Figure 1-2, a DHCP client obtains an IP address from a DHCP server via four steps:

1)        The client broadcasts a DHCP-DISCOVER message to locate a DHCP server.

2)        A DHCP server offers configuration parameters such as an IP address to the client in a DHCP-OFFER message. The sending mode of the DHCP-OFFER is determined by the flag field in the DHCP-DISCOVER message. See DHCP Message Format for related information.

3)        If several DHCP servers send offers to the client, the client accepts the first received offer, and broadcasts it in a DHCP-REQUEST message to formally request the IP address.

4)        All DHCP servers receive the DHCP-REQUEST message, but only the server to which the client sent a formal request for the offered IP address returns a DHCP-ACK message to the client, confirming that the IP address has been allocated to the client, or returns a DHCP-NAK unicast message, denying the IP address allocation.

 

 

l          After the client receives the DHCP-ACK message, it will probe whether the IP address assigned by the server is in use by broadcasting a gratuitous ARP packet. If the client receives no response within the specified time, the client can use this IP address. Otherwise, the client sends a DHCP-DECLINE message to the server to request an IP address again.

l          If there are multiple DHCP servers, IP addresses offered by other DHCP servers are assignable to other clients.

 

IP Address Lease Extension

The IP address dynamically allocated by a DHCP server to a client has a lease. After the lease duration elapses, the IP address will be reclaimed by the DHCP server. If the client wants to use the IP address again, it has to extend the lease duration.

After the half lease duration elapses, the DHCP client will send the DHCP server a DHCP-REQUEST unicast message to extend the lease duration. Upon availability of the IP address, the DHCP server returns a DHCP-ACK unicast confirming that the client’s lease duration has been extended, or a DHCP-NAK unicast denying the request.

If the client receives the DHCP-NAK message, it will broadcast another DHCP-REQUEST message for lease extension after 7/8 lease duration elapses. The DHCP server will handle the request as above mentioned.

DHCP Message Format

Figure 1-3 gives the DHCP message format, which is based on the BOOTP message format and involves eight types. These types of messages have the same format except that some fields have different values. The numbers in parentheses indicate the size of each field in bytes.

Figure 1-3 DHCP message format

 

l          op: Message type defined in option field. 1 = REQUEST, 2 = REPLY

l          htype, hlen: Hardware address type and length of a DHCP client.

l          hops: The number of relay agents a request message traveled.

l          xid: Transaction ID, a random number chosen by the client to identify an IP address allocation.

l          secs: Filled in by the client, the number of seconds elapsed since the client began address acquisition or renewal process. Currently this field is reserved and set to 0.

l          flags: The leftmost bit is defined as the BROADCAST (B) flag. If this flag is set to 0, the DHCP server sent a reply back by unicast; if this flag is set to 1, the DHCP server sent a reply back by broadcast. The remaining bits of the flags field are reserved for future use.

l          ciaddr: Client IP address.

l          yiaddr: 'your' (client) IP address, assigned by the server.

l          siaddr: Server IP address, from which the clients obtained configuration parameters.

l          giaddr: IP address of the first relay agent a request message traveled.

l          chaddr: Client hardware address.

l          sname: The server host name, from which the client obtained configuration parameters.

l          file: Bootfile name and routing information, defined by the server to the client.

l          options: Optional parameters field that is variable in length, which includes the message type, lease, DNS IP address, WINS IP address.

DHCP Options

DHCP Options Overview

The DHCP message adopts the same format as the Bootstrap Protocol (BOOTP) message for compatibility, but differs from it in the option field, which identifies new features for DHCP.

DHCP uses the option field in DHCP messages to carry control information and network configuration parameters, implementing dynamic address allocation and providing more network configuration information for clients.

Figure 1-4 shows the DHCP option format.

Figure 1-4 DHCP option format

 

Introduction to DHCP Options

The common DHCP options are:

l          Option 3: Router option. It specifies the gateway address to be assigned to the client.

l          Option 6: DNS server option. It specifies the DNS server IP address to be assigned to the client.

l          Option 51: IP address lease option.

l          Option 53: DHCP message type option. It identifies the type of the DHCP message.

l          Option 55: Parameter request list option. It is used by a DHCP client to request specified configuration parameters. The option contains values that correspond to the parameters requested by the client.

l          Option 66: TFTP server name option. It specifies a TFTP server to be assigned to the client.

l          Option 67: Bootfile name option. It specifies the bootfile name to be assigned to the client.

l          Option 150: TFTP server IP address option. It specifies the TFTP server IP address to be assigned to the client.

l          Option 121: Classless route option. It specifies a list of classless static routes (the destination addresses in these static routes are classless) that the requesting client should add to its routing table.

l          Option 33: Static route option. It specifies a list of classful static routes (the destination addresses in these static routes are classful) that a client should add to its routing table. If Option 121 exists, Option 33 is ignored.

For more information about DHCP options, see RFC 2132.

Self-Defined Options

Some options, such as Option 43, have no unified definitions in RFC 2132. The formats of some self-defined options are introduced as follows.

Vendor-specific option (Option 43)

DHCP servers and clients exchange vendor-specific information through messages containing the vendor-specific option (Option 43). Upon receiving a DHCP message requesting Option 43 (in Option 55), the DHCP server returns a response message containing Option 43 to assign vendor-specific information to the DHCP client.

The DHCP client can obtain the following information through Option 43:

l          Auto-Configuration Server (ACS) parameters, including the ACS URL, username, and password.

l          Service provider identifier, which is acquired by the customer premises equipment (CPE) from the DHCP server and sent to the ACS for selecting vendor-specific configurations and parameters. For more information about CPE and ACS, see CWMP in the Network Management and Monitoring Configuration Guide.

l          Preboot Execution Environment (PXE) server address, which is used to obtain the bootfile or other control information from the AC.

l          Access controller (AC) address, which is used by an AP to obtain the bootfile or other control information from the AC.

1)        Format of Option 43

Figure 1-5 shows the format of Option 43.

Figure 1-5 Format of Option 43

 

For the sake of scalability, network configuration parameters are carried in different sub-options of Option 43 so that the DHCP client can obtain more information through Option 43 as shown in Figure 1-5. The sub-option fields are described as follows:

l          Sub-option type: Type of a sub-option. The field value can be 0x01, 0x02, or 0x80. 0x01 indicates an ACS parameter sub-option. 0x02 indicates a service provider identifier sub-option. 0x80 indicates a PXE server address sub-option.

l          Sub-option length: Length of a sub-option excluding the sub-option type and sub-option length fields.

l          Sub-option value: Value of a sub-option.

2)        Format of the sub-option value field of Option 43

l          As shown in Figure 1-6, the value field of the ACS parameter sub-option is filled in with variable ACS URL, username, and password separated with a space (0x20) in between.

Figure 1-6 Format of the value field of the ACS parameter sub-option

 

l          The value field of the service provider identifier sub-option contains the service provider identifier.

Figure 1-7 shows the format of the value field of the PXE server address sub-option. Currently, the value of the PXE server type can only be 0. The server number field indicates the number of PXE servers contained in the sub-option. The server IP addresses field contains the IP addresses of the PXE servers.

Figure 1-7 Format of the value field of the PXE server address sub-option

 

Relay agent option (Option 82)

Option 82 is the relay agent option in the option field of the DHCP message. It records the location information of the DHCP client. When a DHCP relay agent or DHCP snooping device receives a client’s request, it adds Option 82 to the request message and sends it to the server.

The administrator can locate the DHCP client to further implement security control and accounting. The Option 82 supporting server can also use such information to define individual assignment policies of IP address and other parameters for the clients.

Option 82 involves at most 255 sub-options. At least one sub-option must be defined. Now the DHCP relay agent supports two sub-options: sub-option 1 (Circuit ID) and sub-option 2 (Remote ID).

Option 82 has no unified definition. Its padding formats vary with vendors.

You can use the following two methods to configure Option 82:

l          User-defined method: Manually specify the content of Option 82.

l          Non-user-defined method: Pad Option 82 in the default normal or verbose mode.

If you choose the second method, you can specify the padding format for the sub-options as ASCII or HEX.

1)        Normal padding format

The padding contents for sub-options in the normal padding format are:

l          Sub-option 1: Padded with the VLAN ID and interface number of the interface that received the client’s request. The following figure gives its format. The value of the sub-option type is 1, and that of the circuit ID type is 0.

Figure 1-8 Sub-option 1 in normal padding format

 

l          Sub-option 2: Padded with the MAC address of the DHCP relay agent interface or the MAC address of the DHCP snooping device that received the client’s request. The following figure gives its format. The value of the sub-option type is 2, and that of the remote ID type is 0.

Figure 1-9 Sub-option 2 in normal padding format

 

2)        Verbose padding format:

The padding contents for sub-options in the verbose padding format are:

l          Sub-option 1: Padded with the user-specified access node identifier (ID of the device that adds Option 82 in DHCP messages), and type, number, and VLAN ID of the interface that received the client’s request. Its format is shown in Figure 1-10.

Figure 1-10 Sub-option 1 in verbose padding format

 

In Figure 1-10, except that the VLAN ID field has a fixed length of 2 bytes, all the other padding contents of sub-option 1 are length variable.

 

l          Sub-option 2: Padded with the MAC address of the DHCP relay agent interface or the MAC address of the DHCP snooping device that received the client’s request. It has the same format as that in normal padding format, as shown in Figure 1-9.

Option 184

Option 184 is a reserved option, and parameters in the option can be defined as needed. The AP supports Option 184 carrying the voice related parameters, so a DHCP client with voice functions can get an IP address along with specified voice parameters from the DHCP server.

Option 184 involves the following sub-options:

l          Sub-option 1: IP address of the primary network calling processor, which is a server serving as the network calling control source and providing program downloads.

l          Sub-option 2: IP address of the backup network calling processor that DHCP clients will contact when the primary one is unreachable.

l          Sub-option 3: Voice VLAN ID and the result whether DHCP clients take this ID as the voice VLAN or not.

l          Sub-option 4: Failover route that specifies the destination IP address and the called number (SIP users use such IP addresses and numbers to communicate with each other) that a SIP user uses to reach another SIP user when both the primary and backup calling processors are unreachable.

 

You must define the sub-option 1 to make other sub-options take effect.

 

Protocols and Standards

l          RFC 2131: Dynamic Host Configuration Protocol

l          RFC 2132: DHCP Options and BOOTP Vendor Extensions

l          RFC 1542: Clarifications and Extensions for the Bootstrap Protocol

l          RFC 3046: DHCP Relay Agent Information Option

 


DHCP Server Configuration

This chapter includes these sections:

l          Introduction to DHCP Server

l          DHCP Server Configuration Task List

l          Displaying and Maintaining the DHCP Server

l          DHCP Server Configuration Examples

l          Troubleshooting DHCP Server Configuration

 

 

l          The DHCP server configuration is supported only on Layer 3 Ethernet interfaces (or subinterfaces), virtual Ethernet interfaces, VLAN interfaces, serial interfaces, MP-group interfaces, and loopback interfaces. The secondary IP address pool configuration is not supported on serial, MP-group or loopback interfaces.

l          Support for the DHCP server configuration depends on the AP model.

 

Introduction to DHCP Server

Application Environment

The DHCP server is well suited to the network where:

l          It is hard to implement manual configuration and centralized management.

l          The hosts are more than the assignable IP addresses and it is impossible to assign a fixed IP address to each host. For example, an ISP limits the number of hosts to access the Internet at a time, so lots of hosts need to acquire IP addresses dynamically.

l          A few hosts need fixed IP addresses.

DHCP Address Pool

Address pool types

DHCP address pools can be classified into two types:

l          Common address pool: Supports both static binding and dynamic allocation.

l          Extended address pool: Supports dynamic allocation only.

Common address pool structure

In response to a client’s request, the DHCP server selects an idle IP address from an address pool and sends it together with other parameters such as the lease time and DNS server address to the client.

The common address pool database is organized as a tree. The root of the tree is the address pool for natural networks, branches are address pools for subnets, and leaves are addresses statically bound to clients. For the same level address pools, a previously configured pool has a higher selection priority than a new one.

At the very beginning, subnetworks inherit network parameters and clients inherit subnetwork parameters. Therefore, common parameters, for example a DNS server address, should be configured at the highest (network or subnetwork) level of the tree.

After establishment of the inheritance relationship, the new configuration at the higher level (father) of the tree will be:

l          Inherited if the lower level (child) has no such configuration, or

l          Overridden if the lower level (child) has such configuration.

 

l          The extended address pool database is not organized as a tree.

l          The IP address lease does not enjoy the inheritance attribute.

 

Principles for selecting an address pool

The DHCP server observes the following principles to select an address pool when assigning an IP address to a client:

1)        If there is an address pool where an IP address is statically bound to the MAC address or ID of the client, the DHCP server will select this address pool and assign the statically bound IP address to the client. For the configuration of this address pool, see Configuring manual address allocation.

2)        If the receiving interface has an extended address pool referenced, the DHCP server will assign an IP address from this address pool. If no IP address is available in the address pool, the DHCP server will fail to assign an address to the client. For the configuration of such an address pool, see Configuring Dynamic Address Allocation for an Extended Address Pool.

3)        Otherwise, the DHCP server will select the smallest common address pool that contains the IP address of the receiving interface (if the client and the server reside on the same network segment), or the smallest address pool that contains the IP address specified in the giaddr field of the client’s request (if a DHCP relay agent is in-between). If no IP address is available in the address pool, the DHCP server will fail to assign an address to the client because it cannot assign an IP address from the father address pool to the client. For the configuration of such address pool, see Configuring dynamic address allocation.

4)        For example, two common address pools are configured on the DHCP server, 1.1.1.0/24 and 1.1.1.0/25. If the IP address of the interface receiving DHCP requests is 1.1.1.1/25, the DHCP server will select IP addresses for clients from address pool 1.1.1.0/25. If no IP address is available in the address pool, the DHCP server will fail to assign addresses to clients. If the IP address of the interface receiving DHCP requests is 1.1.1.130/25, the DHCP server will select IP addresses for clients from the 1.1.1.0/24 address pool.

 

Keep the IP addresses for dynamic allocation within the subnet where the interface of the DHCP server or DHCP relay agent resides to avoid wrong IP address allocation.

 

IP Address Allocation Sequence

A DHCP server assigns an IP address to a client according to the following sequence:

1)        The IP address manually bound to the client’s MAC address or ID

2)        The IP address that was ever assigned to the client

3)        The IP address designated by the Option 50 field in a DHCP-DISCOVER message

4)        The first assignable IP address found in an extended or a common address pool

5)        The IP address that was a conflict or passed its lease duration

If no IP address is assignable, the server will not respond.

 

Option 50 is the requested IP address field in a DHCP-DISCOVER message, in which the client specifies the IP address that it wants to obtain. The contents of Option 50 are determined by the client.

 

DHCP Server Configuration Task List

Complete the following tasks to configure the DHCP server:

Task

Remarks

Configuring an Address Pool for the DHCP Server

Required

Enabling DHCP

Required

Enabling the DHCP Server on an Interface

Optional

Applying an Extended Address Pool on an Interface

Required by the extended address pool configuration

When configuring a common address pool, ignore this task.

Configuring the DHCP Server Security Functions

Optional

 

Configuring an Address Pool for the DHCP Server

Configuration Task List

Complete the following tasks to configure an address pool:

Task

Remarks

Creating a DHCP Address Pool

Required

Configuring an Address Allocation Mode for a Common Address Pool

Configuring manual address allocation

Required to configure either of the two for the common address pool configuration

Configuring dynamic address allocation

Configuring Dynamic Address Allocation for an Extended Address Pool

Required for the extended address pool configuration

Configuring a Domain Name Suffix for the Client

Optional

Configuring DNS Servers for the Client

Configuring WINS Servers and NetBIOS Node Type for the Client

Configuring Gateways for the Client

Configuring the TFTP Server and Bootfile Name for the Client

Configuring Self-Defined DHCP Options

 

Creating a DHCP Address Pool

When creating a DHCP address pool, specify it as a common address pool or an extended address pool.

Follow these steps to create a DHCP address pool:

To do…

Use the command…

Remarks

Enter system view

system-view

Create a DHCP address pool and enter its view

dhcp server ip-pool pool-name [ extended ]

Required

No DHCP address pool is created by default.

 

A common address pool and an extended address pool are different in address allocation mode configuration. Configurations of other parameters (such as the domain name suffix and DNS server address) for them are the same.

 

Configuring an Address Allocation Mode for a Common Address Pool

 

You can configure either the static binding or dynamic address allocation for an address pool as needed.

 

It is required to specify an address range for the dynamic address allocation. A static binding is a special address pool containing only one IP address.

Configuring manual address allocation

Some DHCP clients such as a WWW server need fixed IP addresses. You can create a static binding of a client’s MAC or ID to IP address in the DHCP address pool.

When the client with the MAC address or ID requests an IP address, the DHCP server will find the IP address from the binding for the client.

A DHCP address pool now supports only one static binding, which can be a MAC-to-IP or ID-to-IP binding.

Follow these steps to configure a static binding in a DHCP address pool:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter common address pool view

dhcp server ip-pool pool-name

Bind an IP address

static-bind ip-address ip-address [ mask-length | mask mask ]

Required

No IP addresses are statically bound by default.

Bind an MAC address or client ID

Bind a MAC address

static-bind mac-address mac-address

Required to configure either of the two

Neither is bound statically by default.

Bind a client ID

static-bind client-identifier client-identifier

Specify the lease duration for the IP address

expired { day day [ hour hour [ minute minute ] ] | unlimited }

Optional

By default, the lease duration of the IP address is unlimited.

 

 

l          Use the static-bind ip-address command together with static-bind mac-address or static-bind client-identifier command to accomplish a static binding configuration.

l          In a DHCP address pool, if you execute the static-bind mac-address command before the static-bind client-identifier command, the latter will overwrite the former and vice versa.

l          If you use the static-bind ip-address, static-bind mac-address, or static-bind client-identifier command repeatedly in the DHCP address pool, the new configuration will overwrite the previous one.

l          The IP address of the static binding cannot be an interface address of the DHCP server. Otherwise, an IP address conflict may occur and the bound client cannot obtain an IP address correctly.

l          The ID of the static binding must be identical to the ID displayed by using the display dhcp client verbose command on the client. Otherwise, the client cannot obtain an IP address.

l          When the AP serves as a DHCP client, you need to manually bind the DHCP client’s ID to an IP address on the DHCP server; otherwise, the DHCP client cannot obtain a static IP address.

l          If the interfaces on a DHCP client share the same MAC address, you need to specify the client ID, rather than MAC address, in a static binding to identify the requesting interface; otherwise, the client may fail to obtain an IP address.

 

Configuring dynamic address allocation

You need to specify one and only one address range using a mask for the dynamic address allocation.

To avoid address conflicts, the DHCP server excludes IP addresses used by the GW or FTP server from dynamic allocation.

You can specify the lease duration for a DHCP address pool different from others, and a DHCP address pool can only have the same lease duration. A lease does not enjoy the inheritance attribute.

Follow these steps to configure the dynamic address allocation:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter common address pool view

dhcp server ip-pool pool-name

Specify an IP address range

network network-address [ mask-length | mask mask ]

Required

Not specified by default, meaning no assignable address.

Specify the address lease duration

expired { day day [ hour hour [ minute minute ] ] | unlimited }

Optional

One day by default.

Return to system view

quit

Exclude IP addresses from automatic allocation

dhcp server forbidden-ip low-ip-address [ high-ip-address ]

Optional

Except IP addresses of the DHCP server interfaces, all addresses in the DHCP address pool are assignable by default.

 

l          In DHCP address pool view, using the network command repeatedly overwrites the previous configuration.

l          After you exclude IP addresses from automatic allocation using the dhcp server forbidden-ip command, neither a common address pool nor an extended address pool can assign these IP addresses through dynamic address allocation.

l          Using the dhcp server forbidden-ip command repeatedly can exclude multiple IP address ranges from allocation.

 

Configuring Dynamic Address Allocation for an Extended Address Pool

Extended address pools support dynamic address allocation only.

When configuring address allocation for an extended address pool, you need to specify:

l          Assignable IP address range

l          Mask

After the assignable IP address range and the mask are specified, the address pool becomes valid.

Follow these steps to configure dynamic address allocation for an extended address pool:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter extended address pool view

dhcp server ip-pool pool-name extended

Specify the IP address range

network ip range min-address max-address

Required

Not specified by default.

Specify the IP address mask

network mask mask

Required

Not specified by default.

Specify the address lease duration

expired { day day [ hour hour [ minute minute ] ] | unlimited }

Optional

One day by default.

Exclude IP addresses from dynamic allocation

forbidden-ip ip-address&<1-8>

Optional

Except IP addresses of the DHCP server interfaces, all addresses in the DHCP address pool are assignable by default.

 

Excluded IP addresses specified with the forbidden-ip command in DHCP address pool view are not assignable in the current extended address pool, but are assignable in other address pools.

 

Configuring a Domain Name Suffix for the Client

You can specify a domain name suffix in each DHCP address pool on the DHCP server to provide the clients with the domain name suffix. With this suffix assigned, the client only needs to input part of a domain name, and the system will add the domain name suffix for name resolution. For more information about DNS, see DNS in the Layer 3 – IP Services Configuration Guide.

Follow these steps to configure a domain name suffix in the DHCP address pool:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter DHCP address pool view

dhcp server ip-pool pool-name [ extended ]

Specify a domain name suffix for the client

domain-name domain-name

Required

Not specified by default.

 

Configuring DNS Servers for the Client

When a DHCP client wants to access a host on the Internet via the host name, it contacts a Domain Name System (DNS) server holding host name-to-IP address mappings to get the host IP address. You can specify up to eight DNS servers in the DHCP address pool.

Follow these steps to configure DNS servers in the DHCP address pool:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter DHCP address pool view

dhcp server ip-pool pool-name [ extended ]

Specify DNS servers for the client

dns-list ip-address&<1-8>

Required

Not specified by default.

 

Configuring WINS Servers and NetBIOS Node Type for the Client

A Microsoft DHCP client using NetBIOS protocol contacts a Windows Internet Naming Service (WINS) server for name resolution. Therefore, the DHCP server should assign a WINS server address when assigning an IP address to the client.

You can specify up to eight WINS servers in a DHCP address pool.

You need to specify in a DHCP address pool a NetBIOS node type for the client to approach name resolution. There are four NetBIOS node types:

l          b (broadcast)-node: The b-node client sends the destination name in a broadcast message. The destination returns its IP address to the client after receiving the message.

l          p (peer-to-peer)-node: The p-node client sends the destination name in a unicast message to the WINS server, and the WINS server returns the destination IP address.

l          m (mixed)-node: A combination of broadcast first and peer-to-peer second. The m-node client broadcasts the destination name, if no response is received, then unicasts the destination name to the WINS server to get the destination IP address.

l          h (hybrid)-node: A combination of peer-to-peer first and broadcast second. The h-node client unicasts the destination name to the WINS server, if no response is received, then broadcasts it to get the destination IP address.

Follow these steps to configure WINS servers and NetBIOS node type in the DHCP address pool:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter DHCP address pool view

dhcp server ip-pool pool-name [ extended ]

Specify WINS server IP addresses for the client

nbns-list ip-address&<1-8>

Required (optional for b-node)

No address is specified by default.

Specify the NetBIOS node type

netbios-type { b-node | h-node | m-node | p-node }

Required

Not specified by default.

 

 

If b-node is specified for the client, you need to specify no WINS server address.

 

Configuring Gateways for the Client

DHCP clients that want to access hosts outside the local subnet request gateways to forward data. You can specify gateways in each address pool for clients and the DHCP server will assign gateway addresses while assigning an IP address to the client. Up to eight gateways can be specified in a DHCP address pool.

Follow these steps to configure the gateways in the DHCP address pool:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter DHCP address pool view

dhcp server ip-pool pool-name [ extended ]

Specify gateways

gateway-list ip-address&<1-8>

Required

No gateway is specified by default.

 

Configuring the TFTP Server and Bootfile Name for the Client

This task is to specify the IP address and name of a TFTP server and the bootfile name in the DHCP address pool. The DHCP clients use these parameters to contact the TFTP server, requesting the configuration file used for system initialization, which is called auto-configuration. The request process of the client is described below:

1)        When a router starts up without loading any configuration file, the system sets an active interface (such as the interface of the default VLAN or a Layer 3 Ethernet interface) as the DHCP client to request from the DHCP server for parameters, such as an IP address and name of a TFTP server, and the bootfile name.

2)        After getting related parameters, the DHCP client will send a TFTP request to obtain the configuration file from the specified TFTP server for system initialization. If the client cannot get such parameters, it will perform system initialization without loading any configuration file.

To implement auto-configuration, you need to specify the IP address and name of a TFTP server and the bootfile name in the DHCP address pool on the DHCP server, but you do not need to perform any configuration on the DHCP client.

When option 55 in the requesting client message contains parameters of option 66, option 67, or option 150, the DHCP server will return the IP address and name of the specified TFTP server, and bootfile name to the client.

Follow these steps to configure the IP address and name of the TFTP server and the bootfile name in the DHCP address pool:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter DHCP address pool view

dhcp server ip-pool pool-name [ extended ]

Specify the TFTP server

tftp-server ip-address ip-address

Required to use either command

Not specified by default.

Specify the name of the TFTP server

tftp-server domain-name domain-name

Specify the bootfile name

bootfile-name bootfile-name

Required

Not specified by default.

 

Configuring Self-Defined DHCP Options

By configuring self-defined DHCP options, you can

l          Define new DHCP options. New configuration options will come out with DHCP development. To support these new options, you can add them into the attribute list of the DHCP server.

l          Define existing DHCP options. Some options have no unified definitions in RFC 2132; however, vendors can define such options as Option 43 as needed. The self-defined DHCP option enables DHCP clients to obtain vendor-specific information.

l          Extend existing DHCP options. When the current DHCP options cannot meet the customers’ requirements (for example, you cannot use the dns-list command to configure more than eight DNS server addresses), you can configure a self-defined option for extension.

Follow these steps to configure a self-defined DHCP option in the DHCP address pool:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter DHCP address pool view

dhcp server ip-pool pool-name [ extended ]

Configure a self-defined DHCP option

option code { ascii ascii-string | hex hex-string&<1-16> | ip-address ip-address&<1-8> }

Required

No DHCP option is configured by default.

 

Table 2-1 Description of common options

Option

Option name

Corresponding command

Command parameter

3

Router Option

gateway-list

ip-address

6

Domain Name Server Option

dns-list

ip-address

15

Domain Name

domain-name

ascii

44

NetBIOS over TCP/IP Name Server Option

nbns-list

ip-address

46

NetBIOS over TCP/IP Node Type Option

netbios-type

hex

66

TFTP server name

tftp-server

ascii

67

Bootfile name

bootfile-name

ascii

43

Vendor Specific Information

hex

 

Be cautious when configuring self-defined DHCP options because such configuration may affect the DHCP operation process.

 

Enabling DHCP

Enable DHCP before performing other configurations.

Follow these steps to enable DHCP:

To do…

Use the command…

Remarks

Enter system view

system-view

Enable DHCP

dhcp enable

Required

Disabled by default.

 

Enabling the DHCP Server on an Interface

With the DHCP server enabled on an interface, upon receiving a client’s request, the DHCP server will assign an IP address from its address pool to the DHCP client.

Follow these steps to enable the DHCP server on an interface:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter interface view

interface interface-type interface-number

Enable the DHCP server on an interface

dhcp select server global-pool [ subaddress ]

Optional

Enabled by default.

 

If a DHCP relay agent exists between the DHCP server and client, the DHCP server, regardless of whether the subaddress keyword is used, will select an IP address from the address pool containing the primary IP address of the DHCP relay agent’s interface (connected to the client).

When the DHCP server and client are on the same subnet:

l          With the keyword subaddress specified, the DHCP server will assign an IP address from the address pool containing the secondary IP address of the server’s interface (connected to the client); if the interface has multiple secondary IP addresses, the address pool containing the first secondary IP address is selected. If the interface has no secondary IP addresses, the server is unable to assign an IP address to the client.

l          Without the keyword subaddress specified, the DHCP server will assign an IP address from the address pool containing the primary IP address of the server’s interface (connected to the client).

 

Applying an Extended Address Pool on an Interface

After you create an extended address pool and apply it on an interface, the DHCP server, upon receiving a client's request on the interface, will assign the client the IP address statically bound to the client first. If no such IP address is available, the DHCP server assigns an IP address from the specified address pool to the client. If no IP address is available in this address pool, address allocation fails, and the DHCP server will not assign an IP address from other address pools.

Follow these steps to apply an extended address pool on an interface:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter interface view

interface interface-type interface-number

Apply an extended address pool on the interface

dhcp server apply ip-pool pool-name

Optional

By default, the DHCP server has no extended address pool applied on its interface, and assigns an IP address from a common address pool to a requesting client.

 

Only an extended address pool can be applied on the interface. The address pool to be referenced must already exist.

 

Configuring the DHCP Server Security Functions

This configuration is necessary to secure DHCP services on the DHCP server.

Configuration Prerequisites

Before performing this configuration, complete the following configurations on the DHCP server:

l          Enable DHCP

l          Configure the DHCP address pool

Enabling Unauthorized DHCP Server Detection

Unauthorized DHCP servers may exist on networks, and they reply DHCP clients with wrong IP addresses.

With this feature enabled, upon receiving a DHCP request, the DHCP server will record the IP address of the DHCP server which assigned an IP address to the DHCP client and the receiving interface. The administrator can use this information to check out any unauthorized DHCP servers.

Follow these steps to enable unauthorized DHCP server detection:

To do…

Use the command…

Remarks

Enter system view

system-view

Enable unauthorized DHCP server detection

dhcp server detect

Required

Disabled by default.

 

l          With unauthorized DHCP server detection enabled, the relay agent logs DHCP server information, from which the administrator can find unauthorized DHCP servers.

l          With this function enabled, the relay agent logs the information of each DHCP server once.

 

Configuring IP Address Conflict Detection

To avoid IP address conflicts, the DHCP server checks whether the address to be assigned is in use by sending ping packets.

The DHCP server pings the IP address to be assigned using ICMP. If the server gets a response within the specified period, the server will ping another IP address; otherwise, the server will ping the IP addresses once again until the specified number of ping packets are sent. If still no response is received, the server will assign the IP address to the requesting client (The DHCP client probes the IP address by sending gratuitous ARP packets).

Follow these steps to configure IP address conflict detection:

To do…

Use the command…

Remarks

Enter system view

system-view

Specify the number of ping packets

dhcp server ping packets number

Optional

One ping packet by default.

The value 0 indicates that no ping operation is performed.

Configure a timeout waiting for ping responses

dhcp server ping timeout milliseconds

Optional

500 ms by default.

The value 0 indicates that no ping operation is performed.

 

Displaying and Maintaining the DHCP Server

To do…

Use the command…

Remarks

Display information about IP address conflicts

display dhcp server conflict { all | ip ip-address }

Available in any view

Display information about lease expiration

display dhcp server expired { all | ip ip-address | pool [ pool-name ] }

Available in any view

Display information about assignable IP addresses

display dhcp server free-ip

Available in any view

Display IP addresses excluded from dynamic allocation in the DHCP address pool

display dhcp server forbidden-ip

Available in any view

Display information about bindings

display dhcp server ip-in-use { all | ip ip-address | pool [ pool-name ] }

Available in any view

Display information about DHCP server statistics

display dhcp server statistics

Available in any view

Display information about the address pool tree organization

display dhcp server tree { all | pool [ pool-name ] }

Available in any view

Clear information about IP address conflicts

reset dhcp server conflict { all | ip ip-address }

Available in user view

Clear information about dynamic bindings

reset dhcp server ip-in-use { all | ip ip-address | pool [ pool-name ] }

Available in user view

Clear information about DHCP server statistics

reset dhcp server statistics

Available in user view

 

Using the save command does not save DHCP server lease information. Therefore, when the system boots up or the reset dhcp server ip-in-use command is executed, no lease information will be available in the configuration file. In this case, the server will deny the request for lease extension from a client and the client needs to request an IP address again.

 

DHCP Server Configuration Examples

DHCP networking involves two types:

l          The DHCP server and client are on the same subnet and exchange messages directly.

l          The DHCP server and client are not on the same subnet and they communicate with each other via a DHCP relay agent.

The DHCP server configuration for the two types is the same.

Static IP Address Assignment Configuration Example

Network requirements

As shown in Figure 2-1, STA (DHCP client) obtains a static IP address, DNS server address, and gateway address from AP (DHCP server).

Figure 2-1 Network diagram for static IP address assignment

 

Configuration procedure

1)        Configure the IP address of VLAN-interface 2 on Switch A.

<AP> system-view

[AP] interface vlan-interface 2

[AP-Vlan-interface2] ip address 10.1.1.1 25

[AP-Vlan-interface2] quit

2)        Configure the DHCP server

# Enable DHCP.

[AP] dhcp enable

# Create DHCP address pool 0, configure a static IP-MAC binding, DNS server and gateway in it.

[AP] dhcp server ip-pool 0

[AP-dhcp-pool-0] static-bind ip-address 10.1.1.5

[AP-dhcp-pool-0] static-bind mac-address 000f-e200-0002

[AP-dhcp-pool-0] dns-list 10.1.1.2

[AP-dhcp-pool-0] gateway-list 10.1.1.126

[AP-dhcp-pool-0] quit

Dynamic IP Address Assignment Configuration Example

Network requirements

l          As shown in Figure 2-2, the DHCP server (AP) assigns IP address to clients in subnet 10.1.1.0/24. .

l          The IP address of VLAN-interfaces 1 on AP is 10.1.1.1/24.

l          In address pool 10.1.1.0/24, the address lease duration is ten days and twelve hours, domain name suffix aabbcc.com, DNS server address 10.1.1.2/24, gateway 10.1.1.126/24, and WINS server 10.1.1.4/24.

 

In this example, the number of requesting clients connected to VLAN-interface 1 should be less than 122.

 

Figure 2-2 DHCP network diagram

 

Configuration procedure

1)        Create a WLAN service (market), and add the corresponding WLAN-BSS interface (WLAN-BSS1) into VLAN 1. (For more information, see the WLAN Configuration Guide.)

2)        Specify IP addresses for VLAN interfaces (omitted).

3)        Configure the DHCP server

# Enable DHCP.

<AP> system-view

[AP] dhcp enable

# Exclude IP addresses (addresses of the DNS server, WINS server and gateways).

[AP] dhcp server forbidden-ip 10.1.1.2

[AP] dhcp server forbidden-ip 10.1.1.4

[AP] dhcp server forbidden-ip 10.1.1.126

[AP] dhcp server forbidden-ip 10.1.1.254

# Configure DHCP address pool 0 (address range, client domain name suffix, DNS server address, gateway, address lease duration, and WINS server address).

[AP] dhcp server ip-pool 0

[AP-dhcp-pool-0] network 10.1.1.0 mask 255.255.255.0

[AP-dhcp-pool-0] domain-name aabbcc.com

[AP-dhcp-pool-0] dns-list 10.1.1.2

[AP-dhcp-pool-1] gateway-list 10.1.1.126

[AP-dhcp-pool-1] expired day 10 hour 12

[AP-dhcp-pool-1] nbns-list 10.1.1.4

[AP-dhcp-pool-0] quit

Self-Defined Option Configuration Example

Network requirements

l          As shown in Figure 2-3, the DHCP client (Switch) obtains an IP address and PXE server addresses from the DHCP server (AP).

l          The IP address that Switch obtains belongs to network segment 10.1.1.0/24.

l          The PXE server addresses that Switch obtains are 1.2.3.4 and 2.2.2.2.

l          The DHCP server assigns PXE server addresses to DHCP clients through Option 43, a self-defined option. The format of Option 43 and that of the PXE server address sub-option are shown in Figure 1-5 and Figure 1-7, respectively. The value of Option 43 configured on the DHCP server in this example is 80 0B 00 00 02 01 02 03 04 02 02 02 02. The number 80 is the value of the sub-option type. The number 0B is the value of the sub-option length. The numbers 00 00 are the value of the PXE server type. The number 02 indicates the number of servers. The numbers 01 02 03 04 02 02 02 02 indicate that the PXE server addresses are 1.2.3.4 and 2.2.2.2.

Figure 2-3 Network diagram for self-defined option configuration

 

Configuration procedure

Specify IP addresses for the interfaces (omitted).

Configure the DHCP server

# Enable DHCP.

<AP> system-view

[AP] dhcp enable

# Configure DHCP address pool 0.

[AP] dhcp server ip-pool 0

[AP-dhcp-pool-0] network 10.1.1.0 mask 255.255.255.0

[AP-dhcp-pool-0] option 43 hex 80 0B 00 00 02 01 02 03 04 02 02 02 02

Troubleshooting DHCP Server Configuration

Symptom

A client’s IP address obtained from the DHCP server conflicts with another IP address.

Analysis

A host on the subnet may have the same IP address.

Solution

1)        Disconnect the client’s network cable and ping the client’s IP address on another host with a long timeout time to check whether there is a host using the same IP address.

2)        If a ping response is received, the IP address has been manually configured on the host. Execute the dhcp server forbidden-ip command on the DHCP server to exclude the IP address from dynamic allocation.

3)        Connect the client’s network cable. Release the IP address and obtain another one on the client. Take WINDOW XP as an example, run cmd to enter DOS window. Type ipconfig/release to relinquish the IP address and then ipconfig/renew to obtain another IP address.

 


DHCP Client Configuration

This chapter includes these sections:

l          Introduction to DHCP Client

l          Enabling the DHCP Client on an Interface

l          Displaying and Maintaining the DHCP Client

l          DHCP Client Configuration Example

 

l          The DHCP client configuration is supported only on Layer 3 Ethernet interfaces (or subinterfaces), and VLAN interfaces.

l          When multiple VLAN interfaces with the same MAC address use DHCP for IP address acquisition via a relay agent, the DHCP server cannot be a Windows 2000 Server or Windows 2003 Server.

 

Introduction to DHCP Client

With the DHCP client enabled on an interface, the interface will use DHCP to obtain configuration parameters such as an IP address from the DHCP server.

Enabling the DHCP Client on an Interface

Follow these steps to enable the DHCP client on an interface:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter interface view

interface interface-type interface-number

Enable the DHCP client on the interface

ip address dhcp-alloc [ client-identifier mac interface-type interface-number ]

Required

Disabled by default.

 

l          An interface can be configured to acquire an IP address in multiple ways, but these ways are mutually exclusive. The latest configuration will overwrite the previous one.

l          Secondary IP addresses cannot be configured on an interface that is enabled with the DHCP client.

l          If the IP address that interface A obtains from the DHCP server is on the same network segment as the IP address of interface B, interface A will not request any IP address from the DHCP server, unless the IP address of interface B is manually deleted and interface A is brought UP again by first executing the shutdown command and then the undo shutdown command or the DHCP client is re-enabled on interface A by executing the undo ip address dhcp-alloc command and then the ip address dhcp-alloc command.

 

Displaying and Maintaining the DHCP Client

To do…

Use the command…

Remarks

Display specified configuration information

display dhcp client [ verbose ] [ interface interface-type interface-number ]

Available in any view

 

DHCP Client Configuration Example

Network requirements

As shown in Figure 3-1, the AP contacts the DHCP server via VLAN-interface 1 to obtain an IP address on a LAN.

Figure 3-1 DHCP network diagram

 

Configuration procedure

The following is the configuration on AP.

# Enable the DHCP client on VLAN-interface 1.

<AP> system-view

[AP] interface vlan-interface 1

[AP-Vlan-interface1] ip address dhcp-alloc

 

To implement the DHCP client-server model, you need to perform related configuration on the DHCP server. For more information, see DHCP Server Configuration Examples.

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网