DHCP Relay
Since Dynamic Host Configuration Protocol must work correctly even before DHCP clients have been configured, the DHCP server and DHCP client need to be connected to the same network.
In larger networks, this is not always practical because each network link contains one or more DHCP relay (DHCP-R) agents. These agents receive messages from DHCP clients and forward them to DHCP servers thus extending the reach of the DHCP beyond the local network.
DHCP-R is supported for IPv4 and IPv6.
DHCP-R is supported for both primary IP subnet and secondary IP subnets.
In some cases it is desired that DHCP-R functionality is automatically enabled to all IP interfaces in the system. For this purpose a vrf-auto-helper may be configured on a DHCP-R instance which would provide DHCP-R services automatically for each newly created interface on a VRF.
Only one instance in each VRF can have vrf-auto-helper capability. Whenever a new instance is created in a VRF, it automatically becomes a vrf-auto-helper.
It is possible to manually disable auto-helper capability for the instance. See the command “vrf-auto-helper” for more information.
It is possible to define an interface to be downstream, upstream, or bidirectional (both downstream and upstream):
Bidirectional interface – capable of performing downstream and upstream functionalities
Downstream interface (default configuration) – the interface on which queries are received from clients or from other relay agents
Upstream interface – the interface to which queries from clients and other relay agents are forwarded
ip dhcp relay
ip dhcp relay [instance <instance-id>] Enters DHCP relay instance configuration mode, and creates DHCP instance in active VRF context. | ||
Syntax Description | instance-id | Range: 1-8 |
Default | N/A | |
Configuration Mode | config | |
History | 3.6.3004 | |
Example | switch (config)# ip dhcp relay instance 1 | |
Related Commands | ||
Notes | If an instance is not specified then instance 1 is used (if nonexistent, then it is created). |
address
address <ip-address> Configures the DHCP server IP address on a particular instance. | ||
Syntax Description | ip-address | Valid IP unicast address of DHCP server. |
Default | N/A | |
Configuration Mode | config ip dhcp relay | |
History | 3.3.4150 | |
3.6.1002 | Added VRF parameter | |
3.6.3004 | Enhanced command for DHCP-R multi-instance | |
Example | switch (config ip dhcp relay instance 1)# address 1.2.3.4 | |
Related Commands | ip dhcp relay | |
Notes |
|
always-on
always-on Enables broadcast mode on a particular instance. | ||
Syntax Description | vrf | VRF name |
Default | Disabled | |
Configuration Mode | config ip dhcp relay | |
History | 3.3.4150 | |
3.6.1002 | Added VRF parameter | |
3.6.3004 | Enhanced command for DHCP-R multi-instance | |
Example | switch (config ip dhcp relay instance 1)# always-on | |
Related Commands | ip dhcp relay | |
Notes |
|
information option
information option Enables DHCP relay agents to insert option 82 on the packets of a particular instance. | ||
Syntax Description | N/A | |
Default | Disabled | |
Configuration Mode | config ip dhcp relay | |
History | 3.3.4150 | |
3.6.3004 | Enhanced command for DHCP-R multi-instance | |
Example | switch (config ip dhcp relay instance 1)# information option | |
Related Commands | ip dhcp relay | |
Notes | The following option for running this command is also possible: ip dhcp relay instance 1 information option. However, if an instance is not specified then instance 1 is used (if nonexistent, then it is created). |
vrf
vrf <vrf-name> Configures mention instance in the given VRF. | ||
Syntax Description | N/A | |
Default | N/A | |
Configuration Mode | config ip dhcp relay | |
History | 3.6.3004 | |
Example | switch (config ip dhcp relay instance 1)# vrf 2 | |
Related Commands | ||
Notes |
|
port
port <udp-port> Changes the UDP port for the given instance. | ||
Syntax Description | udp-port | UDP port |
Default | 67 | |
Configuration Mode | config ip dhcp relay | |
History | 3.6.3004 | |
Example | switch (config ip dhcp relay instance 1)# port 65534 | |
Related Commands | ||
Notes |
|
use-secondary-ip
use-secondary-ip Enables the switch to relay a single request from the client multiple times simultaneously, with each of the IP addresses configured on the corresponding downstream interfaces as the respective gateway address (linkaddr field of IPv4 DHCP request packet). | ||
Syntax Description | N/A | |
Default | Disabled | |
Configuration Mode | config ip dhcp relay | |
History | 3.6.8008 | |
Example | switch (config ip dhcp relay instance 1)# use-secondary-ip | |
Related Commands | ||
Notes |
vrf-auto-helper
vrf-auto-helper Makes all L3 interfaces (existing/newly created) to be part of the given instance. | ||
Syntax Description | N/A | |
Default | N/A | |
Configuration Mode | config ip dhcp relay | |
History | 3.6.3004 | |
Example | switch (config ip dhcp relay instance 1)# vrf-auto-helper | |
Related Commands | ||
Notes |
|
ip dhcp relay instance (config interface)
ip dhcp relay instance <instance-id> [downstream] [upstream] Enables the given interface to listen for DHCP packets coming from specified instance (i.e. binds interface to that instance). | ||
Syntax Description | instance-id | DHCP instance ID |
downstream | The interface on which queries are received from clients or from other relay agents | |
upstream | The interface to which queries from clients and other relay agents should be forwarded | |
Default | Downstream | |
Configuration Mode | config interface ethernet set as router port interface | |
History | 3.6.3004 | |
3.6.6000 | Added downstream and upstream parameters | |
Example | switch (config interface ethernet 1/13)# ip dhcp relay instance 7 downstream | |
Related Commands | ||
Notes |
|
clear ip dhcp relay counters
clear ip dhcp relay counters [vrf {<vrf-name> | all} | instance <instance-id>] Clears all DHCP relay counters (all interfaces) in a given VRF or instance. | ||
Syntax Description | vrf-name | VRF name or “all” for all VRFs |
instance-id | DHCP instance ID Range: 1-8 | |
Default | N/A | |
Configuration Mode | config | |
History | 3.3.4150 | |
3.6.1002 | Added VRF parameter | |
3.6.3004 | Enhanced command for DHCP-R multi-instance | |
3.6.5000 | Added “all” parameter | |
Example | switch (config)# clear ip dhcp relay counters | |
Related Commands | ||
Notes |
|
ip dhcp relay information option circuit-id
ip dhcp relay information option circuit-id <label> Specifies the content of the circuit ID sub-option attached to the client DHCP packet when it is forwarded a DHCP server. | ||
Syntax Description | label | Specifies the label attached to packets. The string may be up to 15 characters. |
Default | The label is taken from the IP interface name (e.g. “vlan1”) | |
Configuration Mode | config interface vlan | |
History | 3.3.4150 | |
3.6.1002 | Added VRF parameter | |
Example | switch (config interface vlan 10)# ip dhcp relay information options circuit-id my-label | |
Related Commands | ||
Notes | The circuit ID sub-option is an IP interface attribute which is shared across all DHCP-R instances. |
ipv6 dhcp relay instance
ipv6 dhcp relay instance <instance-id> [vrf-auto-helper] [downstream] [upstream] Enables DHCP relay instance configuration mode, and creates DHCP instance in active VRF context. | ||
Syntax Description | instance-id | DHCP instance ID |
vrf-auto-helper | Instance becomes VTF auto helper | |
downstream | The interface on which queries are received from clients or from other relay agents | |
upstream | The interface to which queries from clients and other relay agents should be forwarded | |
Default | Disabled | |
Configuration Mode | config interface ethernet | |
History | 3.6.4070 | |
3.6.6000 | Added downstream and upstream parameters | |
Example | switch (config interface ethernet 1/1) # ipv6 dhcp relay instance 1 downstream | |
Related Commands | ||
Notes |
|
ipv6 dhcp relay instance (global server)
ipv6 dhcp relay instance <instance-id> address <ipv6-address or list of addresses> Configure the server address on a particular instance. | ||
Syntax Description | instance-id | DHCP instance ID |
ipv6-address | Valid global unicast IPv6 server address | |
Default | N/A | |
Configuration Mode | config | |
History | 3.6.4070 | |
Example | switch (config)# ipv6 dhcp relay instance 1 address 2001::1 | |
Related Commands | ||
Notes | An instance without an assigned addresses will send to All_DHCP_servers address |
ipv6 dhcp relay instance address (destination address on interface)
ipv6 dhcp relay instance <instance-id> address <link-local-address> Configures the destination address on a particular instance on a specific upstream interface. Only link local address is supported. | ||
Syntax Description | instance-id | DHCP instance ID |
ipv6-address | Destination unicast or multicast address | |
Default | N/A | |
Configuration Mode | config interface ethernet | |
History | 3.6.4070 | |
Example | switch (config interface ethernet 1/13)# ipv6 dhcp relay instance 1 address fe80::1 | |
Related Commands | ||
Notes | Up to 16 addresses can be assigned per instance |
ipv6 dhcp relay instance interface-id option
ipv6 dhcp relay instance <instance-id> interface-id option Enables the instance to insert interface ID option. | ||
Syntax Description | instance-id | DHCP instance ID |
Default | Default interface-id is an interface name (e.g. vlan1, eth1/1) | |
Configuration Mode | config | |
History | 3.6.4070 | |
Example | switch (config)# ipv6 dhcp relay instance 1 interface-id option | |
Related Commands | ||
Notes |
ipv6 dhcp relay instance vrf
ipv6 dhcp relay instance <instance-id> vrf <vrf-name> Configures instance in the given VRF. | ||
Syntax Description | instance-id | DHCP instance ID |
vrf-name | Name of VRF | |
Default | Default VRF | |
Configuration Mode | config | |
History | 3.6.4070 | |
Example | switch (config)# ipv6 dhcp relay 1 vrf test | |
Related Commands | ||
Notes | When an instance is moved from one VRF to another - it loses all its current configuration. |
ipv6 dhcp relay instance port
ipv6 dhcp relay instance <instance-id> port <udp-port> Modifies the UDP port for the given instance. | ||
Syntax Description | instance-id | DHCP instance ID |
port | UDP Port ID | |
Default | UDP port 547 | |
Configuration Mode | config | |
History | 3.6.4070 | |
Example | switch (config)# ipv6 dhcp relay 1 port 555 | |
Related Commands | ||
Notes |
ipv6 dhcp relay instance interface-id option
ipv6 dhcp relay instance <instance-id> interface-id option [user-defined-id] Specifies the content of the interface-id option that will be sent by the relay agent. | ||
Syntax Description | instance-id | DHCP instance ID |
user-defined-id | Interface ID option content | |
Default | N/A | |
Configuration Mode | config | |
History | 3.6.4070 | |
Example | switch (config)# ipv6 dhcp relay instance <instance-id> interface-id option eth1/1 | |
Related Commands | ||
Notes |
ipv6 dhcp relay instance use-secondary-ip
ipv6 dhcp relay instance use-secondary-ip Enables the switch to relay a single request from the client multiple times simultaneously, with each of the IP addresses configured on the corresponding downstream interfaces as the respective gateway address (giaddr field of IPv6 DHCP request packet). | ||
Syntax Description | N/A | |
Default | Disabled | |
Configuration Mode | config | |
History | 3.6.8008 | |
Example | switch (config ipv6 dhcp relay instance 1)# use-secondary-ip | |
Related Commands | ||
Notes |
clear ipv6 dhcp relay counters
clear ipv6 dhcp relay counters [vrf {<vrf-name> | all} | instance <instance-id>] Clears DHCP relay counters for specific instance or all instances in given VRF or all instances in the system. | ||
Syntax Description | vrf-name | VRF name or “all” for all VRFs |
instance-id | DHCP instance ID | |
Default | N/A | |
Configuration Mode | config | |
History | 3.6.4070 | |
3.6.5000 | Added “all” parameter | |
Example | switch (config)# clear ipv6 dhcp relay counters vrf all | |
Related Commands | ||
Notes |
show ip dhcp relay
show ip dhcp relay [instance <instance-id>] Displays general DHCP configuration. | ||
Syntax Description | instance-id | If instance ID is specified, then a particular instance configuration is displayed |
Default | N/A | |
Configuration Mode | Any command mode | |
History | 3.3.4150 | |
3.6.1002 | Added VRF and all parameters | |
3.6.3004 | Updated example and parameters | |
3.6.6000 | Updated example | |
3.6.8008 | Updated example | |
Example |
| |
Related Commands | ||
Notes |
|
show ip dhcp relay counters
show ip dhcp relay counters [instance <instance-id> | vrf <vrf-name>] Displays the DHCP relay counters. | ||
Syntax Description | instance-id | Displays the DHCP relay counters for a given instance |
vrf | Displays the DHCP relay counters in a given VRF | |
Default | N/A | |
Configuration Mode | Any command mode | |
History | 3.3.4150 | |
3.6.1002 | Added VRF and all parameters | |
3.6.5000 | Updated example | |
3.6.8008 | Updated example | |
Example | ||
| ||
Related Commands | ||
Notes |
show ipv6 dhcp relay
show ipv6 dhcp relay [instance <instance-id>] Displays general DHCP configuration on all instances. | ||
Syntax Description | instance-id | DHCP instance ID |
Default | N/A | |
Configuration Mode | Any command mode | |
History | 3.6.4070 | First release |
3.6.5000 | Updated example | |
3.6.6000 | Updated example | |
3.6.8008 | Updated example | |
Example |
| |
Related Commands | ||
Notes |
|
show ipv6 dhcp relay counters
show ipv6 dhcp relay counters [instance <instance-id> | vrf <vrf-name>] Displays the DHCPv6 relay counters. | ||
Syntax Description | instance-id | Displays the DHCPv6 relay counters for a given instance |
vrf | Displays the DHCPv6 relay counters in a given VRF | |
Default | N/A | |
Configuration Mode | Any command mode | |
History | 3.3.4150 | |
3.6.8008 | Updated example | |
Example | ||
| ||
Related Commands | ||
Notes |