05-Layer 3—IP Services Command Reference

HomeSupportReference GuidesCommand ReferencesH3C S9825 & S9855 Switch Series Command References-R9126Pxx-6W10005-Layer 3—IP Services Command Reference
03-DHCP commands
Title Size Download
03-DHCP commands 224.70 KB

Contents

DHCP commands· 1

Common DHCP commands· 1

dhcp client-detect 1

dhcp dscp· 1

dhcp enable· 2

dhcp select 2

DHCP relay agent commands· 3

dhcp relay always-unicast 3

dhcp relay check mac-address· 4

dhcp relay check mac-address aging-time· 4

dhcp relay client-information record· 5

dhcp relay client-information refresh· 6

dhcp relay client-information refresh enable· 6

dhcp relay dhcp-server timeout 7

dhcp relay forward reply by-option82· 8

dhcp relay gateway· 9

dhcp relay information circuit-id· 9

dhcp relay information enable· 11

dhcp relay information remote-id· 12

dhcp relay information link-selection· 13

dhcp relay information strategy· 14

dhcp relay insert option60· 15

dhcp relay master-server switch-delay· 16

dhcp relay release ip· 17

dhcp relay server-address· 17

dhcp relay server-address algorithm·· 18

dhcp relay source-address· 19

dhcp-server timeout 21

dhcp smart-relay enable· 22

display dhcp relay check mac-address· 22

display dhcp relay client-information· 23

display dhcp relay information· 25

display dhcp relay server-address· 26

display dhcp relay statistics· 27

gateway-list 28

master-server switch-delay· 29

remote-server 30

remote-server algorithm·· 30

reset dhcp relay client-information· 31

reset dhcp relay statistics· 32

DHCP client commands· 32

dhcp client dad enable· 32

dhcp client dscp· 33

dhcp client identifier 33

display dhcp client 34

ip address dhcp-alloc· 37

BOOTP client commands· 37

display bootp client 37

ip address bootp-alloc· 38


DHCP commands

Common DHCP commands

dhcp client-detect

Use dhcp client-detect to enable client offline detection on the DHCP relay agent.

Use undo dhcp client-detect to disable client offline detection on the DHCP relay agent.

Syntax

dhcp client-detect

undo dhcp client-detect

Default

Client offline detection is disabled on the DHCP relay agent.

Views

Interface view

Predefined user roles

network-admin

Usage guidelines

This feature on the DHCP relay agent deletes the related relay entry and sends a RELEASE message to the DHCP server when an ARP entry ages out.

Examples

# Enable client offline detection.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] dhcp client-detect

dhcp dscp

Use dhcp dscp to set the DSCP value for DHCP packets sent by the DHCP relay agent.

Use undo dhcp dscp to restore the default.

Syntax

dhcp dscp dscp-value

undo dhcp dscp

Default

The DSCP value is 56 in DHCP packets sent by the DHCP relay agent.

Views

System view

Predefined user roles

network-admin

Parameters

dscp-value: Specifies the DSCP value for DHCP packets, in the range of 0 to 63.

Usage guidelines

The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. A bigger DSCP value represents a higher priority.

Examples

# Set the DSCP value to 30 for DHCP packets sent by the DHCP relay agent.

<Sysname> system-view

[Sysname] dhcp dscp 30

dhcp enable

Use dhcp enable to enable DHCP.

Use undo dhcp enable to disable DHCP.

Syntax

dhcp enable

undo dhcp enable

Default

DHCP is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

DHCP related configuration takes effect only after you enable DHCP.

Enable DHCP before you configure the relay agent.

Examples

# Enable DHCP.

<Sysname> system-view

[Sysname] dhcp enable

dhcp select

Use dhcp select to enable the DHCP relay agent on an interface.

Use undo dhcp select to disable the DHCP relay agent on an interface. The interface will discard incoming DHCP packets.

Syntax

dhcp select relay

undo dhcp select relay

Default

An interface does not operate in DHCP relay agent mode.

Views

Interface view

Predefined user roles

network-admin

Parameters

relay: Enables the DHCP relay agent on the interface.

Usage guidelines

When the interface operates as a DHCP relay agent, it does not clear address bindings and authorized ARP entries. These authorized ARP entries might conflict with ARP entries that are created after the DHCP relay agent mode is enabled.

Examples

# Enable the DHCP relay agent on VLAN-interface 2.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] dhcp select relay

Related commands

dhcp relay always-unicast

dhcp smart-relay enable

DHCP relay agent commands

dhcp relay always-unicast

Use dhcp relay always-unicast to enable the DHCP relay agent to always unicast relayed DHCP responses.

Use undo dhcp relay always-unicast to restore the default.

Syntax

dhcp relay always-unicast

undo dhcp relay always-unicast

Default

The DHCP relay agent reads the broadcast flag in a DHCP response to decide whether to broadcast or unicast the relayed response.

Views

System view

Predefined user roles

network-admin

Usage guidelines

This command enables the DHCP server to ignore the broadcast flag in DHCP responses and always unicast all relayed responses.

Examples

# Enable the DHCP relay agent to always unicast relayed DHCP responses.

<Sysname> system-view

[Sysname] dhcp relay always-unicast

Related commands

dhcp select relay

dhcp relay check mac-address

Use dhcp relay check mac-address to enable MAC address check on the relay agent.

Use undo dhcp relay check mac-address to disable MAC address check on the relay agent.

Syntax

dhcp relay check mac-address

undo dhcp relay check mac-address

Default

The MAC address check feature is disabled.

Views

Interface view

Predefined user roles

network-admin

Usage guidelines

This feature enables the DHCP relay agent to compare 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 they are not the same, the DHCP relay agent discards the request.

The MAC address check feature takes effect only when the dhcp select relay command has already been configured on the interface.

Enable the MAC address check feature 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.

Examples

# Enable MAC address check on the DHCP relay agent.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] dhcp relay check mac-address

Related commands

dhcp select relay

dhcp relay check mac-address aging-time

Use dhcp relay check mac-address aging-time to set the aging time for MAC address check entries on the DHCP relay agent.

Use undo dhcp relay check mac-address aging-time to restore the default.

Syntax

dhcp relay check mac-address aging-time time

undo dhcp relay check mac-address aging-time

Default

The aging time is 30 seconds.

Views

System view

Predefined user roles

network-admin

Parameters

time: Specifies the aging time for MAC address check entries, in the range of 30 to 600 seconds.

Usage guidelines

This command takes effect only after you execute the dhcp relay check mac-address command.

Examples

# Set the aging time to 60 seconds for MAC address check entries on the DHCP relay agent.

<Sysname> system-view

[Sysname] dhcp relay check mac-address aging-time 60

dhcp relay client-information record

