DHCP Commands

This chapter describes the commands used to configure and monitor Dynamic Host Configuration Protocol (DHCP) features.

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

clear dhcp ipv6 relay binding

To clear DHCPv6 relay binding, use the clear dhcp ipv6 relay binding command in XR EXEC mode.

clear dhcp ipv6 relay binding [ client-duid client-duid-number ] [interface type interface-path-id] [vrf vrf-name] [location node-id]

Syntax Description

client-duid client-duid-number

(Optional) Clears DHCPv6 relay client binding information.

The argument client-duid-number is the client's DHCP Unique Identifier (DUID) number.

Note

 

Use the show dhcp ipv6 relay binding command to see the client DUID number.

interface type interfac-path-id

(Optional) Clears DHCPv6 relay client binding information for an interface.

Specifies a physical interface or a virtual interface.

Note

 

Use the show interfaces command to see a list of all possible interfaces currently configured on the router.

vrf vrf-name

(Optional) Clears DHCPv6 relay client binding information for a VPN routing and forwarding (VRF) instance.

location node-id

(Optional) Clears DHCPv6 relay client binding information for a specified node.

The node-id argument is entered in the rack/slot/module notation.

Command Default

None.

Command Modes

XR EXEC mode

Command History

Release Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation

ip-services

execute

root-system

read, write

Examples

This example shows how to clear DHCPv6 relay binding:

Router# clear dhcp ipv6 relay binding

client-mac-mismatch

To enable DHCP MAC address verification.

client-mac-mismatch action drop

Syntax Description

action

Specifies an action for the router when the DHCP MAC address is a not a match.

drop

Drops the packet with the mismatched DHCP MAC address.

Command Default

None

Command Modes

DHCP Relay Profile Configuration Mode

Command History

Release Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

Enables MAC address verification. If MAC address in the DHCPv4 protocol header does not match the L2 header source MAC address in the DHCPv4 relay profile, the frame is dropped.

Examples

Use the following example to configure DHCP MAC address verification.

Router# configure

Router(config)# dhcp ipv4
/* Configures DHCP for IPv4 and enters the DHCPv4 configuration submode. */

Router(config-dhcpv4)# profile client relay
/* Enables DHCP relay profile */

Router(config-dhcpv4)# client-mac-mismatch action drop
/* Enables MAC address verification. If MAC address in the DHCPv4 protocol header does not match the L2 header source MAC address in the DHCPv4 relay profile,
 the frame is dropped  */

Router(config-dhcpv4-relay-profile)# commit

Router(config-dhcpv4-relay-profile)# exit

dhcp ipv4

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

dhcp ipv4

no dhcp ipv4

Command Modes

None

Command Modes

Global Configuration mode

Command History

Release

Modification

Release 7.2.12

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:


Router# configure
Router(config)# dhcp ipv4
Router# (config-dhcpv4)#

dhcp ipv6

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

dhcp ipv6

Syntax Description

This command has no keywords or arguments.

Command Modes

XR Config mode

Command History

Release

Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

Use the dhcp ipv6 command to enter DHCP IPv6 configuration mode.

Task ID

Task ID

Operations

ip-services

read, write

Examples

This example shows how to enable DHCP for IPv6:



Router(config)# dhcp ipv6
Router(config-dhcpv6)#

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 7.2.12

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:



Router# config
Router(config)# dhcp ipv4
Router(config-dhcpv4)# profile client relay
Router(config-dhcpv4-relay-profile)# giaddr policy drop

helper-address

To configure the Dynamic Host Configuration Protocol (DHCP) IPv4 relay agent to relay DHCP packets to a specific DHCP server, use the helper-address command in an DHCP IPv4 relay profile configuration mode. Use the no form of this command to clear the address.

helper-address { vrf vrf-name | address } giaddr [ gateway-address ]

no helper-address { vrf vrf-name | address } giaddr [ gateway-address ]

Syntax Description

vrf-name

(Optional) Specifies the name of a particular VRF.

address

IPv4 in four part, dotted decimal format.

giaddr gateway-address

(Optional) Specifies the gateway address to use in packets relayed to server. This keyword is applicable for IPv4 helper address.

Command Default

Helper address is not configured.

Command Modes

DHCP IPv4 relay profile configuration

Command History

Release

Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

A maximum of upto eight helper addresses can be configured.

Task ID

Task ID

Operations

ip-services

read, write

