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 ipv4 client

To clear the DHCP client binding information configured on a given interface and set the binding information again, use the clear dhcp ipv4 client command in XR EXEC mode.

clear dhcp ipv4 client <interfaceName>

Syntax Description

interfaceName

Clears and restarts the DHCP IPv4 information of the specified interface.

Command Default

No default behavior or values

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 25.1.1

This command was introduced.

Usage Guidelines

Use the clear dhcp ipv4 client command to clear the DHCP client binding information for the specified interface.

Task ID

Task ID

Operations

IP-Services

Execution

Examples

The following example shows how to clear the DHCP client binding information:

Router# clear dhcp ipv4 client mgmtEth 0/0/CPU0/0 
Fri Jun  6 08:24:14.558 UTC
Router# show dhcp ipv4 client                               
Fri Jun  6 08:24:17.377 UTC

    Interface name         IP Address      Binding State         Lease Time Rem
----------------------    ------------    ---------------    ----------------------
MgmtEth0/0/CPU0/0          11.11.11.5       BOUND             3598 secs (00:59:58)

Router# show dhcp ipv4 client mgmtEth 0/0/CPU0/0 statistics 
Fri Jun  6 08:24:19.397 UTC

Client Interface name           : MgmtEth0/0/CPU0/0
-------------------------------------------------
     CLIENT COUNTER(s)          |        VALUE   
-------------------------------------------------
Num discovers sent              :          1
Num requests sent               :          1
Num releases sent               :          1
Num offers received             :          1
Num acks received               :          1
-------------------------------------------------


clear dhcp ipv4 client statistics

To clear DHCP client binding statistics information for a given interface, use the clear dhcp ipv4 client statistics command in XR EXEC mode.

clear dhcp ipv4 client <interface-name> interface-number statistics

Syntax Description

interface-name

Specifies DHCP IPv4 client enabled interface name.

interface-number

Specifies DHCP IPv4 client enabled interface number.

statistics

Clears DHCP IPv4 statistical information for the specified interface.

Command Default

No default behavior or values

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 25.1.1

This command was introduced.

Usage Guidelines

Use the clear dhcp ipv4 client statistics command to clear the DHCP client binding statistics information for the specified interface.

Task ID

Task ID

Operations

IP-Services

Execution

Examples

The following example shows how to clear the DHCP client binding statistics information:


Router#show dhcp ipv4 client mgmtEth 0/0/CPU0/0 statistics 
Fri Jun  6 08:23:04.822 UTC

Client Interface name           : MgmtEth0/0/CPU0/0
-------------------------------------------------
     CLIENT COUNTER(s)          |        VALUE   
-------------------------------------------------
Num discovers sent              :         11
Num requests sent               :          3
Num releases sent               :          2
Num offers received             :          3
Num acks received               :          3
-------------------------------------------------

Router#clear dhcp ipv4 client mgmtEth 0/0/CPU0/0 statistics 
Fri Jun  6 08:23:11.852 UTC
Router#show dhcp ipv4 client mgmtEth 0/0/CPU0/0 statistics  
Fri Jun  6 08:23:13.682 UTC

Client Interface name           : MgmtEth0/0/CPU0/0
-------------------------------------------------
     CLIENT COUNTER(s)          |        VALUE   
-------------------------------------------------
-------------------------------------------------

Router#show dhcp ipv4 client                                
Fri Jun  6 08:23:16.862 UTC

    Interface name         IP Address      Binding State         Lease Time Rem
----------------------    ------------    ---------------    ----------------------
MgmtEth0/0/CPU0/0          11.11.11.5       BOUND             3562 secs (00:59:22)

clear dhcp ipv6 client statistics

To clear DHCP client binding statistics information for a given interface, use the clear dhcp ipv6 client statistics command in XR EXEC mode.

clear dhcp ipv6 client <interface-name> interface-number statistics

Syntax Description

interface-name

Specifies DHCP IPv6 client enabled interface name.

interface-number

Specifies DHCP IPv6 client enabled interface number.

statistics

Clears DHCP IPv6 statistical information for the specified interface.

Command Default

