DHCP Commands

This chapter describes the Cisco IOS XR software commands used to configure and monitor Dynamic Host Configuration Protocol (DHCP).

For detailed information about DHCP concepts, configuration tasks, and examples, refer to the IP Addresses and Services Configuration Guide for Cisco NCS 6000 Series Routers.

broadcast-flag policy check

To configure Dynamic Host Configuration Protocol (DHCP) IPv4 Relay to broadcast only BOOTREPLY packets if the DHCP IPv4 broadacst flag is set in the DHCP IPv4 header, use the broadcast-flag policy check command in DHCP IPv4 relay profile configuration submode . By default, the DHCP IPv4 Relay always broadcasts BOOTREPLY packets. To restore the default, use the no form of this command.

broadcast-flag policy{ check}

Syntax Description

check

Checks the broadcast flag in packets.

unicast-always

Sets the broadcast-flag policy to unicast-always.

Command Default

Relay agent always broadcasts DHCP IPv4 packets to a client.

Command Modes

DHCP IPv4 relay profile configuration

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

ip-services

read, write

Examples

This an example of the broadcast-flag policy check command:


RP/0/RP0/CPU0:router# config
RP/0/RP0/CPU0:router(config)# dhcp ipv4
RP/0/RP0/CPU0:router(config-dhcpv4)# profile client relay
RP/0/RP0/CPU0:router(config-dhcpv4-relay-profile)# broadcast-flag policy check

dhcp ipv4

To enable Dynamic Host Configuration Protocol (DHCP) for IPv4 and to enter DHCP IPv4 configuration mode, use the dhcp ipv4 command in XR Config mode. To disable DHCP for IPv4 and exit the DHCP IPv4 configuration mode, use the no form of this command.

dhcp ipv4

Syntax Description

This command has no keywords or arguments.

Command Modes

None

Command Modes

XR Config mode

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Usage Guidelines

Use the dhcp ipv4 command to enter DHCP IPv4 configuration mode.

Task ID

Task ID

Operations

ip-services

read, write

Examples

This example shows how to enable DHCP for IPv4:



RP/0/RP0/CPU0:router# dhcp ipv4
RP/0/RP0/CPU0:router(config-dhcpv4)#

giaddr policy

To configure how Dynamic Host Configuration Protocol (DHCP) IPv4 Relay processes BOOTREQUEST packets that already contain a nonzero giaddr attribute, use the giaddr policy command in DHCP IPv4 profile relay configuration submode. To restore the default giaddr policy, use the no form of this command.

giaddr policy {replace | drop}

no giaddr policy {replace | drop}

Syntax Description

replace

Replaces the existing giaddr value with a value that it generates.

drop

Drops the packet that has an existing nonzero giaddr value.

Command Default

DHCP IPv4 relay retains the existing nonzero giaddr value in the DHCP IPv4 packet received from a client value.

Command Modes

DHCP IPv4 profile relay configuration

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Usage Guidelines

The giaddr policy command affects only the packets that are received from a DHCP IPv4 client that have a nonzero giaddr attribute.

Task ID

Task ID

Operations

ip-services

read, write

Examples

The following example shows how to use the giaddr policy command:



RP/0/RP0/CPU0:router# config
RP/0/RP0/CPU0:router(config)# dhcp ipv4
RP/0/RP0/CPU0:router(config-dhcpv4)# profile client relay
RP/0/RP0/CPU0:router(config-dhcpv4-relay-profile)# giaddr policy drop

interface (relay profile)

To configure a relay profile on an interface, use the interface (relay profile) command in Dynamic Host Configuration Protocol (DHCP) IPv4 configuration mode. To disable this feature, use the no form of the command.

interface interface-type interface-path-id {none | relay}

no interface interface-type interface-path-id {none | relay}

Syntax Description

interface-type

Interface type. For more information, use the question mark (?) online help function.

interface-path-id

Either a physical interface instance or a virtual interface instance.

none

Disables DHCP at the specified interface.

relay

Specifies a relay profile for the interface.

Command Modes

DHCP IPv4 configuration

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

ip-services

read, write

Examples

The following example shows how to configure a relay profile on an interface:


RP/0/RP0/CPU0:router# config
RP/0/RP0/CPU0:router(config)# dhcp ipv4
RP/0/RP0/CPU0:router(config-dhcpv4)# interface HundredGigE 0/7/0/0 
RP/0/RP0/CPU0:router(config-dhcpv4)# interface HundredGigE 0/7/0/0 relay profile client

profile relay

To configure a relay profile for the Dynamic Host Configuration Protocol (DHCP) IPv4 component and to enter the profile relay mode, use the profile relay command in DHCP IPv4 configuration mode. To disable this feature and exit the profile relay mode, use the no form of this command.

profile profile name relay

no profile profile name relay

Syntax Description

profile name

Name that uniquely identifies the relay profile.

Command Modes

DHCP IPv4 configuration

W3

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

ip-services

read, write

Examples

The following example shows how to use the profile relay command:


RP/0/RP0/CPU0:router(config)# dhcp ipv4
RP/0/RP0/CPU0:router(config-dhcpv4)# profile client relay

relay information check

To configure a Dynamic Host Configuration Protocol (DHCP) IPv4 Relay to validate the relay agent information option in forwarded BOOTREPLY messages, use the relay information check command in DHCP IPv4 relay profile configuration submode. To disable this feature, use the no form of this command.

relay information check

Syntax Description

This command has no keywords or arguments.

Command Default

DHCP validates the relay agent information option.