Examples

This example shows how to set the helper-address for a VRF using the helper address command in DHCP IPv4 relay profile class configuration mode:



RP/0/CPU0:router(config)#  dhcp ipv4
RP/0/CPU0:router(config-dhcpv4)# profile profile1 relay
RP/0/CPU0:router(config-dhcpv4-relay-profile)# helper-address vrf my-server-vrf 192.0.2.1

helper-address (ipv6)

To configure the Dynamic Host Configuration Protocol (DHCP) IPv6 relay agent for prefix delegation to relay DHCP packets to a specific DHCP server, use the helper-address command in the DHCP IPv6 profile configuration submode. Use the no form of this command to clear the address.

helper-address ipv6-address | vrf vrf-address [ interface type interface-path-id ]

no helper-address ipv6-address | vrf vrf-address [ interface type interface-path-id ]

Syntax Description

ipv6-address

The IPv6 address assigned to the interface.

This argument must be in the form documented in RFC 2373 where the address is specified in hexadecimal format using 16-bit values between colons.

interface type

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

interface-path-id

(Optional) Either a physical interface instance or a virtual interface instance as follows:

  • Physical interface instance. Naming notation is rack/slot/module/port and a slash between value s is required as part of the notation.
    • rack: Chassis number of the rack.

    • slot: Physical slot number of the modular services card or line card.

    • module: Module number. A physical layer interface module (PLIM) is always 0.

    • port: Physical port number of the interface.

    Note

     

    In references to a Management Ethernet interface located on a route processor card, the physical slot number is alphanumeric (RSP0) and the module is CPU0. Example: interface MgmtEth0/RSP0/CPU0/0.

  • Virtual interface instance. Number range varies depending on interface type.

For more information about the syntax for the router, use the question mark (?) online help function.

Command Default

No default behavior or values

Command Modes

DHCP IPv6 profile configuration

Command History

Release Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
ip-services

read, write

Examples

This is a sample output that shows how to set the helper-address using the helper-address command



Router# config
Router(config)# dhcp ipv6
Router(config-dhcpv6)# profile p1 relay
Router(config-dhcpv6-profile)# helper-address 2001:DB8::1 HundredGigE 0/2/0/0 

hop-count-seed

To configure the hop-count in relay-forward message for a DHCP relay agent as zero, use the hop-count-seed command in the DHCP IPv6 configuration mode. By default, hop-count in relay-forward message for DHCP relay agents is set to one.

hop-count-seed

no hop-count-seed

Syntax Description

This command has no keywords or arguments.

Command Default

If this command is not configured, by default, hop-count in relay-forward message for DHCP relay agents is set to one.

Command Modes

DHCP IPv6 configuration

Command History

Release

Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

Use this command only on routers that are configured as DHCP relay agents. You can only configure this command in the DHCP IPv6 mode and not on DHCP IPv4 mode.

Task ID

Task ID

Operations

ip-services

read, write

Examples

The following is an example of the hop-seed-count command:
Router# config
Router(config)# dhcp ipv6
Router(dhcp-ipv6)# hop-count-seed

iana-route-add

To enable route addition for identity association for non-temporary address (IANA), use the iana-route-add command in DHCPv6 relay profile configuration submode. To disable route addition to IANA, use the no form of this command.

iana-route-add

no iana-route-add

Syntax Description

This command has no keywords or arguments.

Command Default

Disabled.

Command Modes

DHCP IPv6 relay profile configuration submode

Command History

Release Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

The DHCPv6 relay is capable of installing routes for multiple identity association for prefix delegation (IAPD) options within a DHCPv6 message. The route addition for IAPD is enabled by default. The DHCPv6 relay is capable of installing routes for IANA as well, but this feature is disabled by default. Users can enable the route addition to IANA feature by using iana-route-add command in DHCPv6 relay profile configuration submode.

Task ID

Task ID Operation

ip-services

read, write

Examples

This example shows how to enable route addition to IANA:

Router# config
Router(config)# dhcp ipv6
Router(config-dhcpv6)# profile client relay
Router(config-dhcpv6-relay-profile)# iana-route-add

profile (DHCP)

To configure a DHCP relay profile, use the profile command in DHCP IPv4 or DHCP IPv6 configuration mode. To disable this feature and exit the profile mode, use the no form of this command.

profile name relay

no profile name relay

Syntax Description

name

Name that uniquely identifies the relay or snoop profile.