Use dhcp relay client-information record to enable recording client information in relay entries.

Use undo dhcp relay client-information record to disable the feature.

Syntax

dhcp relay client-information record

undo dhcp relay client-information record

Default

The DHCP relay agent does not record client information in relay entries.

Views

System view

Predefined user roles

network-admin

Usage guidelines

Client information is recorded only when the DHCP relay agent is configured on the gateway of DHCP clients. A relay entry contains information about a client such as the client's IP and MAC addresses.

Disabling the recording of client information deletes all recorded relay entries.

Examples

# Enable the recording of relay entries on the relay agent.

<Sysname> system-view

[Sysname] dhcp relay client-information record

Related commands

dhcp relay client-information refresh

dhcp relay client-information refresh enable

dhcp relay client-information refresh

Use dhcp relay client-information refresh to set the interval at which the DHCP relay agent refreshes relay entries.

Use undo dhcp relay client-information refresh to restore the default.

Syntax

dhcp relay client-information refresh [ auto | interval interval ]

undo dhcp relay client-information refresh

Default

The refresh interval is automatically calculated based on the number of relay entries.

Views

System view

Predefined user roles

network-admin

Parameters

auto: Automatically calculates the refresh interval. The more the entries, the shorter the refresh interval. The shortest interval is 50 ms.

interval interval: Specifies the refresh interval in the range of 1 to 120 seconds.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

Examples

# Set the refresh interval to 100 seconds.

<Sysname> system-view

[Sysname] dhcp relay client-information refresh interval 100

Related commands

dhcp relay client-information record

dhcp relay client-information refresh enable

dhcp relay client-information refresh enable

Use dhcp relay client-information refresh enable to enable the DHCP relay agent to periodically refresh dynamic relay entries.

Use undo dhcp relay client-information refresh enable to disable the DHCP relay agent to periodically refresh dynamic relay entries.

Syntax

dhcp relay client-information refresh enable

undo dhcp relay client-information refresh enable

Default

The DHCP relay agent periodically refreshes relay entries.

Views

System view

Predefined user roles

network-admin

Usage guidelines

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 a client's IP address and the relay interface's MAC address to periodically send a DHCP-REQUEST message to the DHCP server.

·     If the server returns a DHCP-ACK message or does not return any message within an interval, the DHCP relay agent performs the following operations:

¡     Removes the relay entry.

¡     Sends a DHCP-RELEASE message to the DHCP server to release the IP address.

·     If the server returns a DHCP-NAK message, the relay agent keeps the entry.

With this feature disabled, the DHCP relay agent does not remove relay entries automatically. After a DHCP client releases its IP address, you must use the reset dhcp relay client-information command on the relay agent to remove the corresponding relay entry.

Examples

# Disable periodic refresh of relay entries.

<Sysname> system-view

[Sysname] undo dhcp relay client-information refresh enable

Related commands

dhcp relay client-information record

dhcp relay client-information refresh

reset dhcp relay client-information

dhcp relay dhcp-server timeout

Use dhcp relay dhcp-server timeout to set the DHCP server response timeout time for DHCP server switchover.

Use undo dhcp relay dhcp-server timeout to restore the default.

Syntax

dhcp relay dhcp-server timeout time

undo dhcp relay dhcp-server timeout

Default

The DHCP server response timeout time is 30 seconds.

Views

Interface view

Predefined user roles

network-admin

Parameters

time: Specifies the DHCP server response timeout time in the range of 30 to 65535 seconds.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

Examples

# Set the DHCP server response timeout time to 60 seconds for DHCP server switchover on VLAN-interface 2.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] dhcp relay dhcp-server timeout 60

Related commands

dhcp relay server-address algorithm

dhcp relay forward reply by-option82

Use dhcp relay forward reply by-option82 to configure the DHCP relay agent to forward DHCP replies based on Option 82.

Use undo dhcp relay forward reply by-option82 to restore the default.

Syntax

dhcp relay forward reply by-option82

undo dhcp relay forward reply by-option82

Default

The DHCP relay agent does not forward DHCP replies based on Option 82.

Views

Interface view

Predefined user roles

network-admin

Usage guidelines

This command takes effect only after you execute the dhcp relay information enable and dhcp relay information circuit-id commands.

Examples

# Configure the DHCP relay agent to forward DHCP replies based on Option 82.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] dhcp relay forward reply by-option82

Related commands

dhcp relay information circuit-id

dhcp relay information enable

dhcp relay gateway

Use dhcp relay gateway to specify the DHCP relay agent address to be padded to DHCP requests.

Use undo dhcp relay gateway to restore the default.

Syntax

dhcp relay gateway ip-address

undo dhcp relay gateway

Default

The primary IP address of the interface is padded to DHCP requests as the DHCP relay agent address.

Views

Interface view

Predefined user roles

network-admin

Parameters

ip-address: Specifies the DHCP relay agent address. It must be an IP address of the interface.

Usage guidelines

The DHCP relay agent uses the specified IP address instead of the primary IP address of the relay interface as the DHCP relay agent address.

If you execute this command multiple times, the most recent configuration takes effect.

Examples

# Specify 10.1.1.1 as the DHCP relay agent address to be padded to DHCP requests on VLAN-interface 2.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] dhcp relay gateway 10.1.1.1

Related commands

gateway-list

dhcp relay information circuit-id

Use dhcp relay information circuit-id to configure the padding mode and padding format for the Circuit ID sub-option of Option 82.

Use undo dhcp relay information circuit-id to restore the default.

Syntax

dhcp relay information circuit-id { bas | srv6-opcode | string circuit-id | { normal | verbose [ node-identifier { mac | sysname | user-defined node-identifier } ] [ interface ] } [ format { ascii | hex } ] }

undo dhcp relay information circuit-id

Default

The padding mode is normal and the padding format is hex.

Views

Interface view

Predefined user roles

network-admin

Parameters

bas: Specifies the bas mode that fills in the Circuit ID sub-option with the interface and VLAN information. The device fills the information in the format of interface-type slot/subslot/port vlan_id.subvlan_id.

srv6-opcode: Specifies the SRv6 opcode mode that inserts the SRv6 opcode of the relay interface into the Circuit ID sub-option. On receipt of the relayed DHCP request, the server allocates an IP address and network settings according to the padded opcode.

string circuit-id: Specifies the string mode that uses a case-sensitive string of 3 to 63 characters as the content of the Circuit ID sub-option.

normal: Specifies the normal mode, in which the padding content consists of the VLAN ID and port number.

verbose: Specifies the verbose mode. The padding content includes the node identifier, interface information, and VLAN ID. The default node identifier is the MAC address of the access node. The default interface information consists of the Ethernet type (fixed to eth), chassis number, slot number, sub-slot number, and interface number.

