OcNOS-SP : System Management Guide : System Management Command Reference : Dynamic Host Configuration Protocol Relay
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 be used to forward DHCP client messages to DHCP server.
The DHCP client broadcasts on the local link, the relay agents receives the broadcast DHCP messages, and then generate 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) in 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
#clear ip dhcp relay option statistics
clear ipv6 dhcp pd-route (|vrf NAME)
Use this command to clear the routes in RIBD module learnt as part of Route injection feature.
Command Syntax
clear ipv6 dhcp pd-route (|vrf NAME)
Parameters
NAME
Name of the VRF
Default
No default value
Command Mode
Executive mode
Applicability
This command was introduced in OcNOS version 4.2.
Examples
#clear ipv6 dhcp pd-route vrf vrf1
 
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
#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
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 eth2
(config-if)#ip dhcp relay
ip dhcp relay (L3VPN)
Use this command to specify IPv4 DHCP relay to use tunnel interfaces as Uplink/Downlink.
Use the no form of this command to remove the usage of tunnel interfaces in IPv4 DHCP relay.
Command Syntax
ip dhcp relay (uplink|downlink) (l3vpn)
no ip dhcp relay (uplink|downlink) (l3vpn)
Parameters
uplink
DHCP Relay uplink interface
downlink
DHCP Relay downlink interface
l3vpn
L3VPN interface
Default
No default value is specified.
Command Mode
Configure and VRF mode
Applicability
This command was introduced in OcNOS version 5.0.
Examples
#configure terminal
(config)#ip vrf vrf1
(config-vrf)#ip dhcp relay uplink l3vpn
(config-vrf)#end
 
#configure terminal
(config)#ip dhcp relay uplink l3vpn
 
 
 
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.
User must enable the DHCP relay feature with the ip dhcp relay (configure mode) command to configure server address.
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 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 provided by the User.
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, can either be the System’s hostname or a user-specified string.
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
Default
No default value is specified.
Command Mode
Configure mode
VRF mode
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
ip dhcp relay server-group
Use this command to create the DHCP IPv4 server group. This group lists the servers to which DHCP Relay forwards the DHCP client requests.
Use the no form of this command to unconfigure the DHCP IPv4 server group.
For more information, refer to the command reference page for ip dhcp relay server-group in the DHCP Server Group section of the OcNOS Key Feature document, Release 6.4.1.
ip dhcp relay server-select
Use this command to attach the DHCP IPv4 server group to the DHCP relay uplink interface.
Use the no form of this command to remove the DHCP IPv4 server group attached to the DHCP relay interface.
Note: Attach the groups only to the DHCP relay uplink interfaces.
For more information, refer to the command reference page for ip dhcp relay server-select in the DHCP Server Group section of the OcNOS Key Feature document, Release 6.4.1.
 
 
 
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 DHCPv6 client-facing port.
Use the no form of this command to remove an interface as a DHCPv6 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 (L3VPN)
Use this command to specify IPv6 DHCP relay to use tunnel interfaces as Uplink/Downlink.
Use the no form of this command to remove the usage of tunnel interfaces in IPv6 DHCP relay.
Command Syntax
ipv6 dhcp relay (uplink|downlink) (l3vpn)
no ipv6 dhcp relay (uplink|downlink) (l3vpn)
Parameters
uplink
DHCP Relay uplink interface
downlink
DHCP Relay downlink interface
l3vpn
L3VPN interface
Default
No default value is specified.
Command Mode
Configure and VRF mode
Applicability
This command was introduced in OcNOS version 5.0.
Examples
#configure terminal
(config)#ip vrf vrf1
(config-vrf)#ipv6 dhcp relay uplink l3vpn
(config-vrf)#end
 
#configure terminal
(config)#ipv6 dhcp relay uplink l3vpn
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.
User must enable the IPv6 DHCP relay feature with the ipv6 dhcp relay (configure mode) command to configure server address.
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 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 pd-route-injection
Use this command to enable the Route Injection of the delegated prefixes in DHCP Relay.
Use the no form of this command to disable Route Injection.
Command Syntax
ipv6 dhcp relay pd-route-injection
no ipv6 dhcp relay pd-route-injection
Parameters
None
Default
By default this feature is disabled.
Command Mode
Configure mode
VRF mode
Applicability
This command was introduced in OcNOS version 4.2.
Examples
#configure terminal
(config)# ip vrf vrf1
(config-vrf)# ipv6 dhcp relay pd-route-injection
 
#configure terminal
(config)#ipv6 dhcp relay pd-route-injection
ipv6 dhcp relay server-group
Use this command to create the DHCP IPv6 server group. This group lists the servers to which DHCP relay forwards the DHCP client requests.
Use the no form of this command to unconfigure the DHCP IPv6 server group.
For more information, refer to the command reference page for ipv6 dhcp relay server-group in the DHCP Server Group section of the OcNOS Key Feature document, Release 6.4.1.
ipv6 dhcp relay server-select
Use this command to attach the DHCP IPv6 group to the DHCP relay uplink interface.
Use the no form of this command to remove the DHCP IPv6 group attached to the interface.
Note: Attach the groups only to the DHCP relay uplink interfaces.
For more information, refer to the command reference page for ipv6 dhcp relay server-select in the DHCP Server Group section of the OcNOS Key Feature document, Release 6.4.1.
 
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 version 5.0
Examples
#configure terminal
(config)#ipv6 dhcp relay information option subscriber-id test
(config)#exit
 
server A.B.C.D
Use this command to add the DHCP IPv4 servers to the DHCP server group.
Use the no form of this command to remove the DHCP IPv4 servers from the DHCP server Group.
Note: A maximum of eight servers can be added to a DHCP group.
For more information, refer to the command reference page for server A.B.C.D in the DHCP Server Group section of the OcNOS Key Feature document, Release 6.4.1.
server X:X::X:X
Use this command to add the DHCP IPv6 servers to the DHCP server group.
Use the no form of this command to remove the DHCP IPv6 servers from the DHCP server group.
Note: A maximum of eight servers can be added to a DHCP group.
For more information, refer to the command reference page for server X:X::X:X in the DHCP Server Group section of the OcNOS Key Feature document, Release 6.4.1.
show ip dhcp relay
Use this command to display DHCP 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
 
 
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
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
#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
#
show ip dhcp relay statistics
Use this command to display IPv4 DHCP relayed packet statistics.
Note: DHCPv6 relay statistics is not supported
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
#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
#
show ipv6 dhcp pd-route
Use this command to display the routes and their properties installed as part of the Route Injection feature
Command Syntax
show ipv6 dhcp pd-route
Parameters
None
Command Mode
Executive mode
Applicability
This command was introduced in OcNOS version 4.2.
Examples
#show ipv6 dhcp pd-route
VRF : vrf1
4002:db8:1bff::/48 via xe9 (2019-02-14 10:50:18 - 2019-02-14 10:51:58)
 
 
 
show ipv6 dhcp relay
Use this command to display DHCP IPv6 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
 
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
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