relay

Configures a DHCP relay profile. A DHCP relay agent is a host that forwards DHCP packets between clients and servers. When the clients and servers are not on the same physical subnet, the relay agents are used to forward requests and replies between them.

A DHCP relay agent is any host that forwards DHCP packets between clients and servers. Relay agents are used to forward requests and replies between clients and servers when they are not on the same physical subnet. Relay agent forwarding is distinct from the normal forwarding of an IP router, where IP datagrams are switched between networks rather transparently. By contrast, relay agents receive 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 (option82) in the packet and forwards it to the DHCP server. The reply from the server is forwarded back to the client after removing option 82.

Command Default

None

Command Modes

DHCP IPv4 configuration

DHCP IPv6 configuration

Command History

Release

Modification

Release 7.2.12

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 example shows how to use the profile command to configure DHCP IPv6 relay profile:


Router(config)# dhcp ipv6
Router(config-dhcpv6)# profile TEST relay
Router(config-dhcpv6-relay-profile)#


This example shows how to use the profile command to configure DHCP IPv4 relay profile:


Router(config)# dhcp ipv4
Router(config-dhcpv4)# profile TEST relay
Router(config-dhcpv4-relay-profile)#


relay information

To configure Dynamic Host Configuration Protocol (DHCP) IPv4 relay information options, use the relay information command in DHCP IPv4 relay profile configuration submode. To restore the default relay information policy, use the no form of this command.

relay information { check | option [ allow-untrusted | remote-id format-type { ascii ascii-value | hex hex-value } | subscriber-id subscriber-value | vpn | vpn-mode { cisco | rfc } ] | policy { drop | encapsulate | keep } }

no relay information { check | option [ allow-untrusted | remote-id format-type { ascii ascii-value | hex hex-value } | subscriber-id subscriber-value | vpn | vpn-mode { cisco | rfc } ] | policy { drop | encapsulate | keep } }

Syntax Description

check

Validates the relay agent information option in forwarded BOOTREPLY messages.

option

Configures relay agent information options in forwarded BOOTREQUEST messages.

allow-untrusted

Forwards untrusted packets.

remote-id format-type

Configures the value of the remote-id in either ascii or hex format.

subscriber-id subscriber-value

Configures the value of the subscriber-id

vpn

Configures VPN suboptions in forwarded BOOTREQUEST messages.

vpn-mode

Configures VPN suboptions mode either in CISCO proprietary or RFC compliance.

policy

Configures relay agent information option policy

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.

encapsulate

Encapsulates the DHCP relay agent information option received from a prior relay agent in forwarded BOOTREQUEST messages.

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 7.2.12

This command was introduced.

Usage Guidelines

The encapsulate keyword allows the second relay agent to encapsulate option 82 information in a message received from the first relay agent, if it is also configured to add its own option 82 information. This configuration allows the DHCP server to use option 82 information from both relay agents.

Task ID

Task ID Operation

ip-services

read, write

basic-services

read, write

Examples

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

Router# config
Router(config)# dhcp ipv4
Router(config-dhcpv4)# profile TEST relay
Router(config-dhcpv4-relay-profile)# relay information policy keep

This example shows how to encapsulate the DHCP relay agent information option:

Router# config
Router(config)# dhcp ipv4
Router(config-dhcpv4)# profile TEST relay
Router(config-dhcpv4-relay-profile)# relay information policy encapsulate

show dhcp ipv4 relay

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

show dhcp ipv4 relay { profile [ name profile-name ] | statistics [ detail ] } [ location node-id ]

Syntax Description

profile name profile-name

(Optional) Displays the profile name.

statistics

(Optional) Displays the profile statistics.

location node-id

(Optional) Displays the information for the specified node.

Command Default

No default behavior or values

Command History

Release

Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

ip-services

read

Examples

The following is sample output from the show dhcp ipv4 relay statistics command when none of the optional keywords or arguments are used command:

Router# show dhcp ipv4 relay statistics

                  Bridge              |      RX       |      TX       |       DR      |
---------------------------------------------------------------------------------------
 default                              |            0  |            0  |            0  |

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

Router# show dhcp ipv4 relay profile
DHCP IPv4 Relay Profiles
--------------------------
r1
r2

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

Router# show dhcp ipv4 relay profile name R1
DHCP IPv4 Relay Profile R1:

