DHCP and DNS – DHCP Relay

ip dhcp relay enable (Global)

Use the ip dhcp relay enable Global Configuration mode command to enable the DHCP relay feature on the device. Use the no form of this command to disable the DHCP relay feature.

Syntax

ip dhcp relay enable no ip dhcp relay enable

Parameters

N/A

Default Configuration

DHCP relay feature is disabled.

Command Mode

Global Configuration mode

Example

The following example enables the DHCP relay feature on the device.

switchxxxxxx(config)# ip dhcp relay enable

ip dhcp relay enable (Interface)

Use the ip dhcp relay enable Interface Configuration mode command to enable the DHCP relay feature on an interface. Use the no form of this command to disable the DHCP relay agent feature on an interface.

Syntax

ip dhcp relay enable no ip dhcp relay enable

Parameters

N/A

Default Configuration

Disabled

Command Mode

Interface Configuration mode

User Guidelines

The operational status of DHCP Relay on an interface is active if one of the following conditions exist:

  • DHCP Relay is globally enabled, and there is an IP address defined on the interface.

       Or

  • DHCP Relay is globally enabled, there is no IP address defined on the interface, the interface is a VLAN, and option 82 is enabled.

Example

The following example enables DHCP Relay on VLAN 21.

switchxxxxxx(config)# interface vlan 21
switchxxxxxx(config-if)# ip dhcp relay enable

ip dhcp relay address (Global)

Use the ip dhcp relay address Global Configuration mode command to define the DHCP servers available for the DHCP relay. Use the no form of this command to remove the server from the list.

Syntax

ip dhcp relay address ip-address no ip dhcp relay address [ip-address]

Parameters

  • ip-address—Specifies the DHCP server IP address. Up to 8 servers can be defined.

Default Configuration No server is defined.

Command Mode

Global Configuration mode

User Guidelines

Use the ip dhcp relay address command to define a global DHCP Server IP address. To define a few DHCP Servers, use the command a few times.

To remove a DHCP Server, use the no form of the command with the ip-address argument.

The no form of the command without the ip-address argument deletes all global defined DHCP servers.

Example

The following example defines the DHCP server on the device.

switchxxxxxx(config)# ip dhcp relay address 176.16.1.1

ip dhcp relay address (Interface)

Use the ip dhcp relay address Interface Configuration (VLAN, Ethernet, Port-channel) command to define the DHCP servers available by the DHCP relay for DHCP clients connected to the interface. Use the no form of this command to remove the server from the list.

Syntax

ip dhcp relay address ip-address no ip dhcp relay address [ip-address]

Parameters

  • ip-address—Specifies the DHCP server IP address. Up to 8 servers can be defined.

Default Configuration No server is defined.

Command Mode

Interface Configuration mode

User Guidelines

Use the ip dhcp relay address command to define a DHCP Server IP address per the interface. To define multiple DHCP Servers, use the command multiple times.

To remove a DHCP server, use the no form of the command with the ip-address argument.

The no form of the command without the ip-address argument deletes all DHCP servers.

Example

The following example defines the DHCP server on the device.

switchxxxxxx(config)# interface vlan 21
switchxxxxxx(config-if)# ip dhcp relay address 176.16.1.1

show ip dhcp relay

Use the show ip dhcp relay EXEC mode command to display the DHCP relay information.

Syntax

show ip dhcp relay

Command Mode

User EXEC mode

Examples

Example 1. Option 82 is not supported:

switchxxxxxx# show ip dhcp relay DHCP relay is globally enabled Option 82 is Disabled Maximum number of supported VLANs without IP Address is 256 Number of DHCP Relays enabled on VLANs without IP Address is 0 DHCP relay is not configured on any port. DHCP relay is not configured on any vlan. No servers configured

Example 2. Option 82 is supported (disabled):

switchxxxxxx# show ip dhcp relay DHCP relay is globally disabled Option 82 is disabled Maximum number of supported VLANs without IP Address: 0 Number of DHCP Relays enabled on VLANs without IP Address: 4 DHCP relay is enabled on Ports: te1/0/1,po1-2 Active: Inactive: te1/0/1, po1-4 DHCP relay is enabled on VLANs: 1, 2, 4, 5 Active: Inactive: 1, 2, 4, 5 Global Servers: 1.1.1.1 , 2.2.2.2

Example 3. Option 82 is supported (enabled):

switchxxxxxx# show ip dhcp relay DHCP relay is globally enabled Option 82 is enabled Maximum number of supported VLANs without IP Address is 4 Number of DHCP Relays enabled on VLANs without IP Address: 2 DHCP relay is enabled on Ports: te1/0/1,po1-2 Active: te1/0/1 Inactive: po1-2 DHCP relay is enabled on VLANs: 1, 2, 4, 5 Active: 1, 2, 4, 5 Inactive: Global Servers: 1.1.1.1 , 2.2.2.2

Example 3. Option 82 is supported (enabled) and there DHCP Servers defined per interface:

switchxxxxxx# show ip dhcp relay DHCP relay is globally enabled Option 82 is enabled Maximum number of supported VLANs without IP Address is 4 Number of DHCP Relays enabled on VLANs without IP Address: 2 DHCP relay is enabled on Ports: te1/0/1,po1-2 Active: te1/0/1 Inactive: po1-2 DHCP relay is enabled on VLANs: 1, 2, 4, 5 Active: 1, 2, 4, 5 Inactive: Global Servers: 1.1.1.1 , 2.2.2.2 VLAN 1: 1.1.1.1, 100.10.1.1 VLAN 2: 3.3.3.3, 4.4.4.4, 5.5.5.5 VLAN 10: 6.6.6.6

ip dhcp information option

Use the ip dhcp information option Global Configuration command to enable DHCP option-82 data insertion. Use the no form of this command to disable DHCP option-82 data insertion.

Syntax

ip dhcp information option no ip dhcp information option

Parameters

N/A

Default Configuration

DHCP option-82 data insertion is disabled.

Command Mode

Global Configuration mode

User Guidelines

DHCP option 82 would be enabled only if DHCP snooping or DHCP relay are enabled.

Example

switchxxxxxx(config)# ip dhcp information option

show ip dhcp information option

The show ip dhcp information option EXEC mode command displays the DHCP Option 82 configuration.

Syntax

show ip dhcp information option

Parameters

N/A

Default Configuration

N/A

Command Mode

User EXEC mode

Example

The following example displays the DHCP Option 82 configuration.

switchxxxxxx# show ip dhcp information option Relay agent Information option is Enabled

Was this article helpful?

Related Articles

Leave A Comment?