l
The DHCP relay agent configuration is supported
only on VLAN interfaces.
l
DHCP Snooping cannot be configured on the DHCP
relay agent.
1.1.1 dhcp
enable
Syntax
dhcp enable
undo dhcp enable
View
System view
Parameter
None
Description
Use the dhcp enable command to
enable DHCP.
Use the undo dhcp enable command to
disable DHCP.
By default, DHCP is disabled.
For DHCP relay
agent configuration, enabling DHCP first is necessary to make other
configurations take effect.
Example
# Enable DHCP.
<Sysname> system-view
[Sysname] dhcp enable
Syntax
dhcp relay address-check { disable | enable }
View
VLAN Interface view
Parameter
disable:
Disables IP address match checking on the relay agent.
enable:
Enables IP address match checking on the relay agent.
Description
Use the dhcp relay address-check enable
command to enable IP address match checking on the relay agent.
Use the dhcp relay address-check disable
command to disable IP address match checking on the relay agent.
By default, the function is disabled.
Example
# Enable IP address match checking on the
DHCP relay agent.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp relay
address-check enable
Syntax
dhcp relay information enable
undo dhcp relay information enable
View
VLAN Interface view
Parameter
None
Description
Use the dhcp relay information enable
command to enable the relay agent to support option 82.
Use the undo dhcp relay information
enable command to disable option 82 support.
By default, option 82 support is disabled
on DHCP relay agent.
Example
# Enable option 82 support on the relay agent.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp relay
information enable
Syntax
dhcp relay information format { normal | verbose [ node-identifier { mac |
sysname | user-defined node-identifier } ] }
undo dhcp relay information format [ verbose node-identifier ]
View
VLAN Interface view
Parameter
normal:
Specifies the normal padding format.
verbose:
Specifies the verbose padding format.
node-identifier { mac | sysname | user-defined node-identifier
}: Specifies access node identifier, mac indicates using MAC address as
the node identifier, sysname indicates using node name as the node
identifier, user-defined node-identifier indicates using a
specified character string as the node identifier, in which node-identifier
is a string with 1 to 50 characters.
Description
Use the dhcp relay information format
command to specify a padding format for option 82.
Use the undo dhcp relay information
format command to restore the default padding format.
The option
82 padding format defaults to normal.
l
Using the undo dhcp relay information format
command without the keyword verbose node-identifier restores the
default normal padding format, or with the keyword verbose node-identifier
restores the mac mode of the verbose padding format.
l
If configuring the handling strategy of the DHCP
relay agent as replace, you need to configure a padding format of option 82. If
the handling strategy is keep or drop, you need not configure any padding format.
Example
# Specify the normal padding format for
option 82.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp relay
information strategy replace
[Sysname-Vlan-interface1] dhcp relay
information format normal
1.1.5 dhcp relay information strategy
Syntax
dhcp relay information strategy { drop | keep | replace }
undo dhcp relay information strategy
View
Interface view
Parameter
drop:
Specifies to drop messages containing option 82.
keep:
Specifies to forward messages containing option 82 without any change.
replace:
Specifies to forward messages containing option 82 after replacing the original
option 82 with the option 82 padded by specified padding format.
Description
Use the dhcp relay information strategy
command to configure DHCP relay agent handling strategy for messages containing
option 82.
Use the undo dhcp relay information
strategy command to restore the default handling strategy.
The handling strategy for messages
containing option 82 defaults to replace.
Example
# Configure the DHCP relay agent handling
strategy for messages containing option 82 as keep.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp relay
information strategy keep
1.1.6 dhcp relay release
Syntax
dhcp relay release client-ip client-mac [ server-ip ]
View
System view/VLAN Interface view
Parameter
client-ip:
DHCP client IP address.
client-mac:
DHCP client MAC address in the format H-H-H.
server-ip:
DHCP server IP address.
Description
Use the dhcp relay release command
to send a DHCP-RELEASE request to a specified DHCP server or server groups for
releasing a specified client IP address.
If the server-ip is not specified in
system view, the relay agent will send the DHCP-RELEASE request to DHCP server
groups corresponding to all interfaces working in DHCP relay agent mode; if the
server-ip is not specified in interface view, the relay agent will send
the DHCP-RELEASE request to the DHCP server group corresponding to the current
interface.
If a server-ip is specified, the
relay agent will send the DHCP-RELEASE request to the specified DHCP server.
Example
# Send a DHCP-RELEASE request to the DHCP
server correlated to the interface VLAN interface1 for releasing the IP address
1.1.1.1 that was obtained by the client whose MAC is 00e0-0000-0001.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp relay
release 1.1.1.1 00e0-0000-0001
# Send a DHCP-RELEASE request to all
correlated DHCP servers for releasing the IP address 1.1.1.1 that was obtained
by the client whose MAC is 00e0-0000-0001.
<Sysname> system-view
[Sysname] dhcp relay release 1.1.1.1
00e0-0000-0001
1.1.7 dhcp relay security static
Syntax
dhcp relay security static ip-address mac-address
undo dhcp relay security { ip-address | all | dynamic | static }
View
System view
Parameter
ip-address:
Specifies a client IP address for creating a static binding.
mac-address:
Specifies a client MAC address for creating a static binding, in the format
H-H-H.
all:
Specifies all entries of client IP-to-MAC bindings.
dynamic:
Specifies entries of dynamic client IP-to-MAC bindings.
static:
Specifies entries of manual client IP-to-MAC bindings.
Description
Use the dhcp relay security static
command to configure a manual IP-to-MAC binding on the relay agent.
Use the undo dhcp relay security
command to remove specified entries of client IP-to-MAC bindings from the relay
agent.
No manual IP-to-MAC binding is configured
by default.
Related command: display dhcp relay security.
Example
# Configure a static mapping between IP
address 1.1.1.1 to MAC address 0005-5d02-f2b3.
[Sysname] dhcp relay security static 1.1.1.1
0005-5d02-f2b3
Syntax
dhcp relay security tracker { interval | auto }
undo dhcp relay security tracker [ interval ]
View
System view
Parameter
interval:
Sets a refreshing interval value a string of 1 to 120 seconds.
auto: Specifies
the auto refreshing interval, which is the value of 60 seconds divided
by the number of binding entries. Thus, the more entries are, the shorter
interval is, but the shortest interval is no less than 500 ms.
Description
Use the dhcp relay security tracker
command to set a refreshing interval at which the relay agent contacts the DHCP
server for refreshing dynamic bindings.
Use the undo dhcp relay security tracker
command to restore the default interval.
The default handshake interval is auto,
the value of 60 seconds divided by the number of binding entries.
Example
# Set the handshake interval as 100
seconds.
<Sysname> system-view
[Sysname] dhcp relay security tracker
100
Syntax
dhcp relay server-detect
undo dhcp relay server-detect
View
System view
Parameter
None
Description
Use the dhcp relay server-detect
command to enable pseudo DHCP server detection on the DCHP relay agent.
Use the undo dhcp relay server-detect
command to disable pseudo DHCP server detection.
By default, pseudo DHCP server detection is
disabled.
Example
# Enable pseudo DHCP server detection on
the DCHP relay agent.
<Sysname> system-view
[Sysname] dhcp relay server-detect
Syntax
dhcp relay server-group group- ip ip-address
undo dhcp relay server-group group-id [ ip ip-address ]
View
System view
Parameter
group-id:
Specifies a DHCP server group number, a string of 0 to 19.
ip-address:
Specifies a DHCP server IP address.
Description
Use the dhcp relay server-group
command to specify a DHCP server for a DHCP server group.
Use the undo dhcp relay server-group
command to remove a DHCP server from a DHCP server group, if no ip ip-address
is specified, all servers in the DHCP server group and the server group itself
will be removed.
By default, no DHCP server is specified for
a DHCP server group.
Note that:
l
You can specify up to twenty DHCP server groups
on the relay agent.
l
You can configure up to eight DHCP servers for a
server group.
l
The IP address of any DHCP server in a DHCP
server group cannot be on the same network segment with the IP address of any
interface used by the DHCP relay agent to connect to a client; otherwise, the
client may not be able to obtain an IP address.
l
If a DHCP server group has been associated with some
interfaces, you must remove these associations before you can delete the DHCP
server group.
Related command: display dhcp relay
server-group.
Example
# Specify DHCP server 1.1.1.1 for DHCP
server group 1 on the relay agent.
<Sysname> system-view
[Sysname] dhcp relay server-group 1 ip
1.1.1.1
Syntax
dhcp relay server-select group-id
undo dhcp relay server-select
View
VLAN interface view
Parameter
group-id: Specifies
a DHCP group number to be correlated, a string of 0 to 19. The specified group
must be an existing group containing at least a DHCP server.
Description
Use the dhcp relay server-select
command to correlate specified interface(s) to a specified DHCP server group.
Use the undo dhcp relay server-select
command to remove a configured correlation.
By default, no correlation is configured
for an interface on the relay agent.
Note that an interface on the relay agent
can only be correlated to one DHCP server group, and a newly configured
correlation overwrites the previous one. If the server group in the new
correlation does not exist, the new configuration will not work. The interface
still maintains the previous correlation.
Example
# Correlate VLAN interface 1 to DHCP server
group 1.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp relay
server-select 1
Syntax
dhcp select relay
undo dhcp select relay
View
VLAN interface view
Parameter
None
Description
Use the dhcp select relay
command to enable the relay agent on the current interface, specified or all
interfaces. Upon receiving requests from an enabled interface, the relay agent
will forward these requests to outside DHCP servers for IP address allocation.
Use the undo dhcp select relay
command to restore the default on interface(s).
By default, an interface does not operate
in any DHCP mode.
Example
# Enable the DHCP relay agent on the
interface VLAN interface1.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp select
relay
Syntax
display dhcp relay { all | interface interface-type interface-number
}
View
Any view
Parameter
all:
Specifies all interfaces correlated to which to display information about DHCP
server groups.
interface interface-type
interface-number: Specifies an interface correlated to which to display
information about DHCP server groups.
Description
Use the display dhcp relay command
to display information about DHCP server groups correlated to an interface or
all interfaces.
Example
# Display information about DHCP server
groups correlated to all interfaces.
<Sysname> display dhcp relay
all
Interface name
Server-group
Vlan-interface2 2
Table 1-1 Description on fields of the display
dhcp relay all command
|
Field
|
Description
|
|
Interface
name
|
Interface name
|
|
Server-group
|
DHCP server group number correlated to
the interface.
|
Syntax
display dhcp relay security [ ip-address | dynamic | static ]
View
Any view
Parameter
ip-address:
Displays the binding information of an IP address.
dynamic: Displays
information about dynamic bindings.
static:
Displays information about static bindings.
Description
Use the display dhcp relay security
command to display information about bindings of DHCP relay agents. If no
parameter is specified, information about all bindings will be displayed.
Example
# Display information about all bindings.
[Sysname] display dhcp relay security
IP Address MAC Address Type
10.1.1.1 00e0-0000-0001
Static
10.1.1.5 00e0-0000-0000
Static
--- 2 dhcp-security item(s) found
---
Table 1-2 Description on fields of the display
dhcp relay security command
|
Field
|
Description
|
|
IP Address
|
Client IP address
|
|
MAC
Address
|
Client MAC address
|
|
Type
|
Type of binding, including dynamic and
static
|
Syntax
display dhcp relay security statistics
View
Any view
Parameter
None
Description
Use the display dhcp relay security statistics
command to display statistics information about bindings of DHCP relay agents.
Example
# Display statistics about client address
binding entries.
<Sysname> display dhcp relay
security statistics
Static Items :0
Dynamic Items :0
Temporary Items :0
All Items :0
Table 1-3 Description on fields of display
dhcp relay security statistics
|
Field
|
Description
|
|
Static
Items
|
Static client address binding items
|
|
Dynamic
Items
|
Dynamic client address binding items
|
|
Temporary
Items
|
Temporary client address binding items
|
|
All Items
|
All client address binding items
|
Syntax
display dhcp relay security tracker
View
Any view
Parameter
None
Description
Use the display dhcp relay security tracker
command to display the interval for refreshing dynamic bindings on the relay agent.
Example
# Display the interval for refreshing
dynamic bindings on the relay agent.
[Sysname] display dhcp relay security
tracker
Current tracker interval: 10s
(Specified by user)
The interval is 10 seconds.
Syntax
display dhcp relay server-group { group-id | all }
View
Any view
Parameter
group-id: Displays
the information of the specified DHCP server group numbered from 0 to 19.
all: Displays
the information of all DHCP server groups.
Description
Use the display dhcp relay server-group
command to display the configuration information of a specified or all DHCP
server groups.
Example
# Display IP addresses of DHCP servers in
DHCP server group 1.
<Sysname> display dhcp relay server-group
1
No. Group IP
1 1.1.1.1
2 1.1.1.2
Table 1-4 Description on fields of the display
dhcp relay server-group command
|
Field
|
Description
|
|
No.
|
Sequence number
|
|
Group IP
|
IP address in the server group
|
Syntax
display dhcp relay statistics [ server-group { group-id | all } ]
View
Any view
Parameter
group-id:
Specifies a server group number a string of 0 to 19 about which to display DHCP
packet statistics.
all:
Specifies all server groups about which to display DHCP packet statistics. Information
for each group will be displayed.
Description
Use the display dhcp relay statistics
command to display DHCP packet statistics related to a specified or all DHCP
server groups.
Note that if no parameter (server-group and
all) is specified, all DHCP packet statistics on the relay agent will be
displayed.
Example
# Display all DHCP packet statistics on the
relay agent.
<Sysname> display dhcp relay statistics
Bad packets received: 0
DHCP packets received from
clients: 20
DHCPDISCOVER packets
received: 10
DHCPREQUEST packets
received: 10
DHCPINFORM packets received: 0
DHCPRELEASE packets
received: 0
DHCPDECLINE packets
received: 0
BOOTPREQUEST packets: 0
DHCP packets received from
servers: 20
DHCPOFFER packets received: 10
DHCPACK packets received: 10
DHCPNAK packets received: 0
BOOTPREPLY packets: 0
DHCP packets relay to servers:
0
DHCPDISCOVER packets
relayed: 0
DHCPREQUEST packets
relayed: 0
DHCPINFORM packets
relayed: 0
DHCPRELEASE packets
relayed: 0
DHCPDECLINE packets
relayed: 0
BOOTPREQUEST packets
relayed: 0
DHCP packets relay to
clients: 0
DHCPOFFER packets
relayed: 0
DHCPACK packets
relayed: 0
DHCPNAK packets
relayed: 0
BOOTPREPLY packets
relayed: 0
DHCP packets send to
servers: 0
DHCPDISCOVER packets sended:
0
DHCPREQUEST packets sended:
0
DHCPINFORM packets sended:
0
DHCPRELEASE packets sended:
0
DHCPDECLINE packets sended:
0
BOOTPREQUEST packets sended:
0
DHCP packets send to
clients: 0
DHCPOFFER packets sended:
0
DHCPACK packets sended:
0
DHCPNAK packets sended:
0
BOOTPREPLY packets sended:
0
# Display DHCP packet statistics related to
every server group on the relay agent.
<Sysname> display dhcp relay
statistics server-group all
DHCP relay server-group #2
Packet type Packet
number
Client -> Server:
DHCPDISCOVER 5
DHCPREQUEST 5
DHCPINFORM 0
DHCPRELEASE 0
DHCPDECLINE 0
BOOTPREQUEST 0
Server -> Client:
DHCPOFFER 5
DHCPACK 5
DHCPNAK 0
BOOTPREPLY 0
DHCP
relay server-group #3
Packet type Packet number
Client -> Server:
DHCPDISCOVER 5
DHCPREQUEST 5
DHCPINFORM 0
DHCPRELEASE 0
DHCPDECLINE 0
BOOTPREQUEST 0
Server -> Client:
DHCPOFFER 5
DHCPACK 5
DHCPNAK 0
BOOTPREPLY 0
1.1.19 reset dhcp relay statistics
Syntax
reset dhcp relay statistics [ server-group group-id ]
View
User view
Parameter
server-group group-id: Specifies a server group
number a string of 0 to 19 about which to remove statistics from the relay
agent.
Description
Use the reset dhcp relay statistics
command to remove statistics from the relay agent.
If no server-group is specified, all
statistics will be removed from the relay agent.
Related command: display dhcp relay
statistics.
Example
# Remove all statistics from the DHCP relay
agent.
<Sysname> reset dhcp relay statistics