node-identifier { mac | sysname | user-defined node-identifier }: Specifies the access node identifier.

·     mac: Uses the MAC address of the access node as the node identifier.

·     sysname: Uses the device name as the node identifier. You can set the device name by using the sysname command in system view. The padding format for the device name is always ASCII regardless of the specified padding format.

 

 

NOTE:

If sysname is specified as the node identifier, do not include any spaces when you set the device name. Otherwise, the DHCP relay agent fails to add or replace Option 82.

 

·     user-defined node-identifier: Uses a case-sensitive string of 1 to 50 characters as the node identifier. The padding format for the specified character string is always ASCII regardless of the specified padding format.

interface: Uses the interface name as the interface information. The padding format for the interface name is always ASCII regardless of the specified padding format.

format: Specifies the padding format for the Circuit ID sub-option.

ascii: Specifies the ASCII padding format.

hex: Specifies the hex padding format.

Usage guidelines

The Circuit ID sub-option cannot carry information about interface splitting or subinterfaces. For more information about interface splitting and subinterfaces, see Interface Configuration Guide.

If you execute this command multiple times, the most recent configuration takes effect.

The padding format for the string mode, the normal mode, or the verbose mode varies by command configuration. Table 1 shows how the padding format is determined for different modes.

Table 1 Padding format for different modes

Keyword (mode)

If no padding format is set

If the padding format is ascii

If the padding format is hex

string circuit-id

The padding format is ASCII, and is not configurable.

N/A

N/A

normal

Hex.

ASCII.

Hex.

verbose

Hex for the VLAN ID.

ASCII for the node identifier, Ethernet type, chassis number, slot number, sub-slot number, and interface number.

ASCII.

ASCII for the node identifier and Ethernet type.

Hex for the chassis number, slot number, sub-slot number, interface number, and VLAN ID.

 

Examples

# Specify the content mode as verbose, node identifier as the device name, and the padding format as ASCII for the Circuit ID sub-option.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] dhcp relay information enable

[Sysname-Vlan-interface10] dhcp relay information strategy replace

[Sysname-Vlan-interface10] dhcp relay information circuit-id verbose node-identifier sysname format ascii

Related commands

dhcp relay forward reply by-option82

dhcp relay information enable

dhcp relay information strategy

display dhcp relay information

dhcp relay information enable

Use dhcp relay information enable to enable the DHCP relay agent to support Option 82.

Use undo dhcp relay information enable to disable Option 82 support.

Syntax

dhcp relay information enable

undo dhcp relay information enable

Default

The DHCP relay agent does not support Option 82.

Views

Interface view

Predefined user roles

network-admin

Usage guidelines

This command enables the DHCP relay agent to add Option 82 to DHCP requests that do not contain Option 82 before forwarding the requests to the DHCP server. The content of Option 82 is determined by the dhcp relay information circuit-id and dhcp relay information remote-id commands. If the DHCP requests contain Option 82, the relay agent handles the requests according to the strategy configured with the dhcp relay information strategy command.

If this feature is disabled, the relay agent forwards requests that contain or do not contain Option 82 to the DHCP server.

Examples

# Enable Option 82 support on the relay agent.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] dhcp relay information enable

Related commands

dhcp relay forward reply by-option82

dhcp relay information circuit-id

dhcp relay information remote-id

dhcp relay information strategy

display dhcp relay information

dhcp relay information remote-id

Use dhcp relay information remote-id to configure the padding mode and padding format for the Remote ID sub-option of Option 82.

Use undo dhcp relay information remote-id to restore the default.

Syntax

dhcp relay information remote-id { normal [ format { ascii | hex } ] | string remote-id | sysname }

undo dhcp relay information remote-id

Default

The padding mode is normal and the padding format is hex.

Views

Interface view

Predefined user roles

network-admin

Parameters

normal: Specifies the normal mode in which the padding content is the MAC address of the receiving interface.

format: Specifies the padding format for the Remote ID sub-option. The default padding format is hex.

ascii: Specifies the ASCII padding format.

hex: Specifies the hex padding format.

string remote-id: Specifies the string mode that uses a case-sensitive string of 1 to 63 characters as the content of the Remote ID sub-option.

sysname: Specifies the sysname mode that uses the device name as the content of the Remote ID sub-option. You can set the device name by using the sysname command.

Usage guidelines

The padding format for the specified character string (string) or the device name (sysname) is always ASCII. The padding format for the normal mode is determined by the command.

If you execute this command multiple times, the most recent configuration takes effect.

Examples

# Specify the padding content for the Remote ID sub-option of Option 82 as device001.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] dhcp relay information enable

[Sysname-Vlan-interface10] dhcp relay information strategy replace

[Sysname-Vlan-interface10] dhcp relay information remote-id string device001

Related commands

dhcp relay information enable

dhcp relay information strategy

display dhcp relay information

dhcp relay information link-selection

Use dhcp relay information link-selection to specify the IP address to be filled in sub-option 5 of Option 82.

Use undo dhcp relay information link-selection to restore the default.

Syntax

dhcp relay information link-selection link-selection-address

undo dhcp relay information link-selection

Default

The relay agent fills either of the following addresses in sub-option 5 of Option 82:

·     Gateway address in the AAA-authorized address pool or the address pool bound to the relay interface.

·     IP address of the relay interface.

Views

Interface view

Predefined user roles

network-admin

Parameters

link-selection-address: Specifies an IP address in dotted decimal notation. The specified address will be filled in sub-option 5 of Option 82.

Usage guidelines

When you use this command, follow these guidelines:

·     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.

·     To ensure successful IP address allocation, the specified sub-option 5 address must belong to the same network segment as one of the following:

¡     Gateway address in the AAA-authorized address pool or the address pool bound to the relay interface.

¡     IP address of the DHCP relay interface.

The relay agent selects the IP address to be filled in sub-option 5 in the following order:

1.     IP address specified by using the dhcp relay information link-selection command.

2.     Gateway address in the AAA-authorized address pool or the address pool bound to the relay interface.

3.     IP address of the relay interface.

Examples

# Fill IP address 1.1.1.1 in sub-option 5.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] dhcp relay information link-selection 1.1.1.1

Related commands

dhcp relay information enable

dhcp relay source-address

dhcp relay information strategy

Use dhcp relay information strategy to configure the strategy for the DHCP relay agent to handle messages containing Option 82.

Use undo dhcp relay information strategy to restore the default handling strategy.

Syntax

dhcp relay information strategy { drop | keep | replace }

undo dhcp relay information strategy

Default

The handling strategy for messages that contain Option 82 is replace.

Views

Interface view

Predefined user roles

network-admin

Parameters