No default behavior or values

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 25.1.1

This command was introduced.

Usage Guidelines

Use the clear dhcp ipv6 client statistics command to clear the DHCP IPv6 client binding statistics information for the specified interface.

Task ID

Task ID

Operations

IP-Services

Execution

Examples

The following example shows how to clear the DHCP IPv6 client binding statistics information:


Router#show dhcp ipv6 client mgmtEth 0/0/CPU0/0 statistics 
Fri Jun  6 08:23:04.822 UTC

Client Interface name           : MgmtEth0/0/CPU0/0
-------------------------------------------------
     CLIENT COUNTER(s)          |        VALUE   
-------------------------------------------------
Num discovers sent              :         11
Num requests sent               :          3
Num releases sent               :          2
Num offers received             :          3
Num acks received               :          3
-------------------------------------------------

Router#clear dhcp ipv6 client mgmtEth 0/0/CPU0/0 statistics 
Fri Jun  6 08:23:11.852 UTC
Router#show dhcp ipv6 client mgmtEth 0/0/CPU0/0 statistics  
Fri Jun  6 08:23:13.682 UTC

Client Interface name           : MgmtEth0/0/CPU0/0
-------------------------------------------------
     CLIENT COUNTER(s)          |        VALUE   
-------------------------------------------------
-------------------------------------------------

Router#show dhcp ipv6 client                                
Fri Jun  6 08:23:16.862 UTC

    Interface name         IP Address      Binding State         Lease Time Rem
----------------------    ------------    ---------------    ----------------------
MgmtEth0/0/CPU0/0          2001:DB8::1       BOUND             3562 secs (00:59:22)

clear dhcp ipv6 client

To clear the DHCPv6 client binding information configured on a given interface and set the binding information again, use the clear dhcp ipv6 client command in XR EXEC mode.

clear dhcp ipv6 client interface-type <interfaceName> { binding | statistics }

Syntax Description

interface-type <interfaceName>

Clears and restarts the DHCP IPv6 information of the specified interface.

binding

Clears client binding.

statistics

Clears client binding statistics.

Command Default

No default behavior or values

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 25.1.1

This command was introduced.

Usage Guidelines

Use the clear dhcp ipv6 client command to clear the DHCP client binding information for the specified interface.

Task ID

Task ID

Operations

IP-Services

Execution

Examples

The following example shows how to clear the DHCP client binding information:

Router# clear dhcp ipv6 client mgmtEth 0/0/CPU0/0 binding
Fri Jun  6 08:24:14.558 UTC
Router# show dhcp ipv6 client                               
Fri Jun  6 08:24:17.377 UTC

    Interface name         IP Address      Binding State         Lease Time Rem
----------------------    ------------    ---------------    ----------------------
MgmtEth0/0/CPU0/0          2001:DB8::1       BOUND             3598 secs (00:59:58)

RP/0/0/CPU0:ios# show dhcp ipv6 client mgmtEth 0/0/CPU0/0 statistics 
Fri Jun  6 08:24:19.397 UTC

Client Interface name           : MgmtEth0/0/CPU0/0
-------------------------------------------------
     CLIENT COUNTER(s)          |        VALUE   
-------------------------------------------------
Num discovers sent              :          1
Num requests sent               :          1
Num releases sent               :          1
Num offers received             :          1
Num acks received               :          1
-------------------------------------------------


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 dhcpv6 relay source address ]

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

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.

dhcpv6 relay source address

Specifies the DHCPv6 relay source address.

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.

Release 25.1.1

The dhcpv6 relay source address variable 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 

Examples

This is a sample output that shows how to set DHCPv6 relay source address by the helper-address command


Router# configure terminal
Router(config)# dhcp ipv6
Router(config-dhcpv6)# profile test relay
Router(config-dhcpv6-relay-profile)# helper-address vrf default 2011::3 TenGigE0/0/0/0  1001::10 
Router(config-dhcpv6-relay-profile)# helper-address vrf default 2011::4 
Router(config-dhcpv6-relay-profile)# source-interface TenGigE0/1/0/0  1001::1 
Router(config-dhcpv6-relay-profile)# !
Router(config-dhcpv6-relay-profile)# interface Bundle-Ether1 relay profile test
Router(config-dhcpv6-relay-profile)# commit
Router(config-dhcpv6)# !

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

