- Table of Contents
-
- 06-Layer 3—IP Services Configuration Guide
- 00-Preface
- 01-ARP configuration
- 02-IP addressing configuration
- 03-DHCP configuration
- 04-IP forwarding basics configuration
- 05-IP performance optimization configuration
- 06-IPv6 basics configuration
- 07-IPv6 neighbor discovery configuration
- 08-DHCPv6 configuration
- 09-IPv6 transition technologies configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
03-DHCP configuration | 419.40 KB |
Vendor-specific option (Option 43)
Relay agent option (Option 82)
Configuring the DHCP relay agent
DHCP relay agent support for Option 82
DHCP relay agent support for MCE
DHCP relay agent tasks at a glance
Enabling the DHCP relay agent on an interface
Specifying DHCP servers on a relay agent
Configuring a DHCP address pool on a DHCP relay agent
Specifying the DHCP server selecting algorithm
Configuring the DHCP relay agent security features
Enabling the DHCP relay agent to record relay entries
Enabling periodic refresh of dynamic relay entries
Enabling DHCP starvation attack protection
Enabling client offline detection on the DHCP relay agent
Configuring the DHCP relay agent to release an IP address
Configuring DHCP relay agent support for Option 82
Enabling Option 60 insertion into DHCP requests
Setting the DSCP value for DHCP packets sent by the DHCP relay agent
Specifying the DHCP relay agent address for the giaddr field
Manually specifying the DHCP relay agent address for the giaddr field
Configuring smart relay to specify the DHCP relay agent address for the giaddr field
Specifying the source IP address for relayed DHCP requests
Discarding DHCP requests received from SRv6 tunnels
Configuring support for forwarding DHCP replies based on MAC address table
Configuring the DHCP relay agent to always unicast relayed DHCP responses
Configuring forwarding DHCP replies based on Option 82
Verifying and maintaining DHCP relay agent
Verifying DHCP relay agent configuration
Displaying and clearing DHCP relay entries
Displaying MAC address check entries on the DHCP relay agent
Displaying M-LAG status information on the DHCP relay agent
Displaying and clearing packet statistics on the DHCP relay agent
DHCP relay agent configuration examples
Example: Configuring basic DHCP relay agent
Example: Configuring Option 82
Example: Configuring DHCP server selection
Troubleshooting DHCP relay agent configuration
Failure of DHCP clients to obtain configuration parameters through the DHCP relay agent
Restrictions and guidelines: DHCP client configuration
Enabling the DHCP client on an interface
Configuring a DHCP client ID for an interface
Enabling duplicated address detection
Setting the DSCP value for DHCP packets sent by the DHCP client
Verifying and maintaining DHCP client
Obtaining an IP address dynamically
Configuring an interface to use BOOTP for IP address acquisition
Verifying and maintaining BOOTP client
BOOTP client configuration examples
Example: Configuring BOOTP client
DHCP overview
DHCP network model
The Dynamic Host Configuration Protocol (DHCP) provides a framework to assign configuration information to network devices.
Figure 1 shows a typical DHCP application scenario where the DHCP clients and the DHCP server reside on the same subnet. The DHCP clients can also obtain configuration parameters from a DHCP server on another subnet through a DHCP relay agent. For more information about the DHCP relay agent, see "Configuring the DHCP relay agent."
Figure 1 A typical DHCP application
DHCP address allocation
Allocation mechanisms
DHCP supports the following allocation mechanisms:
· Static allocation—The network administrator assigns an IP address to a client, such as a WWW server, and DHCP conveys the assigned address to the client.
· Automatic allocation—DHCP assigns a permanent IP address to a client.
· Dynamic allocation—DHCP assigns an IP address to a client for a limited period of time, which is called a lease. Most DHCP clients obtain their addresses in this way.
IP address allocation process
Figure 2 IP address allocation process
As shown in Figure 2, a DHCP server assigns an IP address to a DHCP client in the following process:
1. The client broadcasts a DHCP-DISCOVER message to locate a DHCP server.
2. Each 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. For more information, see "DHCP message format."
3. If the client receives multiple offers, it accepts the first received offer, and broadcasts it in a DHCP-REQUEST message to formally request the IP address. (IP addresses offered by other DHCP servers can be assigned to other clients.)
4. All DHCP servers receive the DHCP-REQUEST message. However, only the server selected by the client does one of the following operations:
¡ Returns a DHCP-ACK message to confirm that the IP address has been allocated to the client.
¡ Returns a DHCP-NAK message to deny the IP address allocation.
After receiving the DHCP-ACK message, the client verifies the following details before using the assigned IP address:
· The assigned IP address is not in use. To verify this, the client broadcasts a gratuitous ARP packet. The assigned IP address is not in use if no response is received within the specified time.
· The assigned IP address is not on the same subnet as any IP address in use on the client.
Otherwise, the client sends a DHCP-DECLINE message to the server to request an IP address again.
IP address lease extension
A dynamically assigned IP address has a lease. When the lease expires, the IP address is reclaimed by the DHCP server. To continue using the IP address, the client must extend the lease duration.
When about half of the lease duration elapses, the DHCP client unicasts a DHCP-REQUEST to the DHCP server to extend the lease. Depending on the availability of the IP address, the DHCP server returns one of the following messages:
· A DHCP-ACK unicast confirming that the client's lease duration has been extended.
· A DHCP-NAK unicast denying the request.
If the client receives no reply, it broadcasts another DHCP-REQUEST message for lease extension when about seven-eighths of the lease duration elapses. Again, depending on the availability of the IP address, the DHCP server returns either a DHCP-ACK unicast or a DHCP-NAK unicast.
DHCP message format
Figure 3 shows the DHCP message format. DHCP uses some of the fields in significantly different ways. The numbers in parentheses indicate the size of each field in bytes.
· op—Message type defined in options field. 1 = REQUEST, 2 = REPLY
· htype, hlen—Hardware address type and length of the DHCP client.
· hops—Number of relay agents a request message traveled.
· xid—Transaction ID, a random number chosen by the client to identify an IP address allocation.
· secs—Filled in by the client, the number of seconds elapsed since the client began address acquisition or renewal process. This field is reserved and set to 0.
· 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.
· ciaddr—Client IP address if the client has an IP address that is valid and usable. Otherwise, set to zero. (The client does not use this field to request an IP address to lease.)
· yiaddr—Your IP address. It is an IP address assigned by the DHCP server to the DHCP client.
· siaddr—Server IP address, from which the client obtained configuration parameters.
· giaddr—Gateway IP address. It is the IP address of the first relay agent to which a request message travels.
· chaddr—Client hardware address.
· sname—Server host name, from which the client obtained configuration parameters.
· file—Boot file (also called system software image) name and path information, defined by the server to the client.
· options—Optional parameters field that is variable in length. Optional parameters include the message type, lease duration, subnet mask, domain name server IP address, and WINS IP address.
DHCP options
DHCP extends the message format as an extension to BOOTP for compatibility. DHCP uses the options field to carry information for dynamic address allocation and provide additional configuration information for clients.
Figure 4 DHCP option format
Common DHCP options
The following are common DHCP options:
· Option 3—Router option. It specifies the gateway address to be assigned to the clients. If both Option 3 and Option 121 exist, Option 3 is ignored.
· Option 6—DNS server option. It specifies the DNS server IP address to be assigned to the clients.
· 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 into its routing table. If both Option 33 and Option 121 exist, Option 33 is ignored.
· Option 51—IP address lease option.
· Option 53—DHCP message type option. It identifies the type of the DHCP message.
· Option 55—Parameter request list option. It is used by a DHCP client to request specified configuration parameters. The option includes values that correspond to the parameters requested by the client.
· Option 60—Vendor class identifier option. A DHCP client uses this option to identify its vendor. A DHCP server uses this option to distinguish DHCP clients, and assigns IP addresses to them.
· Option 66—TFTP server name option. It specifies the TFTP server domain name to be assigned to the clients.
· Option 67—Boot file name option. It specifies the boot file name to be assigned to the client.
· Option 121—Classless route option. It specifies a list of classless static routes (the destination addresses in these static routes are classless) that a client should add into its routing table. If Option 3, Option 33, and Option 121 exist, Option 3 and Option 33 are ignored.
· Option 150—TFTP server IP address option. It specifies the TFTP server IP address to be assigned to the clients.
For more information about DHCP options, see RFC 2132 and RFC 3442.
Custom DHCP options
Some options, such as Option 43, Option 82, and Option 184, have no standard definitions in RFC 2132.
Vendor-specific option (Option 43)
Option 43 function
DHCP servers and clients use Option 43 to exchange vendor-specific configuration information.
The DHCP client can obtain the following information through Option 43:
· ACS parameters, including the ACS URL, username, and password.
· Service provider identifier, which is acquired by the CPE from the DHCP server and sent to the ACS for selecting vender-specific configurations and parameters.
· PXE server address, which is used to obtain the boot file or other control information from the PXE server.
· AC address, which is used by an AP to obtain the boot file or other control information from the AC.
Option 43 format
Figure 5 Option 43 format
Network configuration parameters are carried in different sub-options of Option 43 as shown in Figure 5.
· Sub-option type—The field value can be 0x01 (ACS parameter sub-option), 0x02 (service provider identifier sub-option), or 0x80 (PXE server address sub-option).
· Sub-option length—Excludes the sub-option type and sub-option length fields.
· Sub-option value—The value format varies by sub-option.
Sub-option value field format
· ACS parameter sub-option value field—Includes the ACS URL, username, and password separated by spaces (hexadecimal number 20) as shown in Figure 6.
Figure 6 ACS parameter sub-option value field
· Service provider identifier sub-option value field—Includes the service provider identifier.
· PXE server address sub-option value field—Includes the PXE server type that can only be 0, the server number that indicates the number of PXE servers contained in the sub-option, and server IP addresses, as shown in Figure 7.
Figure 7 PXE server address sub-option value field
Relay agent option (Option 82)
Option 82 is the relay agent option. It records the location information about the DHCP client. When a DHCP relay agent or DHCP snooping device receives a client's request, it adds Option 82 to the request and sends it to the server.
The administrator can use Option 82 to locate the DHCP client and further implement security control and accounting. The DHCP server can use Option 82 to provide individual configuration policies for the clients.
Option 82 can include a maximum of 255 sub-options and must include a minimum of one sub-option. Option 82 supports two sub-options: sub-option 1 (Circuit ID) and sub-option 2 (Remote ID), and sub-option 5 (Link Selection). Option 82 has no standard definition. Its padding formats vary by vendor.
· Circuit ID has the following padding modes:
¡ String padding mode—Includes a character string specified by the user.
¡ Normal padding mode—Includes the VLAN ID and interface number of the interface that receives the client's request.
¡ Verbose padding mode—Includes the access node identifier specified by the user, and the VLAN ID, interface number and interface type of the interface that receives the client's request.
· Remote ID has the following padding modes:
¡ String padding mode—Includes a character string specified by the user.
¡ Normal padding mode—Includes the MAC address of the DHCP relay agent interface or the MAC address of the DHCP snooping device that receives the client's request.
¡ Sysname padding mode—Includes the name of the device. To set the device name, use the sysname command in system view.
· The Link Selection sub-option carries one of the following IP addresses:
¡ Gateway address in the authorization address pool or the address pool bound to the relay interface.
¡ IP address of the relay interface.
To have the DHCP relay agent forward requests with Option 82 and sub-option 5, perform the following tasks first:
¡ Enable the DHCP relay agent to support Option 82 by using the dhcp relay information enable command.
¡ Specify a source IP address for relayed DHCP requests by using the dhcp relay source-address command.
Option 184
Option 184 is a reserved option. You can define the parameters in the option as needed. The device supports Option 184 carrying voice related parameters, so a DHCP client with voice functions can get voice parameters from the DHCP server.
Option 184 has the following sub-options:
· Sub-option 1—Specifies the IP address of the primary network calling processor. The primary processor acts as the network calling control source and provides program download services. For Option 184, you must define sub-option 1 to make other sub-options take effect.
· Sub-option 2—Specifies the IP address of the backup network calling processor. DHCP clients contact the backup processor when the primary one is unreachable.
· Sub-option 3—Specifies the voice VLAN ID and the result whether the DHCP client takes this VLAN as the voice VLAN.
· Sub-option 4—Specifies the failover route that includes the IP address and the number of the target user. A SIP VoIP user uses this IP address and number to directly establish a connection to the target SIP user when both the primary and backup calling processors are unreachable.
Protocols and standards
· RFC 2131, Dynamic Host Configuration Protocol
· RFC 2132, DHCP Options and BOOTP Vendor Extensions
· RFC 1542, Clarifications and Extensions for the Bootstrap Protocol
· RFC 3046, DHCP Relay Agent Information Option
· RFC 3442, The Classless Static Route Option for Dynamic Host Configuration Protocol (DHCP) version 4
Configuring the DHCP relay agent
About DHCP relay agent
The DHCP relay agent enables clients to get IP addresses and configuration parameters from a DHCP server on another subnet.
Figure 8 shows a typical application of the DHCP relay agent.
Figure 8 DHCP relay agent application
DHCP relay agent operation
The DHCP server and client interact with each other in the same way regardless of whether the relay agent exists. For the interaction details, see "IP address allocation process." The following only describes steps related to the DHCP relay agent:
1. After receiving a DHCP-DISCOVER or DHCP-REQUEST broadcast message from a DHCP client, the DHCP relay agent processes the message as follows:
a. Fills the giaddr field of the message with its IP address.
b. Unicasts the message to the designated DHCP server.
2. Based on the giaddr field, the DHCP server returns an IP address and other configuration parameters in a response.
3. The relay agent conveys the response to the client.
Figure 9 DHCP relay agent operation
DHCP relay agent support for Option 82
Option 82 records the location information about the DHCP client. It enables the administrator to perform the following tasks:
· Locate the DHCP client for security and accounting purposes.
· Assign IP addresses in a specific range to clients.
For more information about Option 82, see "Relay agent option (Option 82)."
If the DHCP relay agent supports Option 82, it handles DHCP requests by following the strategies described in Table 1.
If a response returned by the DHCP server contains Option 82, the DHCP relay agent removes the Option 82 before forwarding the response to the client.
Table 1 Handling strategies of the DHCP relay agent
If a DHCP request has… |
Handling strategy |
The DHCP relay agent… |
Option 82 |
Drop |
Drops the message. |
Keep |
Forwards the message without changing Option 82. |
|
Replace |
Forwards the message after replacing the original Option 82 with the Option 82 padded according to the configured padding format, padding content, and code type. |
|
No Option 82 |
N/A |
Forwards the message after adding Option 82 padded according to the configured padding format, padding content, and code type. |
DHCP relay agent support for MCE
An MCE device acting as the DHCP relay agent can forward DHCP packets between a DHCP server and clients on either a public network or a private network. For more information about MCE, see MCE configuration in MCE Configuration Guide.
DHCP relay agent tasks at a glance
To configure a DHCP relay agent, perform the following tasks:
2. Enabling the DHCP relay agent on an interface
4. (Optional.) Configuring the DHCP relay agent security features
5. (Optional.) Configuring the DHCP relay agent to release an IP address
6. (Optional.) Configuring DHCP relay agent support for Option 82
7. (Optional.) Enabling Option 60 insertion into DHCP requests
8. (Optional.) Setting the DSCP value for DHCP packets sent by the DHCP relay agent
9. (Optional.) Specifying the DHCP relay agent address for the giaddr field
10. (Optional.) Specifying the source IP address for relayed DHCP requests
11. (Optional.) Configuring the DHCP relay agent to always unicast relayed DHCP responses
12. (Optional.) Configuring forwarding DHCP replies based on Option 82
Enabling DHCP
Restrictions and guidelines
You must enable DHCP to make other DHCP relay agent settings take effect.
Procedure
1. Enter system view.
system-view
2. Enable DHCP.
dhcp enable
By default, DHCP is disabled.
Enabling the DHCP relay agent on an interface
About this task
With the DHCP relay agent enabled, an interface forwards incoming DHCP requests to a DHCP server.
An IP address pool that contains the IP address of the DHCP relay interface must be configured on the DHCP server. Otherwise, the DHCP clients connected to the relay agent cannot obtain correct IP addresses.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable the DHCP relay agent.
dhcp select relay
By default, an interface does not operate in the DHCP relay agent mode.
Specifying DHCP servers
Specifying DHCP servers on a relay agent
About this task
To improve availability, you can specify several DHCP servers on the DHCP relay agent. When the interface receives request messages from clients, the relay agent forwards them to all DHCP servers.
Restrictions and guidelines
The IP address of any specified DHCP server must not reside on the same subnet as the IP address of the relay interface. Otherwise, the clients might fail to obtain IP addresses.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Specify a DHCP server address on the relay agent.
dhcp relay server-address ip-address [ public | vpn-instance vpn-instance-name ]
By default, no DHCP server address is specified on the relay agent.
To specify multiple DHCP server addresses, repeat this step. You can specify a maximum of eight DHCP servers.
Configuring a DHCP address pool on a DHCP relay agent
About this task
This feature allows DHCP clients of the same type to obtain IP addresses and other configuration parameters from the DHCP servers specified in the matching DHCP address pool.
It applies to scenarios where the DHCP relay agent connects to clients of the same access type but classified into different types by their locations. In this case, the relay interface typically has no IP address configured. You can use the gateway-list command to specify gateway addresses for clients matching the same DHCP address pool and bind the gateway addresses to the device's MAC address.
Upon receiving a DHCP DISCOVER or REQUEST from a client that matches a DHCP address pool, the relay agent processes the packet as follows:
· Fills the giaddr field of the packet with a specified gateway address.
· Forwards the packet to all DHCP servers in the matching DHCP address pool.
The DHCP servers select a DHCP address pool according to the gateway address.
Procedure
1. Enter system view.
system-view
2. Create a DHCP address pool and enter its view.
dhcp server ip-pool pool-name
3. DHCP address pool.
gateway-list ip-address&<1-64> [ export-route ]
By default, no gateway address is specified.
4. Specify DHCP servers for the DHCP address pool.
remote-server ip-address&<1-8> [ public | vpn-instance vpn-instance-name ]
By default, no DHCP server is specified for the DHCP address pool.
You can specify a maximum of eight DHCP servers for one DHCP address pool for high availability.
Specifying the DHCP server selecting algorithm
About this task
The DHCP relay agent supports the polling and master-backup DHCP server selecting algorithms.
By default, the DHCP relay agent uses the polling algorithm. It forwards DHCP requests to all DHCP servers. The DHCP clients select the DHCP server from which the first received DHCP reply comes.
If the DHCP relay agent uses the master-backup algorithm, it forwards DHCP requests to the master DHCP server first. If the master DHCP server is not available, the relay agent forwards the subsequent DHCP requests to a backup DHCP server. If the backup DHCP server is not available, the relay agent selects the next backup DHCP server, and so on. If no backup DHCP server is available, it repeats the process starting from the master DHCP server.
The master DHCP server is determined in one of the following ways:
· In a common network where multiple DHCP server addresses are specified on the DHCP relay interface, the first specified DHCP server is the master. The other DHCP servers are backup.
· In a network where DHCP address pools are configured on the DHCP relay agent, the first specified DHCP server in a DHCP address pool is the master. The other DHCP servers in the DHCP address pool are backup.
DHCP server selection supports the following functions:
· DHCP server response timeout time—The DHCP relay agent determines that a DHCP server is not available if it does not receive any response from the server within the DHCP server response timeout time. The DHCP server response timeout time is configurable and the default is 30 seconds.
· DHCP server switchback—If the DHCP relay agent selects a backup DHCP server, it does not switch back to the master DHCP server by default. You can configure the DHCP relay agent to switch back to the master DHCP server after a delay. If the master DHCP server is available, the DHCP relay agent forwards DHCP requests to the master DHCP server. If the master DHCP server is not available, the DHCP relay agent still uses the backup DHCP server.
Specifying the DHCP server selecting algorithm in interface view
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Specify the DHCP server selecting algorithm.
dhcp relay server-address algorithm { master-backup | polling }
By default, the polling algorithm is used. The DHCP relay agent forwards DHCP requests to all DHCP servers.
4. (Optional.) Set the DHCP server response timeout time for DHCP server switchover.
dhcp relay dhcp-server timeout time
By default, the DHCP server response timeout time is 30 seconds.
5. (Optional.) Enable the switchback to the master DHCP server and set the delay time.
dhcp relay master-server switch-delay delay-time
By default, the DHCP relay agent does not switch back to the master DHCP server.
Specifying the DHCP server selecting algorithm in DHCP address pool view
1. Enter system view.
system-view
2. Enter DHCP address pool view.
dhcp server ip-pool pool-name
3. Specify the DHCP server selecting algorithm.
dhcp relay server-address algorithm { master-backup | polling }
By default, the polling algorithm is used. The DHCP relay agent forwards DHCP requests to all DHCP servers.
4. (Optional.) Set the DHCP server response timeout time for DHCP server switchover.
dhcp-server timeout time
By default, the DHCP server response timeout time is 30 seconds.
5. (Optional.) Enable the switchback to the master DHCP server and set the delay time.
master-server switch-delay delay-time
By default, the DHCP relay agent does not switch back to the master DHCP server.
Configuring the DHCP relay agent security features
Enabling the DHCP relay agent to record relay entries
About this task
Perform this task to enable the DHCP relay agent to automatically record clients' IP-to-MAC bindings (relay entries) after they obtain IP addresses through DHCP.
Some security features use the relay entries to check incoming packets and block packets that do not match any entry. In this way, illegal hosts are not able to access external networks through the relay agent.
Rustications and guidelines
The DHCP relay agent does not record IP-to-MAC bindings for DHCP clients running on synchronous/asynchronous serial interfaces.
Procedure
1. Enter system view.
system-view
2. Enable the relay agent to record relay entries.
dhcp relay client-information record
By default, the relay agent does not record relay entries.
Enabling periodic refresh of dynamic relay entries
About this task
A DHCP client unicasts a DHCP-RELEASE message to the DHCP server to release its IP address. The DHCP relay agent conveys the message to the DHCP server and does not remove the IP-to-MAC entry of the client.
With this feature, the DHCP relay agent uses the following information to periodically send a DHCP-REQUEST message to the DHCP server:
· The IP address of a relay entry.
· The MAC address of the DHCP relay interface.
The relay agent maintains the relay entries depending on what it receives from the DHCP server:
· If the server returns a DHCP-ACK message or does not return any message within an interval, the DHCP relay agent removes the relay entry. In addition, upon receiving the DHCP-ACK message, the relay agent sends a DHCP-RELEASE message to release the IP address.
· If the server returns a DHCP-NAK message, the relay agent keeps the relay entry.
Procedure
1. Enter system view.
system-view
2. Enable periodic refresh of dynamic relay entries.
dhcp relay client-information refresh enable
By default, periodic refresh of dynamic relay entries is enabled.
3. (Optional.) Set the refresh interval.
dhcp relay client-information refresh { auto | interval interval }
By default, the refresh interval is auto, which is calculated based on the number of total relay entries.
Enabling DHCP starvation attack protection
About this task
A DHCP starvation attack occurs when an attacker constantly sends forged DHCP requests using different MAC addresses in the chaddr field to a DHCP server. This exhausts the IP address resources of the DHCP server so legitimate DHCP clients cannot obtain IP addresses. The DHCP server might also fail to work because of exhaustion of system resources. The following methods are available to relieve or prevent such attacks.
· To relieve a DHCP starvation attack that uses DHCP packets encapsulated with different source MAC addresses, you can use one of the following methods:
¡ Limit the number of ARP entries that a Layer 3 interface can learn.
¡ Set the MAC learning limit for a Layer 2 port, and disable unknown frame forwarding when the MAC learning limit is reached.
· To prevent a DHCP starvation attack that uses DHCP requests encapsulated with the same source MAC address, you can enable MAC address check on the DHCP relay agent. The DHCP relay agent compares the chaddr field of a received DHCP request with the source MAC address in the frame header. If they are the same, the DHCP relay agent forwards the request to the DHCP server. If not, the relay agent discards the request.
Enable MAC address check only on the DHCP relay agent directly connected to the DHCP clients. A DHCP relay agent changes the source MAC address of DHCP packets before sending them.
A MAC address check entry has an aging time. When the aging time expires, both of the following occur:
· The entry ages out.
· The DHCP relay agent rechecks the validity of DHCP requests sent from the MAC address in the entry.
Procedure
1. Enter system view.
system-view
2. Set the aging time for MAC address check entries.
dhcp relay check mac-address aging-time time
The default aging time is 30 seconds.
This command takes effect only after you execute the dhcp relay check mac-address command.
3. Enter the interface view.
interface interface-type interface-number
4. Enable MAC address check.
dhcp relay check mac-address
By default, MAC address check is disabled.
Enabling client offline detection on the DHCP relay agent
About this task
The client offline detection on the DHCP relay agent detects the user online status based on the ARP entry aging. When an ARP entry ages out, the DHCP client offline detection feature deletes the relay entry for the IP address and sends a RELEASE message to the DHCP server.
Restrictions and guidelines
The feature does not function if an ARP entry is manually deleted.
Procedure
1. Enter system view.
system-view
2. Enable the relay agent to record relay entries.
dhcp relay client-information record
By default, the relay agent does not record relay entries.
Without relay entries, client offline detection cannot function correctly.
3. Enter interface view.
interface interface-type interface-number
4. Enable the DHCP relay agent.
dhcp select relay
By default, an interface does not operate in the DHCP relay agent mode.
5. Enable client offline detection.
dhcp client-detect
By default, client offline detection is disabled on the DHCP relay agent.
Configuring the DHCP relay agent to release an IP address
About this task
Configure the relay agent to release the IP address for a relay entry. The relay agent sends a DHCP-RELEASE message to the server and meanwhile deletes the relay entry. Upon receiving the DHCP-RELEASE message, the DHCP server releases the IP address.
This command can release only the IP addresses in the recorded relay entries.
Procedure
1. Enter system view.
system-view
2. Configure the DHCP relay agent to release an IP address.
dhcp relay release ip ip-address [ vpn-instance vpn-instance-name ]
Configuring DHCP relay agent support for Option 82
To support Option 82, you must perform related configuration on both the DHCP server and relay agent.
When you use the dhcp relay information link-selection command, follow these guidelines:
· For this command to take effect, perform the following tasks first:
¡ Enable the DHCP relay agent to support Option 82 by using the dhcp relay information enable command.
¡ Specify a source IP address for relayed DHCP requests by using the dhcp relay source-address command.
· To ensure successful IP address allocation, the IP address specified in sub-option 5 must belong to the same network segment as one of the following:
¡ Gateway address in the authorization address pool or the address pool bound to the relay interface.
¡ IP address of the DHCP relay interface.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable the relay agent to handle Option 82.
dhcp relay information enable
By default, handling of Option 82 is disabled.
4. (Optional.) Configure the strategy for handling DHCP requests that contain Option 82.
dhcp relay information strategy { drop | keep | replace }
By default, the handling strategy is replace.
If the handling strategy is replace, configure a padding mode and a padding format for Option 82. If the handling strategy is keep or drop, you do not need to configure a padding mode or padding format for Option 82.
5. (Optional.) Configure the padding mode and padding format for the Circuit ID sub-option.
dhcp relay information circuit-id { bas [ with-vxlan ] | srv6-opcode | string circuit-id | { normal | verbose [ node-identifier { mac | sysname | user-defined node-identifier } ] [ interface ] } [ format { ascii | hex } ] }
By default, the padding mode for Circuit ID sub-option is normal, and the padding format is hex.
The device name (sysname) must not include spaces if it is configured as the padding content for sub-option 1. Otherwise, the DHCP relay agent will fail to add or replace Option 82.
6. (Optional.) Configure the padding mode and padding format for the Remote ID sub-option.
dhcp relay information remote-id { normal [ format { ascii | hex } ] | string remote-id | sysname }
By default, the padding mode for the Remote ID sub-option is normal, and the padding format is hex.
7. (Optional.) Configure the IP address to be filled in sub-option 5 of Option 82.
dhcp relay information link-selection link-selection-address
By default, the relay agent fills either of the following addresses in sub-option 5 of Option 82:
¡ Gateway address in the authorization address pool or the address pool bound to the relay interface.
¡ IP address of the relay interface.
Enabling Option 60 insertion into DHCP requests
About this task
Option 60 records vendor class identifier information of DHCP clients. It allows the clients to obtain IP addresses from different address ranges. After receiving a DHCP request with Option 60 encapsulated, the DHCP server follows the procedure to assign an IP address:
1. Uses Option 60 to determine a user class for the client.
2. Selects an IP address from the address range that matches the user class and assigns the address to the client.
After you enable Option 60 insertion on the DHCP relay agent, the relay agent first examines whether the received DHCP request contains Option 60.
· If the request does not contain Option 60, the relay agent inserts the specified option string into the request before forwarding the request to the DHCP server.
· If the request contains Option 60, the relay agent forwards the request to the DHCP server without processing this option.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable Option 60 insertion into DHCP requests on the DHCP relay agent.
dhcp relay insert option60 option-text
By default, the DHCP relay agent does not insert Option 60 into DHCP requests.
Setting the DSCP value for DHCP packets sent by the DHCP relay agent
About this task
The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet.
Procedure
1. Enter system view.
system-view
2. Set the DSCP value for DHCP packets sent by the DHCP relay agent.
dhcp dscp dscp-value
By default, the DSCP value in DHCP packets sent by the DHCP relay agent is 56.
Specifying the DHCP relay agent address for the giaddr field
Manually specifying the DHCP relay agent address for the giaddr field
About this task
This task allows you to specify the IP addresses to be encapsulated to the giaddr field of the DHCP requests. If you do not specify any DHCP relay agent address, the primary IP address of the DHCP relay interface is encapsulated to the giaddr field of DHCP requests.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Specify the DHCP relay agent address to be encapsulated in relayed DHCP requests.
dhcp relay gateway ip-address
By default, the primary IP address of the DHCP relay interface is encapsulated in the relayed DHCP requests.
Configuring smart relay to specify the DHCP relay agent address for the giaddr field
About this task
By default, the relay agent only encapsulates the primary IP address to the giaddr field of all requests before relaying them to the DHCP server. The DHCP server then selects an IP address on the same subnet as the address in the giaddr filed. If no assignable addresses on the subnet are available, the DHCP server does not assign any IP address. The DHCP smart relay feature is introduced to allow the DHCP relay agent to encapsulate secondary IP addresses when the DHCP server does not send back a DHCP-OFFER message.
The relay agent initially encapsulates its primary IP address to the giaddr field before forwarding a request to the DHCP server. If no DHCP-OFFER is received, the relay agent allows the client to send a maximum of two requests to the DHCP server by using the primary IP address. If no DHCP-OFFER is returned after two retries, the relay agent switches to a secondary IP address. If the DHCP server still does not respond, the next secondary IP address is used. After the secondary IP addresses are all tried and the DHCP server does not respond, the relay agent repeats the process by starting from the primary IP address.
Procedure
1. Enter system view.
system-view
2. Enable the DHCP smart relay feature.
dhcp smart-relay enable
By default, the DHCP smart relay feature is disabled.
Specifying the source IP address for relayed DHCP requests
About this task
This task is required if multiple relay interfaces share the same IP address or if a relay interface does not have routes to DHCP servers. You can perform this task to specify an IP address or the IP address of another interface on the DHCP relay agent as the source IP address for relayed DHCP requests.
If you specify the ip-address argument, the relay agent changes not only the source IP address but also the giaddr field of a DHCP request. The DHCP server assigns the client an IP address on the same subnet as the specified IP address in the giaddr field. As a result, the client might not be on the same subnet as the DHCP relay interface (the gateway). To avoid this problem, you must configure Option 82 on the relay interface before specifying the ip-address argument. This configuration enables the DHCP relay agent to insert the primary IP address of the relay interface in Option 82. Based on this option, the DHCP server assigns an IP address on the same subnet as the IP address of the relay interface. The DHCP relay agent looks up the MAC address table for the output interface to forward the DHCP reply packets.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Specify the source IP address for DHCP requests.
dhcp relay source-address { ip-address [ default-giaddr ] [ option code [ option-text ] ] | gateway | interface interface-type interface-number [ default-giaddr ] | relay-interface }
The relay agent chooses the default source IP address for relayed requests depending on whether its server-side interface and the DHCP server belong to the same VPN instance:
¡ If they belong to the same VPN instance, the relay agent uses the IP address of the output interface for relayed requests as the source IP address.
¡ If they belong to different VPN instances, the relay agent uses the lowest IP address that is in the same VPN instance as the DHCP server as the source address.
Keyword |
Description |
ip-address [ option code [ option-text ] ] |
If a DHCP request carries the specified option, the relay agent changes the source IP address and the giaddr field of the DHCP request to the specified IP address. |
gateway |
The relay agent uses the IP address in the giaddr field as the source IP address. If the giaddr field is empty, the relay agent follows the default rule to specify the source IP address for DHCP requests. |
interface |
The relay agent uses the IP address of an interface as the source IP address. If the specified interface has no IP addresses, the relay agent follows the default rule to specify the source IP address for DHCP requests. |
relay-interface |
The relay agent uses the primary IP address of the relay interface as the source IP address. If this interface does not have an IP address, the relay agent follows the default rule to specify the source IP address for DHCP requests. |
default-giaddr |
The relay agent uses the original address in the giaddr field. If you do not specify this keyword, the relay agent inserts the specified interface IP address or the specified IP address into the giaddr field in DHCP requests. |
Discarding DHCP requests received from SRv6 tunnels
About this task
On an SRv6 network, the DHCP relay agent feature can be configured on the VSI interface of a PE.
When the DHCP relay agent receives a DHCP request from an access unit mapped to the VSI interface, the relay agent forwards this request to the DHCP servers and broadcasts this request to other PEs. If those PEs also function as DHCP relay agents, each will forward the DHCP request to the DHCP servers they are connecting to. To prevent a DHCP server from receiving the same DHCP request from different PEs, you can configure this command on the VSI interface of each PE that is not directly connecting to DHCP clients.
Procedure
1. Enter system view.
system-view
2. Enter VSI interface view.
interface vsi-interface vsi-number
3. Configure the DHCP relay agent to discard the DHCP requests received from SRv6 tunnels.
dhcp relay request-from-tunnel discard
By default, the DHCP relay agent forwards the DHCP requests received from SRv6 tunnels.
If you configure this command on a device that acts as both the distributed and centralized SRv6 IP gateways, make sure the gateways do not use the same VSI interface to provide gateway services.
Configuring support for forwarding DHCP replies based on MAC address table
About this task
On a distributed EVPN gateway network, VSI interfaces of all distributed EVPN gateways have the same IP address, and the DHCP relay agent is enabled on EVPN gateways. When a DHCP client sends a request to its connected distributed gateway, the gateway records request forwarding information for the client before relaying the request to the DHCP server. The request forwarding information contains the MAC address of the DHCP client and output interface of the request packet. If the reply for this request is received by another distributed gateway, the reply is discarded by default because it does not have matching request forwarding information on the gateway. As a result, the client cannot obtain the IP address.
To resolve this issue, configure the support for forwarding replies based on MAC address table on the relay agent that is connected to the DHCP server. The relay agent will look up the MAC address table for the output interface to forward the replies that do not have request forwarding information. This feature ensures that DHCP clients can receive DHCP reply packets.
If the broadcast keyword is specified, the DHCP relay agent broadcasts the DHCP reply out of the interface in the matching MAC address entry. When the DHCP relay agent connecting to the requesting DHCP client receives the reply, it sends the reply to its CPU before broadcasting the reply. If relay entry recording is enabled on this relay agent, a relay entry is generated for the DHCP client.
If the broadcast keyword is not specified, the DHCP relay agent connecting to the requesting client will directly forward the reply based on the MAC address instead of delivering it up to the CPU. In this case, the DHCP relay agent cannot be aware that the packet is a DHCP reply, thus no relay entry is generated for the client even if relay entry recording is enabled.
Procedure
1. Enter system view.
system-view
2. Enable MAC address table lookup for DHCP replies that do not have request forwarding information.
dhcp relay mac-forward enable [ broadcast ]
By default, the DHCP relay agent discards a DHCP reply if the relay agent does not have request forwarding information for the reply.
Configuring the DHCP relay agent to always unicast relayed DHCP responses
About this task
This feature enables the DHCP relay agent to ignore the broadcast flag and always unicast relayed responses. This feature is useful in some LANs, such as a WLAN network, where broadcast communication is not recommended.
Procedure
1. Enter system view.
system-view
2. Enable the DHCP relay agent to always unicast relayed DHCP responses.
dhcp relay always-unicast
By default, the DHCP relay agent reads the broadcast flag to decide whether to broadcast or unicast a response.
Configuring forwarding DHCP replies based on Option 82
About this task
Configure this feature if the DHCP relay agent is required to forward DHCP replies to DHCP clients based on Option 82.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable the relay agent to handle Option 82.
dhcp relay information enable
By default, handling of Option 82 is disabled.
4. Configure the padding mode and padding format for the Circuit ID sub-option.
dhcp relay information circuit-id { bas [ with-vxlan ] | srv6-opcode | string circuit-id | { normal | verbose [ node-identifier { mac | sysname | user-defined node-identifier } ] [ interface ] } [ format { ascii | hex } ] }
By default, the padding mode for the Circuit ID sub-option is normal, and the padding format is hex.
The device name (set by using the sysname command) must not include spaces if it is configured as the padding content for sub-option 1. Otherwise, the DHCP relay agent will fail to add or replace Option 82.
You must set the padding mode to bas, normal, or verbose, and specify the sub-interface-vlan keyword for this command.
5. Configure the DHCP relay agent to forward DHCP replies based on Option 82.
dhcp relay forward reply by-option82
By default, the DHCP relay agent does not forward DHCP replies based on Option 82.
Verifying and maintaining DHCP relay agent
Verifying DHCP relay agent configuration
Perform all display tasks in in any view.
· Display information about DHCP servers on an interface.
display dhcp relay server-address [ interface interface-type interface-number ]
· Display Option 82 configuration information on the DHCP relay agent.
display dhcp relay information [ interface interface-type interface-number ]
Displaying and clearing DHCP relay entries
To display DHCP relay entries, execute the following command in any view:
display dhcp relay client-information [ interface interface-type interface-number | ip ip-address [ vpn-instance vpn-instance-name ] ]
To clear DHCP relay entries, execute the following command in user view:
reset dhcp relay client-information [ interface interface-type interface-number | ip ip-address [ vpn-instance vpn-instance-name ] ]
Displaying MAC address check entries on the DHCP relay agent
To display MAC address check entries on the DHCP relay agent, execute the following command in any view:
display dhcp relay check mac-address
Displaying M-LAG status information on the DHCP relay agent
To display M-LAG status information on the DHCP relay agent, execute the following command in any view:
display dhcp relay m-lag-status
Displaying and clearing packet statistics on the DHCP relay agent
To display packet statistics on the DHCP relay agent, execute the following command in any view:
display dhcp relay statistics [ interface interface-type interface-number ]
To clear packet statistics on the DHCP relay agent, execute the following command in user view:
reset dhcp relay statistics [ interface interface-type interface-number ]
DHCP relay agent configuration examples
Example: Configuring basic DHCP relay agent
Network configuration
As shown in Figure 10, configure the DHCP relay agent on Switch A. The DHCP relay agent enables DHCP clients to obtain IP addresses and other configuration parameters from the DHCP server on another subnet.
Prerequisites
The DHCP relay agent and server are on different subnets. Configure static or dynamic routing to make them reachable to each other.
Configure the DHCP server to guarantee the client-server communication through the DHCP relay agent.
Procedure
# Specify IP addresses for the interfaces. (Details not shown.)
# Enable DHCP.
<SwitchA> system-view
[SwitchA] dhcp enable
# Enable the DHCP relay agent on VLAN-interface 10.
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] dhcp select relay
# Specify the IP address of the DHCP server on the relay agent.
[SwitchA-Vlan-interface10] dhcp relay server-address 10.1.1.1
Verifying the configuration
# Verify that DHCP clients can obtain IP addresses and all other network parameters from the DHCP server through the DHCP relay agent. (Details not shown.)
# Display the statistics of DHCP packets forwarded by the DHCP relay agent.
[SwitchA] display dhcp relay statistics
# Display relay entries if you have enabled relay entry recording on the DHCP relay agent.
[SwitchA] display dhcp relay client-information
Example: Configuring Option 82
Network configuration
As shown in Figure 11, the DHCP relay agent (Switch A) replaces Option 82 in DHCP requests before forwarding them to the DHCP server (Switch B).
· The Circuit ID sub-option is company001.
· The Remote ID sub-option is device001.
Prerequisites
To ensure correct processing of Option 82, enable the DHCP server to handle Option 82.
Procedure
# Specify IP addresses for the interfaces. (Details not shown.)
# Enable DHCP.
<SwitchA> system-view
[SwitchA] dhcp enable
# Enable the DHCP relay agent on VLAN-interface 10.
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] dhcp select relay
# Specify the IP address of the DHCP server.
[SwitchA-Vlan-interface10] dhcp relay server-address 10.1.1.1
# Configure the handling strategies and padding content of Option 82.
[SwitchA-Vlan-interface10] dhcp relay information enable
[SwitchA-Vlan-interface10] dhcp relay information strategy replace
[SwitchA-Vlan-interface10] dhcp relay information circuit-id string company001
[SwitchA-Vlan-interface10] dhcp relay information remote-id string device001
Example: Configuring DHCP server selection
Network configuration
As shown in Figure 12, the DHCP client and the DHCP servers are in different subnets. DHCP server 1 and DHCP server 2 both have a DHCP address pool that contains IP addresses in subnet 22.22.22.0/24, but neither has DHCP enabled.
Configure the DHCP relay agent for the DHCP client to obtain an IP address in subnet 22.22.22.0/24 and other configuration parameters from a DHCP server. The DHCP relay agent is connected to the DHCP client through VLAN-interface 2, to DHCP server 1 through VLAN-interface 3, and to DHCP server 2 through VLAN-interface 4.
Procedure
1. Assign IP addresses to interfaces on the switches. (Details not shown.)
2. Configure Switch B and Switch C as DHCP servers. (Details not shown.)
3. Configure the DHCP relay agent on Switch A:
# Enable DHCP.
<SwitchA> system-view
[SwitchA] dhcp enable
# Enable the DHCP relay agent on VLAN-interface 2.
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] dhcp select relay
# Specify the IP addresses of the DHCP servers.
[SwitchA-Vlan-interface2] dhcp relay server-address 1.1.1.1
[SwitchA-Vlan-interface2] dhcp relay server-address 2.2.2.2
# Specify the DHCP server selecting algorithm as master-backup.
[SwitchA-Vlan-interface2] dhcp relay server-address algorithm master-backup
# Configure the DHCP relay agent to switch back to the master DHCP server 3 minutes after it switches to the backup DHCP server.
[SwitchA-Vlan-interface2] dhcp relay master-server switch-delay 3
Verifying the configuration
# Verify that the DHCP client cannot obtain an IP address and that the following log is output in about 30 seconds.
DHCPR/3/DHCPR_SERVERCHANGE:
Switched to the server at 2.2.2.2 because the current server did not respond.
# Enable DHCP on the DHCP server at 1.1.1.1. (Details not shown.)
# Verify that the DHCP client cannot obtain an IP address and that the following log is output in about 3 minutes.
DHCPR/3/DHCPR_SWITCHMASTER:
Switched to the master DHCP server at 1.1.1.1.
# Verify that the DHCP client obtains an IP address. (Details not shown.)
Troubleshooting DHCP relay agent configuration
Failure of DHCP clients to obtain configuration parameters through the DHCP relay agent
Symptom
DHCP clients cannot obtain configuration parameters through the DHCP relay agent.
Solution
Some problems might occur with the DHCP relay agent or server configuration.
To locate the problem, enable debugging and execute the display command on the DHCP relay agent to view the debugging information and interface state information.
Check that:
· DHCP is enabled on the DHCP server and relay agent.
· The DHCP server has an address pool on the same subnet as the DHCP clients.
· The DHCP server and DHCP relay agent can reach each other.
· The DHCP server address specified on the DHCP relay interface connected to the DHCP clients is correct.
Configuring the DHCP client
About DHCP client
With DHCP client enabled, an interface uses DHCP to obtain configuration parameters from the DHCP server, for example, an IP address.
Restrictions and guidelines: DHCP client configuration
The DHCP client configuration is supported only on Layer 3 Ethernet interfaces (or subinterfaces), VLAN interfaces, and Layer 3 aggregate interfaces.
DHCP client tasks at a glance
To configure a DHCP client, perform the following tasks:
1. Enabling the DHCP client on an interface
2. Configuring a DHCP client ID for an interface
Perform this task if the DHCP client uses the client ID to obtain IP addresses.
3. (Optional.) Enabling duplicated address detection
4. (Optional.) Setting the DSCP value for DHCP packets sent by the DHCP client
Enabling the DHCP client on an interface
Restrictions and guidelines
· If the number of IP address request failures reaches the system-defined amount, the DHCP client-enabled interface uses a default IP address.
· An interface can be configured to acquire an IP address in multiple ways. The new configuration overwrites the old.
· Secondary IP addresses cannot be configured on an interface that is enabled with the DHCP client.
· If the interface obtains an IP address on the same segment as another interface on the device, the interface does not use the assigned address. Instead, it requests a new IP address from the DHCP server.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure an interface to use DHCP for IP address acquisition.
ip address dhcp-alloc
By default, an interface does not use DHCP for IP address acquisition.
Configuring a DHCP client ID for an interface
About this task
A DHCP client ID is added to the DHCP option 61 to uniquely identify a DHCP client. A DHCP server can assign IP addresses to clients based on their DHCP client IDs.
DHCP client ID includes an ID type and a type value. Each ID type has a fixed type value. You can specify a DHCP client ID by using one of the following methods:
· Use an ASCII string as the client ID. If an ASCII string is used, the type value is 00.
· Use a hexadecimal number as the client ID. If a hexadecimal number is used, the type value is the first two characters in the number.
· Use the MAC address of an interface to generate a client ID. If this method is used, the type value is 01.
The type value of a DHCP client ID can be displayed by the display dhcp server ip-in-use or display dhcp client command.
Restrictions and guidelines
Make sure the ID for each DHCP client is unique.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure a DHCP client ID for the interface.
dhcp client identifier { ascii ascii-string | hex hex-string | mac interface-type interface-number }
By default, an interface generates the DHCP client ID based on its MAC address. If the interface has no MAC address, it uses the MAC address of the first Ethernet interface to generate its client ID.
Enabling duplicated address detection
About this task
DHCP client detects IP address conflict through ARP packets. An attacker can act as the IP address owner to send an ARP reply. The spoofing attack makes the client unable to use the IP address assigned by the server. As a best practice, disable duplicate address detection when ARP attacks exist on the network.
Procedure
1. Enter system view.
system-view
2. Enable duplicate address detection.
dhcp client dad enable
By default, the duplicate address detection feature is enabled on an interface.
Setting the DSCP value for DHCP packets sent by the DHCP client
About this task
The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet.
Procedure
1. Enter system view.
system-view
2. Set the DSCP value for DHCP packets sent by the DHCP client.
dhcp client dscp dscp-value
By default, the DSCP value in DHCP packets sent by the DHCP client is 56.
Verifying and maintaining DHCP client
To display DHCP client information, execute the following command in any view:
display dhcp client [ verbose ] [ interface interface-type interface-number ]
Configuring the BOOTP client
About BOOTP client
BOOTP client application
An interface that acts as a BOOTP client can use BOOTP to obtain information (such as IP address) from the BOOTP server.
To use BOOTP, an administrator must configure a BOOTP parameter file for each BOOTP client on the BOOTP server. The parameter file contains information such as MAC address and IP address of a BOOTP client. When a BOOTP client sends a request to the BOOTP server, the BOOTP server searches for the BOOTP parameter file and returns the corresponding configuration information.
BOOTP is usually used in relatively stable environments. In network environments that change frequently, DHCP is more suitable.
Because a DHCP server can interact with a BOOTP client, you can use the DHCP server to assign an IP address to the BOOTP client instead of using a BOOTP server. The DHCP server will assign an IP address to the BOOTP client based on the IP address allocation sequence.
Obtaining an IP address dynamically
A BOOTP client dynamically obtains an IP address from a BOOTP server as follows:
1. The BOOTP client broadcasts a BOOTP request, which contains its own MAC address.
2. Upon receiving the request, the BOOTP server searches the configuration file for the IP address and other information according to the BOOTP client's MAC address.
3. The BOOTP server returns a BOOTP response to the BOOTP client.
4. The BOOTP client obtains the IP address from the received response.
A DHCP server can take the place of the BOOTP server in the following dynamic IP address acquisition.
Protocols and standards
· RFC 951, Bootstrap Protocol (BOOTP)
· RFC 2132, DHCP Options and BOOTP Vendor Extensions
· RFC 1542, Clarifications and Extensions for the Bootstrap Protocol
Configuring an interface to use BOOTP for IP address acquisition
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
BOOTP client configuration applies only to Layer 3 Ethernet interfaces (including subinterfaces), Layer 3 aggregate interfaces, and VLAN interfaces.
3. Configure an interface to use BOOTP for IP address acquisition.
ip address bootp-alloc
By default, an interface does not use BOOTP for IP address acquisition.
Verifying and maintaining BOOTP client
To display BOOTP client information, execute the following command in any view:
display bootp client [ interface interface-type interface-number ]
BOOTP client configuration examples
Example: Configuring BOOTP client
Network configuration
As shown in Figure 13, Switch B's port belonging to VLAN 10 is connected to the LAN. VLAN-interface 10 obtains an IP address from the DHCP server by using BOOTP.
Prerequisites
Configure the DHCP server to assign an IP address to the BOOTP client.
Procedure
The following describes the configuration on Switch B, which acts as a client.
# Configure VLAN-interface 10 to dynamically obtain an IP address from the DHCP server.
<SwitchB> system-view
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] ip address bootp-alloc
Verifying the configuration
# Display the IP address assigned to the BOOTP client.
[SwitchB] display bootp client