drop: Drops DHCP messages that contain Option 82 messages.

keep: Keeps the original Option 82 intact and forwards the DHCP messages.

replace: Replaces the original Option 82 with the configured Option 82 before forwarding the DHCP messages.

Usage guidelines

This command takes effect only on DHCP requests that contain Option 82.

For DHCP requests that do not contain Option 82, the DHCP relay agent always adds Option 82 to the requests before forwarding the requests to the DHCP server.

If the handling strategy is replace, configure a padding mode and padding format for Option 82. If the handling strategy is keep or drop, you do not need to configure any padding mode or padding format. The settings do not take effect even if you configure them.

Examples

# Specify the handling strategy for Option 82 as keep.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] dhcp relay information enable

[Sysname-Vlan-interface10] dhcp relay information strategy keep

Related commands

dhcp relay information enable

display dhcp relay information

dhcp relay insert option60

Use dhcp relay insert option60 to enable the DHCP relay agent to insert Option 60 into DHCP requests.

Use undo dhcp relay insert option60 to restore the default.

Syntax

dhcp relay insert option60 option-text

undo dhcp relay insert option60

Default

The DHCP relay agent does not insert Option 60 into DHCP requests.

Views

Interface view

Predefined user roles

network-admin

Parameters

option-text: Specifies the content of Option 60, a case-sensitive string of 1 to 128 characters.

Usage guidelines

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 this 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.

The command takes effect only after you execute the dhcp select relay command.

If you execute this command multiple times on an interface, the most recent configuration takes effect.

Examples

# On VLAN-interface 10, enable the DHCP relay agent to insert Option 60 into DHCP requests.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] dhcp relay insert option60 sysname.com

Related commands

dhcp select relay

dhcp relay master-server switch-delay

Use dhcp relay master-server switch-delay to enable the switchback to the master DHCP server and set the switchback delay time.

Use undo dhcp relay master-server switch-delay to restore the default.

Syntax

dhcp relay master-server switch-delay delay-time

undo dhcp relay master-server switch-delay

Default

The DHCP relay agent does not switch back to the master DHCP server.

Views

Interface view

Predefined user roles

network-admin

Parameters

delay-time: Specifies the delay time in the range of 1 to 65535 minutes.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

Examples

# Configure the DHCP relay agent to switch back to the master DHCP server 3 minutes after it switches to a backup DHCP server on VLAN-interface 2.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] dhcp relay master-server switch-delay 3

Related commands

dhcp relay server-address algorithm

dhcp relay release ip

Use dhcp relay release ip to release a client IP address.

Syntax

dhcp relay release ip ip-address [ vpn-instance vpn-instance-name ]

Views

System view

Predefined user roles

network-admin

Parameters

ip-address: Specifies the IP address to be released.

vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the specified IP address belongs. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command releases the IP address on the public network.

Usage guidelines

After you execute this command, the relay agent sends a DHCP-RELEASE packet to the DHCP server and removes the relay entry of the IP address. Upon receiving the packet, the server removes binding information about the specified IP address to release the IP address.

Examples

# Release IP address 1.1.1.1.

<Sysname> system-view

[Sysname] dhcp relay release ip 1.1.1.1

dhcp relay server-address

Use dhcp relay server-address to specify DHCP servers on the DHCP relay agent.

Use undo dhcp relay server-address to remove DHCP servers.

Syntax

dhcp relay server-address ip-address

undo dhcp relay server-address [ ip-address ]

Default

No DHCP server is specified on the DHCP relay agent.

Views

Interface view

Predefined user roles

network-admin

Parameters

ip-address: Specifies the IP address of a DHCP server. The DHCP relay agent forwards DHCP packets received from DHCP clients to this DHCP server.

Usage guidelines

The specified IP address of the DHCP server must not reside on the same subnet as the IP address of the DHCP relay agent interface. Otherwise, the DHCP clients might fail to obtain IP addresses.

You can specify a maximum of eight DHCP servers on an interface. The DHCP relay agent forwards the packets from the clients to all the specified DHCP servers.

If you do not specify an IP address, the undo dhcp relay server-address command removes all DHCP servers on the interface.

Examples

# Specify DHCP server address 1.1.1.1 on VLAN-interface 10.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] dhcp relay server-address 1.1.1.1

Related commands

dhcp select relay

display dhcp relay interface

dhcp relay server-address algorithm

Use dhcp relay server-address algorithm to specify the DHCP server selecting algorithm.

Use undo dhcp relay server-address algorithm to restore the default.

Syntax

dhcp relay server-address algorithm { master-backup | polling }

undo dhcp relay server-address algorithm

Default

The polling algorithm is used. The DHCP relay agent forwards DHCP requests to all DHCP servers at the same time.

Views

Interface view

Predefined user roles

network-admin

Parameters

master-backup: Forwards DHCP requests to the master DHCP server first. If the master server is not available or does not have assignable IP addresses, the relay agent forwards DHCP requests to backup DHCP servers in the order they are specified.

polling: Forwards DHCP requests to all DHCP servers at the same time.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

Examples

# Specify master-backup as the DHCP server selecting algorithm on VLAN-interface 2.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] dhcp relay server-address algorithm master-backup

Related commands

dhcp relay dhcp-server timeout

dhcp relay master-server switch-delay

dhcp relay server-address

remote-server algorithm

dhcp relay source-address

Use dhcp relay source-address to specify the source IP address for DHCP requests.

Use undo dhcp relay source-address to restore the default.

Syntax

dhcp relay source-address { ip-address [ default-giaddr ] [ option code [ option-text ] ] | gateway | interface interface-type interface-number [ default-giaddr ] | relay-interface }

undo dhcp relay source-address { ip-address [ default-giaddr ] [ option code [ option-text ] ] | gateway | interface | relay-interface }

Default

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.

Views

Interface view

Predefined user roles

network-admin

Parameters

ip-address: Specifies the source IP address for DHCP requests. This IP address will also be filled in the giaddr field.

default-giaddr: Uses the original address in the giaddr field. If you do not specify this keyword, the relay agent inserts the relay interface IP address or the specified IP address into the giaddr field in DHCP requests.

option code [ option-text ]: Changes the source IP address and the giaddr field of a DHCP request if the DHCP request carries the specified option. If you do not specify any option, this command changes the source IP address and the giaddr field of all DHCP requests that the interface receives.

·     The code argument represents the option code and the value range for this argument is 1 to 254.

·     To match DHCP requests by the content of Option 60, specify the option-text argument. This argument is available only when the value for the code argument is 60. The value for this argument is a case-sensitive string of 1 to 128 characters.

gateway: Uses the IP address in the giaddr field as the source IP address of the DHCP requests. If the giaddr field is empty, the relay agent follows the default rule to specify the source IP address for DHCP requests.