ipv6 address dhcp-client-options

To configure the DHCPv6 client options, use the ipv6 address dhcp-client-options command in the interface configuration submode.

ipv6 address dhcp-client-options { duid linked-layer-address | options { 15 user-class-id | 16 vendor-id | 23 | 24 } | rapid-commit | timers { release-timeout release-timeout-value | req-max-rt req-max-rt-value | req-timeout req-timeout-value | sol-max-delay sol-max-delay-value | sol-max-rt sol-max-rt-value | sol-time-out sol-time-out-value } }

Syntax Description

duid

Enables DHCPv6 client to communicate with the DHCPv6 server through the link layer address.

rapid-commit

Obtains configuration parameters from the DHCPv6 server through a rapid two-step exchange (solicit and reply) instead of the default four-step exchange (solicit, advertise, request, and reply).

options

Configures DHCPv6 options that can be configured on a DHCPv6 client other than duid or rapid-commit options.

timers

Configures the different timer values for DHCP client configurations.

release-timeout release-timeout-value

Configures the retransmission timeout value for the initial release message in seconds.

req-max-rt req-max-rt-value

Configures the maximum retransmission timeout value for the request message.

req-timeout req-timeout-value

Configures the initial request timeout value of the request message.

sol-max-delay sol-max-delay-value

Configures the maximum delay time of the first solicit message.

sol-max-rt sol-max-rt-value

Configures the maximum solicit retransmission time.

sol-max-rt sol-max-rt-value

Configures the intial timeout value of the solicit message.

Command Default

None

Command Modes

Interface Configuration

Command History

Release Modification

Release 25.1.1

This command was introduced.

Task ID

Task ID Operation
ipv6

read, write

network

read, write

Examples

The following example shows you how to configure the release-timeout timer option:


Router# configure
Router(config)# interface BVI 10
Router(config-if)# ipv6 address dhcp-client-options
Router(config-dhcpv6-client)# timers release-timeout 3
Router(config-dhcpv6-client)# commit

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 client

To display DHCP client binding information, use the show dhcp ipv4 client command in XR EXEC mode.

show dhcp ipv4 client <interfaceName> [detail] [debug]

Syntax Description

interfaceName

Displays the DHCP IPv4 address of the specified interface.

detail

(Optional) Specifies detailed results.

debug

(Optional) Displays internal debugging information.

Command Default

No default behavior or values

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 25.1.1

This command was introduced.

Usage Guidelines

Use the show dhcp ipv4 client command to display the DHCP IPv4 for the specified client.

Task ID

Task ID

Operations

IP-Services

read

Examples

The following example shows how to display DHCP IPv4 binding information:

Router# show dhcp ipv4  client 
Mon May  6 16:35:32.581 UTC

    Interface name                     IP Address           Binding State         Lease Time Rem
----------------------                ------------         ---------------     ----------------------
MgmtEth0_0_CPU0_0                    192.168.190.130            BOUND           1688 secs (00:28:08)

Router#
Router# show dhcp ipv4  client binding ?
  MgmtEth          Ethernet/IEEE 802.3 interface(s)
  detail           Show detailed client binding information
  |                Output Modifiers
  <cr>
Router# show dhcp ipv4  client   detail
Mon May  6 16:35:56.579 UTC

-----------------------------------------------------
Client Interface name         : MgmtEth0_0_CPU0_0
Client Interface handle       : 0x1280
Client Interface VRF name     : default
Client ChAddr                 : 000c.292f.950e
Client ID                     : MgmtEth0_0_CPU0_0
Client State                  : BOUND
Client IP Address (Dhcp)      : 192.168.190.130
Client IP Address Mask        : 255.255.255.0
Client Lease Time Allocated   : 1800 secs (00:30:00)
Client Lease Time Remaining   : 1664 secs (00:27:44)
Client Selected Server Addr   : 192.168.190.254
-----------------------------------------------------