Helper Addresses:
10.10.10.1, vrf default
Information Option: Disabled
Information Option Allow Untrusted: Disabled
Information Option Policy: Replace
Information Option Check: Disabled
Giaddr Policy: Keep
Broadcast-flag Policy: Ignore

VRF References:
default
Interface References:
FINT0_RP0_CPU0
MgmtEth0_RP0_CPU0_0

show dhcp ipv6 relay binding

To display DHCPv6 client bindings for relay, use the show dhcp ipv6 relay binding command in XR EXEC mode.

show dhcp ipv6 relay binding [ client-duid client-duid-number ] [ [detail] ] | [ [ interface type interface-path-id ] ] | [ [ location node-id ] ] | [ [summary] ] | [ vrf vrf-name ]

Syntax Description

client-duid client-duid-number

(Optional) Displays DHCPv6 relay client binding information.

The argument client-duid-number is the client's DHCP Unique Identifier (DUID) number.

Note

 

Use the show dhcp ipv6 relay binding command to see the client DUID number.

detail

(Optional) Displays detailed DHCPv6 relay client binding information for all clients.

interface type interfac-path-id

(Optional) Displays DHCPv6 relay client binding by interface.

Specifies a physical interface or a virtual interface.

Note

 

Use the show interfaces command to see a list of all possible interfaces currently configured on the router.

location node-id

(Optional) Displays detailed DHCPv6 relay client binding information for a specified node.

The node-id argument is entered in the rack/slot/module notation.

summary

(Optional) Displays the summary of DHCPv6 relay client binding.

vrf vrf-name

(Optional) Displays DHCPv6 relay client binding information for a VPN routing and forwarding (VRF) instance.

Command Default

None.

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation

ip-services

read

Examples

This is the sample output for show dhcp ipv6 relay binding command:

Router# show dhcp ipv6 relay binding
Summary:
Total number of clients: 1

IPv6 Address: fc00:35:0:ef5c:a932:239f:1b0e:e4ed/128 (BVI3500)
    Client DUID: 000100011b626e6f0000cae2da26
    IAID: 0x0
    VRF: default
    Lifetime: 172800 secs (2d00h)
    Expiration: 172766 secs (1d23h)

show dhcp ipv6 relay statistics

To display DHCPv6 relay statistics, use the show dhcp ipv6 relay statistics command in XR EXEC mode.

show dhcp ipv6 relay statistics [ vrf vrf-name ] | [ detail ] [ location node-id ]

Syntax Description

detail

(Optional) Displays DHCPv6 relay statistics information in details.

location node-id

(Optional) Displays DHCPv6 relay debug statistics information for for a specified node.

The node-id argument is entered in the rack/slot/module notation.

vrf vrf-name

(Optional) Displays DHCPv6 relay statistics information for a VPN routing and forwarding (VRF) instance.

location node-id

(Optional) Displays detailed DHCPv6 relay statistics information for a specified node.

The node-id argument is entered in the rack/slot/module notation.

Command Default

None.

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 7.2.12

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation

ip-services

read

Examples

This is the sample output for show dhcp ipv6 relay statistics command:

Router# show dhcp ipv6 relay statistics
                  VRF                     |      RX       |      TX       |       DR      |
-------------------------------------------------------------------------------------------
default                                  |          241  |            5  |          236  |
**nVSatellite                            |            0  |            0  |            0  |
red4                                     |            0  |            0  |            0  |
red6                                     |            0  |            0  |            0  |
**eint                                   |            0  |            0  |            0  |

vrf (relay profile)

To configure a relay profile on a VPN routing and forwarding (VRF) instance, use the vrf (relay profile) command in Dynamic Host Configuration Protocol (DHCP) IPv4 configuration mode. To disable this feature, use the no form of this command.

vrf { vrf-name | default | all } relay [ profile profile-name ]

no vrf { vrf-name | default | all } relay [ profile profile-name ]

Syntax Description

vrf-name

User-defined name for the VRF.

default

Specifies a profile for the default VRF.

all

Specifies a profile for all VRFs.

relay

Specifies a relay profile.

profile profile-name

Specifies a name for the profile.

Command Default

If default is selected, then the configuration defaults to VRF.

Command Modes

DHCP IPv4 configuration

Command History

Release

Modification

Release 7.2.12

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 set the relay profile for all VRFs:


Router# config
Router(config)# dhcp ipv4
Router(config-dhcpv4)# vrf all