interface interface-type interface-number: Uses the IP address of an interface as the source IP address. The interface-type interface-number arguments specify an interface by its type and number. 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: 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.

Usage guidelines

If you specify the ip-address or interface-type interface-number 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 DHCP 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 agent 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.

If the DHCP relay agent does not support Option 82, specify the default-giaddr keyword when you configure the ip-address or interface-type interface-number argument. This command will change only the source IP address field without changing the giaddr field in DHCP requests.

The source IP addresses specified by the following commands overwrite each other, whichever is configured the last:

·     The dhcp relay source-address ip-address command without any DHCP options specified.

·     The dhcp relay source-address interface command.

·     The dhcp relay source-address gateway command.

·     The dhcp relay source-address relay-interface command.

The dhcp relay source-address ip-address option code [ option-text ] and dhcp relay source-address { ip-address | gateway | interface | relay-interface } commands do not overwrite each other.

If multiple sources IP addresses are specified on an interface, their match order is as follows:

1.     Source IP address specified in the dhcp relay source-address interface command.

2.     Source IP addresses specified together with DHCP options.

The relay agent matches these IP addresses against the DHCP options of a DHCP request in descending order of option values. The first matching IP address will be used as the source IP address for the DHCP request.

When the relay agent matches source IP addresses against Option 60, the source IP addresses with the option-text argument take precedence over those without the option-text argument.

3.     Source IP address specified in the dhcp relay source-address relay-interface command.

4.     Source IP address specified in the dhcp relay source-address gateway command.

5.     Source IP address specified by the dhcp relay source-address ip-address commands without any DHCP options specified.

When you use the undo form of this command to remove the configuration, follow these guidelines:

·     The undo dhcp relay source-address ip-address command removes the configuration made by either of the following commands:

¡     dhcp relay source-address ip-address

¡     dhcp relay source-address ip-address default-giaddr

·     When you use the undo dhcp relay source-address ip-address command to remove the configuration that includes a DHCP option, specify that DHCP option in the command.

·     If you do not specify any options, the undo dhcp relay source-address command removes all configured source IP addresses for DHCP requests on the interface.

Examples

# Specify 1.1.1.1 as the source IP address for DHCP requests on VLAN-interface 2.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] dhcp relay source-address 1.1.1.1

dhcp-server timeout

Use dhcp-server timeout to set the DHCP server response timeout time for DHCP server switchover.

Use undo dhcp-server timeout to restore the default.

Syntax

dhcp-server timeout time

undo dhcp-server timeout

Default

The DHCP server response timeout time is 30 seconds.

Views

DHCP address pool view

Predefined user roles

network-admin

Parameters

time: Specifies the DHCP server response timeout time in the range of 30 to 65535 seconds.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

Examples

# Set the DHCP server response timeout time to 60 seconds for DHCP server switchover in DHCP address pool 0.

<Sysname> system-view

[Sysname] dhcp server ip-pool 0

[Sysname-dhcp-pool-0] dhcp-server timeout 60

Related commands

remote-server algorithm

dhcp smart-relay enable

Use dhcp smart-relay enable to enable the DHCP smart relay feature.

Use undo dhcp smart-relay enable to disable the DHCP smart relay feature.

Syntax

dhcp smart-relay enable

undo dhcp smart-relay enable

Default

The DHCP smart relay feature is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

The smart relay feature allows the relay agent to use secondary IP addresses as the gateway address when the DHCP server does not reply the 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 returned after two retries, the relay agent switches to secondary IP addresses.

Without this feature, the relay agent always uses the primary IP address as the gateway address.

Examples

# Enable the DHCP smart relay feature.

<Sysname> system-view

[Sysname] dhcp smart-relay enable

Related commands

dhcp select

gateway-list

display dhcp relay check mac-address

Use display dhcp relay check mac-address to display MAC address check entries on the relay agent.

Syntax

display dhcp relay check mac-address

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display MAC address check entries on the DHCP relay agent.

<Sysname> display dhcp relay check mac-address

Source-MAC        Interface                 Aging-time

23f3-1122-adf1    Vlan2                     10

23f3-1122-2230    Vlan3                     30

Table 2 Command output

Field

Description

Source MAC

Source MAC address of the attacker.

Interface

Interface where the attack comes from.

Aging-time

Aging time of the MAC address check entry, in seconds.

 

display dhcp relay client-information

Use display dhcp relay client-information to display relay entries on the relay agent.

Syntax