Router#
Router# show dhcp ipv4  client binding detail ?
  MgmtEth          Ethernet/IEEE 802.3 interface(s)
  debug            Show detailed debug level client binding information
  |                Output Modifiers
  <cr>
Router# show dhcp ipv4  client detail debug
Mon May  6 16:36:43.836 UTC

-----------------------------------------------------
Client Interface name         : MgmtEth0_0_CPU0_0
Client Interface handle       : 0x1280
Client Interface VRF name     : default
Client ChAddr                 : 000c.292f.950e
Client ID                     : MgmtEth0_0_CPU0_0
Client State                  : BOUND
Client IP Address (Dhcp)      : 192.168.190.130
Client IP Address Mask        : 255.255.255.0
Client Lease Time Allocated   : 1800 secs (00:30:00)
Client Lease Time Remaining   : 1617 secs (00:26:57)
Client Selected Server Addr   : 192.168.190.254
Client Interface VRF id       : 0x60000000
Client Interface VRF Table id : 0xe0000000
Client XID                    : 0xa7f
Client Timers Running         : 0x2 (T1_RENEW_TIMER)
Client Renew Time Allocated   : 900 secs (00:15:00)
Client Renew Time Adjusted    : 900 secs (00:15:00)
Client Rebind Time Allocated  : 1575 secs (00:26:15)
Client Rebind Time Adjusted   : 1575 secs (00:26:15)
Client Checkpoint object id   : 0x80002fd8
Client IPv4 MA configured     : TRUE
-----------------------------------------------------

Router#
Router# show dhcp ipv4 client  mgmtEth 0/0/CPU0/0
Mon May  6 16:49:54.382 UTC

    Interface name         IP Address      Binding State         Lease Time Rem
----------------------    ------------    ---------------    ----------------------
MgmtEth0_0_CPU0_0          192.168.190.130  BOUND             1727 secs (00:28:47)
Router#

show dhcp ipv4 client statistics

To display DHCP client statistical information, use the show dhcp ipv4 client statistics command in XR EXEC mode.

show dhcp ipv4 client interfaceName interface-number statistics

Syntax Description

interfaceName

Displays the DHCP IPv4 statistical information of the specified interface.

statistics

Applies a statistics template and enable statistics collection.

Command Default

No default behavior or values

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 25.1.1

This command was introduced.

Usage Guidelines

Use the show dhcp ipv4 client statistics command to display the DHCP IPv4 statistical information for the specified client.

Task ID

Task ID

Operations

IP-Services

read

Examples

The following example shows how to display the DHCP IPv4 statistics information:


Router#show dhcp ipv4 client binding mgmtEth 0/0/CPU0/0 statistics
Mon May  6 16:49:46.402 UTC

-----------------------------------------------------
Client Interface name         : MgmtEth0_0_CPU0_0
Client State                  : BOUND
-----------------------------------------------------
               TOTAL STATISTICS
-----------------------------------------------------
DISCOVERS SENT                : 1
OFFERS    SENT                : 1
OFFERS    RECEIVED            : 1
ACKS      RECEIVED            : 1
RELEASE   SENT                : 1
RESYNC    SENT TO IM          : 1
IPV4_MA   CFG SENT            : 1
IPV4_MA   CFG SUCCESS         : 1
INIT      TIMER STARTED       : x
T1-RENEW  TIMER STARTED       : x
T2_REBIND TIMER STARTED       : x
LEASE     TIMER STARTED       : x
INIT      TIMER STOPPED       : x
T1-RENEW  TIMER STOPPED       : x
T2_REBIND TIMER STOPPED       : x
LEASE     TIMER STOPPED       : x

-----------------------------------------------------
               ERROR COUNTERS
-----------------------------------------------------
OFFERS    IGNORED             : 1
ACK       IGNORED             : 1
DECLINE   SENT                : 1
NACK      RECEIVED            : 1
INVALID   OFFERS RECEIVED     : 1
INVALID   ACKS RECEIVED       : 1
IPV4_MA   CFG FAILED          : 0
IPV4_MA   CFG FAILED REASON   : "..."
IM        RESYNC ERROR REASON : "..."