Command Modes

DHCP IPv4 relay profile configuration

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

ip-services

read, write

basic-services

read, write

Examples

This example shows how to use the relay information check command:


RP/0/RP0/CPU0:router#config 
RP/0/RP0/CPU0:router(config)# dhcp ipv4
RP/0/RP0/CPU0:router(config-dhcpv4)# profile client relay
RP/0/RP0/CPU0:router(config-dhcpv4-relay-profile)# relay information check 

relay information option

To configure Dynamic Host Configuration Protocol (DHCP) IPv4 relay or DHCP snooping Relay to insert relay agent information option in forwarded BOOTREQUEST messages to a DHCP server, use the relay information option command in DHCP IPv4 relay profile relay configuration or DHCP IPv4 profile snoop submode. To disable inserting relay information into forwarded BOOTREQUEST messages, use the no form of this command.

relay information option

Syntax Description

This command has no keywords or arguments.

Command Default

None

Command Modes


            DHCP IPv4
            relay
            profile
            relay
            configuration
        

DHCP IPv4 profile snoop configuration

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Usage Guidelines

The relay information option command automatically adds the circuit identifier suboption and the remote ID suboption to the DHCP relay agent information option.

The relay information option command enables a DHCP server to identify the user (for example, cable access router) sending the request and initiate appropriate action based on this information. By default, DHCP does not insert relay information.

If the information option command is enabled, DHCP snooping mode does not set the giaddr field in the DHCP packet.

The upstream DHCP server or DHCP relay interface must be configured to accept this type of packet using the relay information option allow-untrusted configuration. This configuration prevents the server or relay from dropping the DHCP message.

Task ID

Task ID

Operations

ip-services

read, write

basic-services

read, write

Examples

This example shows how to use the relay information option command:


RP/0/RP0/CPU0:router# config
RP/0/RP0/CPU0:router(config)# dhcp ipv4
RP/0/RP0/CPU0:router(config-dhcpv4)# profile client relay
RP/0/RP0/CPU0:router(config-dhcpv4-relay-profile)# relay information option

relay information option allow-untrusted

To configure the Dynamic Host Configuration Protocol (DHCP) IPv4 relay or DHCP snooping Relay not to drop discard BOOTREQUEST packets that have the relay information option set and the giaddr set to zero, use the relay information option allow-untrusted command in DHCP IPv4 relay profile configuration submode or DHCP IPv4 profile snoop configuration submode. To restore the default behavior, which is to discard the BOOTREQUEST packets that have the relay information option and set the giaddr set to zero, use the no form of this command.

relay information option allow-untrusted

Syntax Description

This command has no keywords or arguments.

Command Default

The packet is dropped if the relay information is set and the giaddr is set to zero.

Command Modes


            DHCP IPv4
            relay
            profile
            relay
            configuration
        

DHCP IPv4 profile snoop configuration

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Usage Guidelines

According to RFC 3046, relay agents (and servers) receiving a DHCP packet from an untrusted circuit with giaddr set to zero but with a relay agent information option already present in the packet shall discard the packet and increment an error count. This configuration prevents the server or relay from dropping the DHCP message.

Task ID

Task ID

Operations

ip-services

read, write

basic-services

read, write

Examples

This example shows how to use the relay information option allow-untrusted command:


RP/0/RP0/CPU0:router# config
RP/0/RP0/CPU0:router(config)# dhcp ipv4
RP/0/RP0/CPU0:router(config-dhcpv4)# profile client relay 
RP/0/RP0/CPU0:router(config-dhcpv4-relay-profile)# relay information option allow-untrusted

relay information policy

To configure how the Dynamic Host Configuration Protocol (DHCP) IPv4 relay processes BOOTREQUEST packets that already contain a relay information option, use the relay information policy command in DHCP IPv4 relay profile configuration submode. To restore the default relay information policy, use the no form of this command.

relay information policy {drop | keep}

Syntax Description

drop

Directs the DHCP IPv4 Relay to discard BOOTREQUEST packets with the existing relay information option.

keep

Directs the DHCP IPv4 Relay not to discard a BOOTREQUEST packet that is received with an existing relay information option and to keep the existing relay information option value.

Command Default

The DHCP IPv4 Relay does not discard a BOOTREQUEST packet that has an existing relay information option. The option and the existing relay information option value is replaced.

Command Modes

DHCP IPv4 relay profile configuration

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Task ID

Task ID

Operations

ip-services

read, write

basic-services

read, write

Examples

This is sample output from executing the relay information policy command:


RP/0/RP0/CPU0:router# config
RP/0/RP0/CPU0:router(config)# dhcp ipv4
RP/0/RP0/CPU0:router(config-dhcpv4)# profile client relay
RP/0/RP0/CPU0:router(config-dhcpv4-relay-profile)# relay information policy keep

show dhcp ipv4 relay profile

To display Dynamic Host Configuration Protocol (DHCP) relay agent status, use the show dhcp ipv4 relay profile command in XR EXEC mode.

show dhcp ipv4 relay profile

Syntax Description

This command has no keywords or arguments.

Command Default

No default behavior or values

Command History

Release

Modification

Release 5.0.0

This command was introduced.

Usage Guidelines

This command displays the relay profiles created for DHCP IPv4.

Task ID

Task ID

Operations

ip-services

read

Examples

The following is sample output from the show dhcp ipv4 relay profile command:


RP/0/RP0/CPU0:router# show dhcp ipv4 relay profile

DHCP IPv4 Relay Profiles
--------------------------
r1
r2