Dynamic Host Configuration Protocol Relay
This chapter describes the Dynamic Host Configuration Protocol (DHCP) relay commands.
In small networks with only one IP subnet, DHCP clients communicate directly with DHCP servers. When DHCP clients and associated servers do not reside on the same subnet, a DHCP relay agent can forward DHCP client messages to a DHCP server.
The DHCP client broadcasts on the local link, the relay agents receive the broadcast DHCP messages, and then generates a new DHCP message to send out on another interface.
The relay agent sets the gateway IP address (giaddr field of the DHCP packet) and, if configured, adds the relay agent information option (option 82) to the packet and forwards it to the DHCP server. The DHCP server replies to the client and the relay agent then retransmits the response on the local network.
This chapter contains these commands:
clear ip dhcp relay option statistics
Use this command to clear ipv4 relay option statistics.
command syntax
clear ip dhcp relay option statistics
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced in OcNOS version 1.3.9.
Examples
OcNOS#clear ip dhcp relay option statistics
clear ip dhcp relay statistics
Use this command to clear ipv4 relay statistics.
Command syntax
clear ip dhcp relay statistics
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced in OcNOS version 1.3.9.
Examples
OcNOS#clear ip dhcp relay statistics
ip dhcp relay (configure mode)
Use this command to enable the DHCP relay agent. The DHCP relay starts forwarding packets to the DHCP server address once configured.
Use the no form of this command to disable the DHCP relay agent.
Command Syntax
ip dhcp relay
no ip dhcp relay
Parameters
None
Default
By default, this feature is enabled.
Command Mode
Configure mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
#configure terminal
(config)#ip dhcp relay
#configure terminal
(config)#no ip dhcp relay
ip dhcp relay (interface mode)
Use this command to configure an interface as a DHCP client-facing port.
Use the no form of this command to remove an interface as a DHCP client-facing port.
Command Syntax
ip dhcp relay
no ip dhcp relay
Parameters
None
Default
By default, this feature is enabled
Command Mode
Interface mode
Applicability
This command was introduced in OcNOS version 1.3.8.
Examples
#configure terminal
(config)#interface eth1
(config-if)#ip dhcp relay
ip dhcp relay address
Use this command to set an IPv4 address of a DHCP server to which a DHCP relay agent forwards client requests.
Use the no form of this command to remove the IP address of a DHCP server.
You must enable the DHCP relay feature with the
ip dhcp relay (configure mode) command before you give this command.
Command Syntax
ip dhcp relay address A.B.C.D
no ip dhcp relay address A.B.C.D
Parameters
A.B.C.D
IPv4 address of the DHCP server
Default
No default value is specified
Command Mode
Configure mode
VRF mode
Applicability
This command was introduced before OcNOS version 1.3 and was changed in OcNOS version 1.3.8.
Examples
#configure terminal
(config)#ip vrf vrf1
(config-vrf)#ip dhcp relay address 198.51.100.127
#configure terminal
(config)#ip dhcp relay address 198.51.100.127
ip dhcp relay address global
When the IPv4 DHCP server resides in a different VPN or global space that is different from the VPN, then use this command to specify the name of the VRF or global space in which the DHCP server resides.
Use the no form of this command to remove the VRF in which IPv4 DHCP server resides.
Command Syntax
ip dhcp relay address A.B.C.D global (|VRF-NAME)
no ip dhcp relay address A.B.C.D global
Parameters
A.B.C.D
IPv4 address of the DHCP server
VRF-NAME
Name of VRF where the DHCP server is present
Default
If no input given, default VRF is the default Value.
Command Mode
Configure mode
VRF mode
Applicability
This command was introduced in OcNOS-DC version 5.1.
Examples
#configure terminal
(config)#ip vrf vrf1
(config-vrf)#ip dhcp relay address 198.51.100.127 global
#configure terminal
(config)#ip dhcp relay address 198.51.100.127 global vrf1
ip dhcp relay information option
Use this command to enable the device to insert and remove option 82 information in DHCP packets forwarded by the relay agent.
The option 82 suboption remote-id can be configured either as hostname or any string you provide.
Use the no form of this command to disable inserting and removing option-82 information.
Command Syntax
ip dhcp relay information option (|remote-id (hostname|WORD))
no ip dhcp relay information option (|remote-id)
Parameters
remote-id
Remote host Identifier, either the system hostname or a user-specified string.
hostname
Name of the host
WORD
Specify a string as remote-id(Maximum 255 alphanumeric characters)
Default
No default value is specified
Command Mode
Configure mode
VRF mode
Applicability
This command was introduced before OcNOS version 1.3 and was changed in OcNOS version 1.3.8.
Examples
#configure terminal
(config)#ip vrf vrf1
(config-vrf)#ip dhcp relay information option remote-id hostname
#configure terminal
(config)#ip dhcp relay information option
#configure terminal
(config)#no ip dhcp relay information option
ip dhcp relay information option always-on
Use this command to enable the device to insert options 82 information in DHCP packets forwarded by the relay-agent and keep them while forwarding to client.
Use the no form of this command to disable the option-82 always-on information.
Command Syntax
ip dhcp relay information option always-on
no ip dhcp relay information option always-on
Parameters
None
Default
No default value is specified
Command Mode
Configure mode
VRF mode
Applicability
This command was introduced before OcNOS version 1.3 and was changed in OcNOS version 6.2.0.
Examples
#configure terminal
(config)#ip vrf vrf1
(config-vrf)#ip dhcp relay information option always-on
#configure terminal
(config)#ip dhcp relay information option always-on
#configure terminal
(config)#no ip dhcp relay information option always-on
ip dhcp relay information source-ip
Use this command to enable DHCP relay option 82 link selection.
Use the no form of this command to disable DHCP relay option 82 link selection.
Command Syntax
ip dhcp relay information source-ip A.B.C.D
no ip dhcp relay information source-ip
Parameters
A.B.C.D
IPv4 address
Command Mode
Configure mode
VRF mode
Default
No default value is specified.
Applicability
This command was introduced before OcNOS version 1.3.6.
Example
#configure terminal
(config)#ip vrf vrf1
(config-vrf)#ip dhcp relay information option source-ip 2.2.2.2
#configure terminal
(config)#ip dhcp relay information option source-ip 3.3.3.3
ipv6 dhcp relay (configure mode)
Use this command to enable the DHCP IPv6 relay agent.
Use the no form of this command to disable the DHCP IPv6 relay agent.
Command Syntax
ipv6 dhcp relay
no ipv6 dhcp relay
Parameters
None
Default
No default value is specified
Command Mode
Configure mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
#configure terminal
(config)#ipv6 dhcp relay
#configure terminal
(config)#no ipv6 dhcp relay
ipv6 dhcp relay (interface mode)
Use this command to configure an interface as a DHCP IPv6 client-facing port.
Use the no form of this command to remove an interface as a DHCP IPv6 client-facing port.
Command Syntax
ipv6 dhcp relay
no ipv6 dhcp relay
Parameters
None
Default
No default value is specified
Command Mode
Interface mode
Applicability
This command was introduced in OcNOS version 1.3.8.
Examples
#configure terminal
(config)#interface eth1
(config-if)#ipv6 dhcp relay
ipv6 dhcp relay address
Use this command to set an IPv6 address of a DHCP server to which a DHCP relay agent forwards client requests.
Use the no form of this command to remove an IPv6 address of a DHCP server.
You must enable the IPv6 DHCP relay feature with the
ipv6 dhcp relay (configure mode) command before you give this command.
Command Syntax
ipv6 dhcp relay address X:X::X:X
no ipv6 dhcp relay address X:X::X:X
Parameters
X:X::X:X
IPv6 address of the DHCP server
Default
No default value is specified
Command Mode
Configure mode
VRF mode
Applicability
This command was introduced before OcNOS version 1.3 and was changed in OcNOS version 1.3.8.
Examples
#configure terminal
(config)#ip vrf vrf1
(config-vrf)#ipv6 dhcp relay address 2001:db8::7F
#configure terminal
(config)#ipv6 dhcp relay address 2001:db8::7F
ipv6 dhcp relay address global
When the IPv6 DHCP server resides in a different VPN or global space that is different from the VPN, then use this command to specify the name of the VRF or global space in which the DHCP server resides.
Use the no form of this command to remove the VRF in which IPv6 DHCP server resides.
Command Syntax
ipv6 dhcp relay address X:X::X:X global (|VRF-NAME)
no ipv6 dhcp relay address X:X::X:X global
Parameters
X:X::X:X
IPv6 address of the DHCP server
VRF-NAME
Name of VRF where the DHCP server is present
Default
If no input given, default VRF is the default Value.
Command Mode
Configure mode
VRF mode
Applicability
This command was introduced in OcNOS-DC version 5.1.
Examples
#configure terminal
(config)#ip vrf vrf1
(config-vrf)#ipv6 dhcp relay address 2001:db8::7F global
#configure terminal
(config)#ipv6 dhcp relay address 2001:db8::7F global vrf1
ipv6 dhcp relay subscriber-id
Use this command to configure subscriber-ID for IPv6 DHCP relay.
Use no form of this command to disable subscriber-id.
Command Syntax
ipv6 dhcp relay information option subscriber-id WORD
no ipv6 dhcp relay information option subscriber-id
Parameters
WORD
Subscriber ID
Default
No default value is specified.
Command Mode
Configuration mode and VRF mode
Applicability
This command is introduced in OcNOS-DC version 5.0
Examples
#configure terminal
(config)#ipv6 dhcp relay information option subscriber-id test
(config)#exit
show ip dhcp relay
Use this command to display DHCP snooping relay status including DHCP server addresses configured on interfaces.
Command Syntax
show ip dhcp relay
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced before OcNOS version 1.3 and changed in OcNOS version 1.3.8.
Examples
#show ip dhcp relay
DHCP relay service is Enabled.
VRF Name: vrf1
Option 82: Enabled
Remote Id: ocnos-device
Link selection Source-IP: 1.4.5.6
DHCP Servers configured: 9.9.9.9 8.8.8.8
Interface Uplink/Downlink
--------- -------------
ge10 Uplink
ge28 Downlink
VRF Name: default
Option 82: Enabled
Remote Id: OcNOS
Link selection Source-IP: 1.2.3.4
DHCP Servers configured: 1.1.1.1 2.2.2.2
Interface Uplink/Downlink
--------- -------------
ge11 Uplink
ge27 Downlink
Table P‑2-12 explains the output fields.
Table 2-12: show ip dhcp relay fields
Entry | Description |
---|
DHCP relay service | Whether the DHCP relay service is enabled. |
VRF Name | Name of the VRF. |
Option 82 | Whether option 82 is enabled. |
Remote Id | Remote host Identifier. |
Link selection Source-IP | Option 82 link selection source IP address |
DHCP Servers configured | Addresses of DHCP servers configured |
Interface | Interface name |
Uplink/Downlink | Whether the interface is a server-facing port (uplink) or a client-facing port (downlink). |
show ip dhcp relay address
Use this command to display DHCP relay addresses.
Command Syntax
show ip dhcp relay address
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced before OcNOS version 1.3 and changed in OcNOS version 1.3.8.
Examples
#show ip dhcp relay address
VRF Name: vrf1
DHCP Servers configured: 9.9.9.9 8.8.8.8
VRF Name: default
DHCP Servers configured: 1.1.1.1 2.2.2.2
Table P‑2-13 explains the output.
.
Table 2-13: show ip dhcp relay address interface fields
Entry | Description |
---|
VRF Name | Name of the VRF. |
DHCP Servers configured | Addresses of DHCP servers configured |
show ip dhcp relay option statistics
Use this command to display IPv4 DHCP Relay Agent Option(Option82) packet statistics
command syntax
show ip dhcp relay option statistics
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced in OcNOS version 1.3.9.
Examples
OcNOS#sh ip dhcp relay option statistics
VRF Name: default
Remote ID : OcNOS
Circuit ID : ge5
Number of packets forwarded without agent options : 0
Dropped pkts due to bad relay agent information option : 0
Dropped pkts due to no RAI option match found : 0
Circuit ID option is not matching with known circuit ID : 0
Circuit ID option in matching RAI option was missing : 0
OcNOS#
show ip dhcp relay statistics
Use this command to display IPv4 DHCP relayed packet statistics.
command syntax
show ip dhcp relay statistics
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced in OcNOS version 1.3.9.
Examples
OcNOS#sh ip dhcp relay statistics
VRF Name: default
Packets sent with a bogus giaddr : 0
Packets relayed from client to server : 12
Errors sending packets to servers : 0
Packets relayed from server to client : 1
Errors sending packets to clients : 0
OcNOS#
show ipv6 dhcp relay
Use this command to display DHCP IPv6 snooping relay status including DHCP IPv6 server addresses configured on interfaces.
Command Syntax
show ipv6 dhcp relay
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced before OcNOS version 1.3 and changed in OcNOS version 1.3.8.
Examples
#show ipv6 dhcp relay
IPv6 DHCP relay service is Enabled.
VRF Name: vrf1
DHCPv6 Servers configured: 2001::1
Interface Uplink/Downlink
--------- -------------
ge35 Uplink
xe50 Downlink
VRF Name: default
DHCPv6 Servers configured: 3001::1
Interface Uplink/Downlink
--------- -------------
ge34 Uplink
xe49 Downlink
Table P‑2-14 explains the output fields.
Table 2-14: show ipv6 dhcp relay fields
Entry | Description |
---|
IPv6 DHCP relay service | Whether the DHCP relay service is enabled. |
VRF Name | Name of the VRF. |
DHCPv6 Servers configured | Addresses of DHCP servers configured |
Interface | Interface name |
Uplink/Downlink | Whether the interface is a server-facing port (uplink) or a client-facing port (downlink). |
show ipv6 dhcp relay address
Use this command to display DHCP IPv6 relay addresses.
Command Syntax
show ipv6 dhcp relay address
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced before OcNOS version 1.3 and changed in OcNOS version 1.3.8.
Examples
#show ipv6 dhcp relay address
VRF Name: vrf1
DHCPv6 Servers configured: 2001::1
VRF Name: default
DHCPv6 Servers configured: 3001::1
Table P‑2-15 explains the output fields.
Table 2-15: show ipv6 dhcp relay address fields
Entry | Description |
---|
VRF Name | Name of the VRF. |
DHCPv6 Servers configured | Addresses of DHCP servers configured |
show running-config dhcp
Use this command to display DHCP settings in the running configuration.
Command Syntax
show running-config dhcp
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced before OcNOS version 1.3 and changed in OcNOS version 1.3.8.
Examples
#show running-config dhcp
ip vrf vrf1
ip dhcp relay information option remote-id hostname
ip dhcp relay address 1.1.1.2
ip dhcp relay information option remote-id hostname
ip dhcp relay information source-ip 5.4.3.2
ip dhcp relay address 1.1.1.1