show dhcp ipv6 client

To display DHCP IPv6 client binding information, use the show dhcp ipv6 client command in XR EXEC mode.

show dhcp ipv6 client <interfaceName> [detail] [debug]

Syntax Description

interfaceName

Displays the DHCP IPv6 address of the specified interface.

detail

(Optional) Specifies detailed results.

debug

(Optional) Displays internal debugging information.

Command Default

No default behavior or values

XR EXEC mode

Command History

Release

Modification

Release 25.1.1

This command was introduced.

Usage Guidelines

Use the show dhcp ipv6 client command to display the DHCP IPv6 for the specified client.

Task ID

Task ID

Operations

IP-Services

read

Examples

The following example shows how to display DHCP IPv6 binding information:

Router#show dhcp ipv6  client 
Mon May  6 16:35:32.581 UTC

    Interface name          IP Address        Binding State         Lease Time Rem
----------------------     ------------      ---------------   ----------------------
MgmtEth0_0_CPU0_0          2001:DB8::1        BOUND             1688 secs (00:28:08)

Router#
Router# show dhcp ipv6  client binding ?
  MgmtEth          Ethernet/IEEE 802.3 interface(s)
  detail           Show detailed client binding information
  |                Output Modifiers
  <cr>
Router# show dhcp ipv6  client   detail
Mon May  6 16:35:56.579 UTC

-----------------------------------------------------
Client Interface name         : MgmtEth0_0_CPU0_0
Client Interface handle       : 0x1280
Client Interface VRF name     : default
Client ChAddr                 : 000c.292f.950e
Client ID                     : MgmtEth0_0_CPU0_0
Client State                  : BOUND
Client IP Address (Dhcp)      : 2001:DB8::1
Client IP Address Mask        : 2001:db8:abcd:0012::0/64
Client Lease Time Allocated   : 1800 secs (00:30:00)
Client Lease Time Remaining   : 1664 secs (00:27:44)
Client Selected Server Addr   : 2001:DB8::2
-----------------------------------------------------

Router#
Router# show dhcp ipv6  client binding detail ?
  MgmtEth          Ethernet/IEEE 802.3 interface(s)
  debug            Show detailed debug level client binding information
  |                Output Modifiers
  <cr>
Router# show dhcp ipv6  client detail debug
Mon May  6 16:36:43.836 UTC

-----------------------------------------------------
Client Interface name         : MgmtEth0_0_CPU0_0
Client Interface handle       : 0x1280
Client Interface VRF name     : default
Client ChAddr                 : 000c.292f.950e
Client ID                     : MgmtEth0_0_CPU0_0
Client State                  : BOUND
Client IP Address (Dhcp)      : 2001:DB8::1
Client IP Address Mask        : 2001:db8:abcd:0012::0/64
Client Lease Time Allocated   : 1800 secs (00:30:00)
Client Lease Time Remaining   : 1617 secs (00:26:57)
Client Selected Server Addr   : 2001:DB8::2
Client Interface VRF id       : 0x60000000
Client Interface VRF Table id : 0xe0000000
Client XID                    : 0xa7f
Client Timers Running         : 0x2 (T1_RENEW_TIMER)
Client Renew Time Allocated   : 900 secs (00:15:00)
Client Renew Time Adjusted    : 900 secs (00:15:00)
Client Rebind Time Allocated  : 1575 secs (00:26:15)
Client Rebind Time Adjusted   : 1575 secs (00:26:15)
Client Checkpoint object id   : 0x80002fd8
Client IPv6 MA configured     : TRUE
-----------------------------------------------------

Router#
Router# show dhcp ipv6 client  mgmtEth 0/0/CPU0/0
Mon May  6 16:49:54.382 UTC

    Interface name         IP Address      Binding State         Lease Time Rem
----------------------    ------------    ---------------    ----------------------
MgmtEth0_0_CPU0_0          2001:DB8::1     BOUND             1727 secs (00:28:47)
Router#

show tech support dhcp ipv4 client