display dhcp relay client-information [ interface interface-type interface-number | ip ip-address [ vpn-instance vpn-instance-name ] ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

interface interface-type interface-number: Displays relay entries on the specified interface. If you do not specify an interface, this command displays relay entries on all interfaces.

ip ip-address: Displays the relay entry for the specified IP address. If you do not specify an IP address, this command displays relay entries for all IP addresses.

vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the specified IP address belongs. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays the relay entry for the specified IP address on the public network.

Usage guidelines

The DHCP relay agent records relay entries only after you configure the dhcp relay client-information record command.

Examples

# Display all relay entries on the relay agent.

<Sysname> display dhcp relay client-information

Total number of client-information items: 2

Total number of dynamic items: 1

Total number of temporary items: 1

IP address       MAC address      Type        Interface            VPN name

10.1.1.1         00e0-0000-0001   Dynamic     Vlan2                N/A

10.1.1.5         00e0-0000-0000   Temporary   Vlan2                N/A

# Display relay entries for the specified IP address.

<Sysname> display dhcp relay client-information ip 10.1.1.5

Total number of client-information items: 1

Total number of dynamic items: 1

Total number of temporary items: 0

IP address       : 10.1.1.5

MAC address      : 00e0-0000-0000

Type             : Dynamic

Port index       : N/A

Interface        : Vlan2

VPN name         : N/A

Server address   : 12.1.1.2

Access type      : CommonV4

Outer VLAN       : N/A

Inner VLAN       : N/A

PPP index        : 0

Table 3 Command output

Field

Description

Total number of client-information items

Total number of relay entries.

Total number of dynamic items

Total number of dynamic relay entries.

Total number of temporary items

Total number of temporary relay entries.

IP address

IP address of the DHCP client.

MAC address

MAC address of the DHCP client.

Type

Relay entry type:

·     Dynamic—The relay agent creates a dynamic relay entry upon receiving an ACK response from the DHCP server.

·     Temporary—The relay agent creates a temporary relay entry upon receiving a REQUEST packet from a DHCP client.

Interface

Layer 3 interface connected to the DHCP client. N/A is displayed for relay entries without interface information.

VPN name

Name of the VPN instance to which the DHCP client belongs. If the DHCP client does not belong to any VPN, this field displays N/A.

Port index

Layer 2 port that receives the DHCP request. If the request is not received through a Layer 2 port, this field displays N/A.

Server address

IP address of the DHCP server.

Access type

Access type of the DHCP client. Commonv4 represents the DHCP method.

Outer VLAN

Outer VLAN tag contained in the DHCP request. If the request does not contain an outer VLAN tag, this field displays N/A.

Inner VLAN

Inner VLAN tag contained in the DHCP request. If the request does not contain an inner VLAN tag, this field displays N/A.

PPP index

This field is not supported in the current software version.

PPP session index. If no PPP session index exists, this field displays N/A.

 

Related commands

dhcp relay client-information record

reset dhcp relay client-information

display dhcp relay information

Use display dhcp relay information to display Option 82 configuration information for the DHCP relay agent.

Syntax

display dhcp relay information [ interface interface-type interface-number ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

interface interface-type interface-number: Displays Option 82 configuration information for the specified interface. If you do not specify an interface, this command displays Option 82 configuration information about all interfaces.

Examples

# Display Option 82 configuration information for all interfaces.

<Sysname> display dhcp relay information

Interface: Vlan-interface100

   Status: Enable

   Strategy: Replace

   Circuit ID Pattern: Verbose

   Remote ID Pattern: Sysname

   Circuit ID format-type: Undefined

   Remote ID format-type: ASCII

   Node identifier: aabbcc

Interface: Vlan-interface200

   Status: Enable

   Strategy: Replace

   Circuit ID Pattern: User Defined

   Remote ID Pattern: User Defined

   Circuit ID format-type: ASCII

   Remote ID format-type: ASCII

   User defined:

   Circuit ID: vlan100

   Remote ID: device001

Table 4 Command output

Field

Description

 

Interface

Interface name.

 

Status

Option 82 states:

·     Enable—DHCP relay agent support for Option 82 is enabled.

·     Disable—DHCP relay agent support for Option 82 is disabled.

Strategy

Handling strategy for request messages containing Option 82, Drop, Keep, or Replace.

Circuit ID Pattern

Padding content mode of the Circuit ID sub-option, Verbose, Normal, SRv6-opcode, or User Defined.

Remote ID Pattern

Padding content mode of the Remote ID sub-option, Sysname, Normal, or User Defined.

Circuit ID format-type

Padding format of the Circuit ID sub-option, ASCII, Hex, or Undefined.

Remote ID format-type

Padding format of the Remote ID sub-option, ASCII, Hex, or Undefined.

Node identifier

Access node identifier.

User defined

Content of the user-defined sub-options.

Circuit ID

User-defined content of the Circuit ID sub-option.

Remote ID

User-defined content of the Remote ID sub-option.

 

display dhcp relay server-address

Use display dhcp relay server-address to display DHCP server addresses configured on an interface.

Syntax

display dhcp relay server-address [ interface interface-type interface-number ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

interface interface-type interface-number: Displays DHCP server addresses on the specified interface. If you do not specify an interface, this command displays DHCP server addresses on all interfaces.

Examples

# Display DHCP server addresses on all interfaces.

<Sysname> display dhcp relay server-address

Interface name                 Server IP address

Vlan2                          2.2.2.2

# Display DHCP server addresses on VLAN-interface 2.

<Sysname> display dhcp relay server-address interface vlan-interface 2

Active server address: 2.2.2.2

Interface name                 Server IP address

Vlan2                          2.2.2.2

Table 5 Command output

Field

Description

Active server address

Active DHCP server address. The displayed value depends on the DHCP server selecting algorithm configuration.

·     If the polling algorithm is used, this field displays all. The DHCP relay agent forwards DHCP requests to all DHCP servers.

·     If the master-backup algorithm is used, this field displays the IP address of the active DHCP server. The DHCP relay agent forwards DHCP requests to the master DHCP server first.

Interface name

Interface name.

Server IP address

DHCP server IP address.

 

Related commands

dhcp relay server-address

display dhcp relay statistics

Use display dhcp relay statistics to display DHCP packet statistics on the DHCP relay agent.

Syntax

display dhcp relay statistics [ interface interface-type interface-number ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

interface interface-type interface-number: Displays DHCP packet statistics on the specified interface. If you do not specify an interface, this command displays all DHCP packet statistics on the DHCP relay agent.

Examples

# Display all DHCP packet statistics on the DHCP relay agent.

<Sysname> display dhcp relay statistics

DHCP packets dropped:                  0

DHCP packets received from clients:    0

   DHCPDISCOVER:                       0

   DHCPREQUEST:                        0

   DHCPINFORM:                         0

   DHCPRELEASE:                        0

   DHCPDECLINE:                        0

   BOOTPREQUEST:                       0

DHCP packets received from servers:    0

   DHCPOFFER:                          0

   DHCPACK:                            0

   DHCPNAK:                            0

   BOOTPREPLY:                         0

DHCP packets relayed to servers:       0

   DHCPDISCOVER:                       0

   DHCPREQUEST:                        0

   DHCPINFORM:                         0

   DHCPRELEASE:                        0

   DHCPDECLINE:                        0

   BOOTPREQUEST:                       0

DHCP packets relayed to clients:       0

   DHCPOFFER:                          0

   DHCPACK:                            0

   DHCPNAK:                            0

   BOOTPREPLY:                         0

DHCP packets sent to servers:          0

   DHCPDISCOVER:                       0

   DHCPREQUEST:                        0

   DHCPINFORM:                         0

   DHCPRELEASE:                        0

   DHCPDECLINE:                        0

   BOOTPREQUEST:                       0

DHCP packets sent to clients:          0

   DHCPOFFER:                          0

   DHCPACK:                            0

   DHCPNAK:                            0

   BOOTPREPLY:                         0

Related commands

reset dhcp relay statistics

gateway-list

Use gateway-list to specify gateway addresses for DHCP clients in a DHCP address pool.

Use undo gateway-list to remove gateway addresses from a DHCP address pool.

Syntax

gateway-list ip-address&<1-64> [ export-route ]

undo gateway-list [ ip-address&<1-64> ] [ export-route ]

Default

No gateway address is specified in a DHCP address pool.

Views

DHCP address pool view

Predefined user roles

network-admin

Parameters

ip-address&<1-64>: Specifies a space-separated list of up to 64 addresses.

export-route: Binds the gateways to the device's MAC address in the address management module. The ARP module will use the entries to reply to ARP requests from the DHCP clients. If you do not specify this keyword, the gateways will not be bound to the device's MAC address.

Usage guidelines

DHCP clients of the same access type can be 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:

1.     Fills the giaddr field of the packet with a specified gateway address.

2.     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.

Examples

# Specify gateway address 10.1.1.1 in DHCP address pool 0.

<Sysname> system-view

[Sysname] dhcp server ip-pool 0

[Sysname-dhcp-pool-0] gateway-list 10.1.1.1

Related commands

dhcp smart-relay enable

master-server switch-delay

Use master-server switch-delay to enable the switchback to the master DHCP server and set the switchback delay time.

Use undo master-server switch-delay to restore the default.

Syntax

master-server switch-delay delay-time

undo master-server switch-delay

Default

The DHCP relay agent does not switch back to the master DHCP server.

Views

DHCP address pool view

Predefined user roles

network-admin

Parameters

delay-time: Specifies the delay time in the range of 1 to 65535 minutes.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

Examples

# Configure the DHCP relay agent to switch back to the master DHCP server 3 minutes after it switches to a backup DHCP server in DHCP address pool 0.

<Sysname> system-view

[Sysname] dhcp server ip-pool 0

[Sysname-dhcp-pool-0] master-server switch-delay 3

Related commands

remote-server algorithm

remote-server

Use remote-server to specify DHCP servers for a DHCP address pool.

Use undo remote-server to remove DHCP servers from a DHCP address pool.

Syntax

remote-server ip-address&<1-8>

undo remote-server [ ip-address&<1-8> ]

Default

No DHCP server is specified for the DHCP address pool.

Views

DHCP address pool view

Predefined user roles

network-admin

Parameters

ip-address&<1-8>: Specifies a space-separated list of up to eight DHCP server addresses.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

If you do not specify a DHCP server address, the undo remote-server command removes all DHCP servers in the DHCP address pool.

Examples

# Specify DHCP server 10.1.1.1 for DHCP address pool 0.

<Sysname> system-view

[Sysname] dhcp server ip-pool 0

[Sysname-dhcp-pool-0] remote-server 10.1.1.1

remote-server algorithm

Use remote-server algorithm to specify the DHCP server selecting algorithm.

Use undo remote-server algorithm to restore the default.

Syntax

remote-server algorithm { master-backup | polling }

undo remote-server algorithm

Default

The polling algorithm is used. The DHCP relay agent forwards DHCP requests to all DHCP servers at the same time.

Views

DHCP address pool view

Predefined user roles

network-admin

Parameters

master-backup: Forwards DHCP requests to the master DHCP server first. If the master server is not available or does not have assignable IP addresses, the relay agent forwards DHCP requests to backup DHCP servers in the order they are specified.

polling: Forwards DHCP requests to all DHCP servers at the same time.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

Examples

# Specify master-backup as the DHCP server selecting algorithm in DHCP address pool 0.

<Sysname> system-view

[Sysname] dhcp server ip-pool 0

[Sysname-dhcp-pool-0] remote-server algorithm master-backup

Related commands

dhcp relay server-address algorithm

dhcp-server timeout

master-server switch-delay

remote-server

reset dhcp relay client-information

Use reset dhcp relay client-information to clear relay entries on the DHCP relay agent.

Syntax

reset dhcp relay client-information [ interface interface-type interface-number | ip ip-address [ vpn-instance vpn-instance-name ] ]

Views

User view

Predefined user roles

network-admin

Parameters

interface interface-type interface-number: Clears relay entries on the specified interface. If you do not specify an interface, this command clears relay entries on all interfaces.

ip ip-address: Clears the relay entry for the specified IP address. If you do not specify an IP address, this command clears relay entries for all IP addresses.

vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the specified IP address belongs. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command clears the relay entry for the specified IP address on the public network.

Examples

# Clear all relay entries on the DHCP relay agent.

<Sysname> reset dhcp relay client-information

Related commands

display dhcp relay client-information

reset dhcp relay statistics

Use reset dhcp relay statistics to clear relay agent statistics.

Syntax

reset dhcp relay statistics [ interface interface-type interface-number ]

Views

User view

Predefined user roles

network-admin

Parameters

interface interface-type interface-number: Specifies an interface by its type and number. If you do not specify an interface, this command clears all DHCP relay agent statistics.

Examples

# Clear all DHCP relay agent statistics.

<Sysname> reset dhcp relay statistics

Related commands

display dhcp relay statistics

DHCP client commands

dhcp client dad enable

Use dhcp client dad enable to enable duplicate address detection.

Use undo dhcp client dad enable to disable duplicate address detection.

Syntax

dhcp client dad enable

undo dhcp client dad enable

Default

Duplicate address detection is enabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

DHCP client detects IP address conflict through ARP packets. An attacker can act as the IP address owner to send an ARP reply. This 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.

Examples

# Disable the duplicate address.

<Sysname> system-view

[Sysname] undo dhcp client dad enable

dhcp client dscp

Use dhcp client dscp to set the DSCP value for DHCP packets sent by the DHCP client.

Use undo dhcp client dscp to restore the default.

Syntax

dhcp client dscp dscp-value

undo dhcp client dscp

Default

The DSCP value is 56 in DHCP packets sent by the DHCP client.

Views

System view

Predefined user roles

network-admin

Parameters

dscp-value: Sets the DSCP value for DHCP packets, in the range of 0 to 63.

Usage guidelines

The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. A bigger DSCP value represents a higher priority.

Examples

# Set the DSCP value to 30 for DHCP packets sent by the DHCP client.

<Sysname> system-view

[Sysname] dhcp client dscp 30

dhcp client identifier

Use dhcp client identifier to configure a DHCP client ID for an interface.

Use undo dhcp client identifier to restore the default.

Syntax

dhcp client identifier { ascii ascii-string | hex hex-string | mac interface-type interface-number }

undo dhcp client identifier

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.

Views

Interface view

Predefined user roles

network-admin

Parameters

ascii ascii-string: Specifies a case-sensitive ASCII string of 1 to 63 characters as the client ID.

hex hex-string: Specifies a hexadecimal number of 4 to 64 characters as the client ID.

mac interface-type interface-number: Uses the MAC address of the specified interface as a DHCP client ID. The interface-type interface-number argument specifies an interface by its type and number.

Usage guidelines

A DHCP client ID is added to the DHCP option 61. A DHCP server can specify IP addresses for clients based on the DHCP client ID. You can specify a DHCP client ID by performing one of the following operations:

·     Naming an ASCII string or hexadecimal number as the client ID.

·     Using the MAC address of an interface to generate a client ID.

Whichever method you use, make sure the IDs for different DHCP clients are unique.

Examples

# Use a hexadecimal number of FFFFFFFF as the client ID for VLAN-interface 10.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] dhcp client identifier hex FFFFFFFF

Related commands

display dhcp client

display dhcp client

Use display dhcp client to display DHCP client information.

Syntax

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

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

verbose: Displays detailed DHCP client information. If you do not specify this keyword, the command displays brief DHCP client information.

interface interface-type interface-number: Specifies an interface by its type and number. If you do not specify an interface, this command displays DHCP client information on all interfaces.

Examples

# Display brief DHCP client information on all interfaces.

<Sysname> display dhcp client

Vlan-interface10 DHCP client information:

 Current state: BOUND

 Allocated IP: 40.1.1.20 255.255.255.0

 Allocated lease: 259200 seconds, T1: 129600 seconds, T2: 226800 seconds

 DHCP server: 40.1.1.2

# Display detailed DHCP client information on all interfaces.

<Sysname> display dhcp client verbose

Vlan-interface10 DHCP client information:

 Current state: BOUND

 Allocated IP: 40.1.1.20 255.255.255.0

 Allocated lease: 259200 seconds, T1: 129600 seconds, T2: 226800 seconds

 Lease from May 21 19:00:29 2012   to   May 31 19:00:29 2012

 DHCP server: 40.1.1.2

 Transaction ID: 0x1c09322d

 Default router: 40.1.1.2

 Classless static routes:

   Destination: 1.1.0.1, Mask: 255.0.0.0, NextHop: 192.168.40.16

   Destination: 10.198.122.63, Mask: 255.255.255.255, NextHop: 192.168.40.16

 DNS servers: 44.1.1.11 44.1.1.12

 Domain name: ddd.com

 Boot servers: 200.200.200.200  1.1.1.1

 ACS parameter:

   URL: http://192.168.1.1:7547/acs

   Username: bims

   Password: ******

 Client ID type: acsii(type value=00)

 Client ID value: 000c.29d3.8659-Vlan10

 Client ID (with type) hex: 0030-3030-632e-3239-

                            6433-2e38-3635-392d-

                            4574-6830-2f30-2f32

 T1 will timeout in 1 day 11 hours 58 minutes 52 seconds.

Table 6 Command output

Field

Description

DHCP client information

Information about the interface that acts as the DHCP client.

Current state

Current state of the DHCP client:

·     HALT—The client stops applying for an IP address.

·     INIT—The initialization state.

·     SELECTING—The client has sent out a DHCP-DISCOVER message in search for a DHCP server and is waiting for the response from DHCP servers.

·     REQUESTING—The client has sent out a DHCP-REQUEST message requesting for an IP address and is waiting for the response from DHCP servers.

·     BOUND—The client has received the DHCP-ACK message from a DHCP server and obtained an IP address successfully.

·     RENEWING—The T1 timer expires.

·     REBOUNDING—The T2 timer expires.

Allocated IP

IP address allocated by the DHCP server.

Allocated lease

Allocated lease time.

T1

1/2 lease time (in seconds) of the DHCP client IP address.

T2

7/8 lease time (in seconds) of the DHCP client IP address.

Lease from….to….

Start and end time of the lease.

DHCP server

DHCP server IP address that assigned the IP address.

Transaction ID

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

Default router

Gateway address assigned to the client.

Classless static routes

Classless static routes assigned to the client.

Static routes

Classful static routes assigned to the client.

DNS servers

This field is not supported in the current software version.

DNS server address assigned to the client.

Domain name

Domain name suffix assigned to the client.

Boot servers

PXE server addresses (up to 16 addresses) specified for the DHCP client, which are obtained through Option 43.

ACS parameter

Parameters about the ACS.

URL

URL of the ACS.

Username

Username for logging in to the ACS.

Password

Password for logging in to the ACS. If a password is configured, this field displays ******. If no password is configured, this field is not displayed.

Client ID type

DHCP client ID type:

·     If an ASCII string is used as the client ID value, the type value is 00.

·     If the MAC address of a specific interface is used as the client ID value, the type value is 01.

·     If a hexadecimal number is used as the client ID value, the type value is the first two characters in the string.

Client ID value

Value of the DHCP client ID.

Client ID (with type) hex

DHCP client ID with the type field, a hexadecimal number.

T1 will timeout in 1 day 11 hours 58 minutes 52 seconds.

How long the T1 (1/2 lease time) timer will timeout.

 

Related commands

dhcp client identifier

ip address dhcp-alloc

ip address dhcp-alloc

Use ip address dhcp-alloc to configure an interface to use DHCP for IP address acquisition.

Use undo ip address dhcp-alloc to cancel an interface from using DHCP.

Syntax

ip address dhcp-alloc

undo ip address dhcp-alloc

Default

An interface does not use DHCP for IP address acquisition.

Views

Interface view

Predefined user roles

network-admin

Usage guidelines

When you execute the undo ip address dhcp-alloc command, the interface sends a DHCP-RELEASE message to release the IP address obtained through DHCP. If the interface is down, the message cannot be sent out. This situation can occur when a subinterface obtained an IP address through DHCP, and the shutdown command is executed on its primary interface. The subinterface will fail to send a DHCP-RELEASE message.

Examples

# Configure VLAN-interface 10 to use DHCP for IP address acquisition.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] ip address dhcp-alloc

BOOTP client commands

display bootp client

Use display bootp client to display information about a BOOTP client.

Syntax

display bootp client [ interface interface-type interface-number ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

interface interface-type interface-number: Specifies an interface by its type and number. If you do not specify an interface, this command displays BOOTP client information on all interfaces.

Examples

# Display BOOTP client information on VLAN-interface 10.

<Sysname> display bootp client interface vlan-interface 10

Vlan-interface10 BOOTP client information:

Allocated IP: 169.254.0.2 255.255.0.0

Transaction ID: 0x3d8a7431

MAC Address: 00e0-fc0a-c3ef

Table 7 Command output

Field

Description

BOOTP client information

Information about the interface that acts as a BOOTP client.

Allocated IP

BOOTP client's IP address allocated by the BOOTP server.

Transaction ID

Value of the XID field in a BOOTP message. The BOOTP client chooses a random number for the XID field when sending a BOOTP request to the BOOTP server. It is used to match a response message from the BOOTP server. If the values of the XID field are different in the BOOTP response and request, the BOOTP client drops the BOOTP response.

Mac Address

MAC address of a BOOTP client.

 

Related commands

ip address bootp-alloc

ip address bootp-alloc

Use ip address bootp-alloc to configure an interface to use BOOTP for IP address acquisition.

Use undo ip address bootp-alloc to cancel an interface from using BOOTP.

Syntax

ip address bootp-alloc

undo ip address bootp-alloc

Default

An interface does not use BOOTP for IP address acquisition.

Views

Interface view

Predefined user roles

network-admin

Examples

# Configure VLAN-interface 10 to use BOOTP for IP address acquisition.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] ip address bootp-alloc

Related commands

display bootp client

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
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
新华三官网