To retrieve the DHCP client show tech support information, use the show tech dhcp ipv4 client command in XR EXEC mode.

show tech-support dhcp ipv4 client <show-tech-options>

Syntax Description

show-tech-options

Displays the DHCP IPv4 client show tech-support options.

Command Default

No default behavior or values

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 25.1.1

This command was introduced.

Usage Guidelines

Use the show tech-support dhcp ipv4 client command to retrieve the DHCP show-tech options for the specified interface.

Task ID

Task ID

Operations

IP-Services

Execution

Examples

The following example shows how to clear the DHCP client binding statistics information:


Router# show tech-support dhcp ipv4 client ?
  file      Specify a valid file name (e.g. disk0:tmp.log)(cisco-support)
  terminal  Send output to terminal(cisco-support)
Router# show tech-support dhcp ipv4 client file ?
  WORD        Send to file
  bootflash:  Send to bootflash: file system(cisco-support)
  disk0:      Send to disk0: file system(cisco-support)
  disk0a:     Send to disk0a: file system(cisco-support)
  disk1:      Send to disk1: file system(cisco-support)
  disk1a:     Send to disk1a: file system(cisco-support)
  ftp:        Send to ftp: file system(cisco-support)
  nvram:      Send to nvram: file system(cisco-support)
  rcp:        Send to rcp: file system(cisco-support)
  tftp:       Send to tftp: file system(cisco-support)
Router# show tech-support dhcp ipv4 client file disk0?
WORD  disk0:  disk0a:  
Router# show tech-support dhcp ipv4 client file disk0:/dhcpv4-client-showtech.tgz
Fri Jun  6 08:25:24.793 UTC
Router# dir disk0:   
Fri Jun  6 08:25:47.321 UTC

Directory of disk0:

2           drwx  1024        Thu Mar 13 06:12:03 2014  .boot
…
3           -rw-  83337       Fri Jun  6 08:25:26 2014  dhcpv4-client-showtech.tgz

1911537664 bytes total (1838081024 bytes free)
Router# 

show tech-support dhcp ipv6 client

To retrieve the DHCP client show tech support information, use the show tech dhcp ipv6 client command in XR EXEC mode.

show tech-support dhcp ipv6 client <show-tech-options>

Syntax Description

show-tech-options

Displays the DHCP IPv6 client show tech-support options.

Command Default

No default behavior or values

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 25.1.1

This command was introduced.

Usage Guidelines

Use the show tech-support dhcp ipv6 client command to retrieve the DHCP show-tech options for the specified interface.

Task ID

Task ID

Operations

IP-Services

Execution

Examples

The following example shows how to display the DHCP IPv6 client binding statistics information:


Router# show tech-support dhcp ipv6 client ?
  file      Specify a valid file name (e.g. disk0:tmp.log)(cisco-support)
  terminal  Send output to terminal(cisco-support)
Roiuter# show tech-support dhcp ipv6 client file ?
  WORD        Send to file
  bootflash:  Send to bootflash: file system(cisco-support)
  disk0:      Send to disk0: file system(cisco-support)
  disk0a:     Send to disk0a: file system(cisco-support)
  disk1:      Send to disk1: file system(cisco-support)
  disk1a:     Send to disk1a: file system(cisco-support)
  ftp:        Send to ftp: file system(cisco-support)
  nvram:      Send to nvram: file system(cisco-support)
  rcp:        Send to rcp: file system(cisco-support)
  tftp:       Send to tftp: file system(cisco-support)
Router# show tech-support dhcp ipv4 client file disk0?
WORD  disk0:  disk0a:  
Router# show tech-support dhcp ipv6 client file disk0:/dhcpv4-client-showtech.tgz
Fri Jun  6 08:25:24.793 UTC
Router# dir disk0:   
Fri Jun  6 08:25:47.321 UTC

Directory of disk0:

2           drwx  1024        Thu Mar 13 06:12:03 2014  .boot
…
3           -rw-  83337       Fri Jun  6 08:25:26 2014  dhcpv6-client-showtech.tgz

1911537664 bytes total (1838081024 bytes free)
Router#

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