DHCPv6 Commands

This chapter contains the following sections:

clear ipv6 dhcp client

To restart DHCP for an IPv6 client on an interface, use the clear ipv6 dhcp client command in Privileged EXEC mode.

Syntax

clear ipv6 dhcp client interface-id

Parameters

  • interface-id—Interface identifier.

Command Mode

Privileged EXEC mode

User Guidelines

This command restarts DHCP for an IPv6 client on a specified interface after first releasing and unconfiguring previously-acquired prefixes and other configuration options (for example, Domain Name System [DNS] servers).

Example

The following example restarts the DHCP for IPv6 client on VLAN 100:

switchxxxxxx# clear ipv6 dhcp client vlan 100

ipv6 address dhcp

To enable DHCP for an IPv6 client process and acquire an IPv6 address on an interface, use the ipv6 address dhcp command in Interface Configuration mode. To remove the address from the interface, use the no form of this command.

Syntax

ipv6 address dhcp [rapid-commit]

no ipv6 address dhcp

Parameters

  • rapid-commit—Allows the two-message exchange method for address assignment.

Default Configuration

No IPv6 addresses are acquired from the DHCPv6 server.

Command Mode

Interface (VLAN) Configuration mode

Interface (Ethernet, Port Channel, OOB) Configuration mode

User Guidelines

This command enables IPv6 on an interface (if it is not enabled) and starts the DHCP for IPv6 client process, if this process is not yet running and if an IPv6 interface is enabled on the interface. This command allows an interface to dynamically learn its IPv6 address by using DHCPv6 and enables the DHCPv6 Stateless service.

The rapid-commit keyword enables the use of the two-message exchange for address allocation and other configuration. If it is enabled, the client includes the rapid-commit option in a solicit message.

This command allows an interface to dynamically learn its IPv6 address by using DHCPv6.

The DHCPv6 stateless service allows to receive the configuration from a DHCP server, passed in the following options:

  • Option 7: OPTION_PREFERENCE - The preference value for the server in this message

  • Option 12: OPTION_UNICAST - The IP address to which the client should send messages delivered using unicast

  • Option 23: OPTION_DNS_SERVERS - List of DNS Servers IPv6 Addresses

  • Option 24: OPTION_DOMAIN_LIST - Domain Search List

  • Option 31: OPTION_SNTP_SERVERS - List of SNTP Servers IPv6 Addresses

  • Option 32: OPTION_INFORMATION_REFRESH_TIME - Information Refresh Time Option

  • Option 41: OPTION_NEW_POSIX_TIMEZONE - New Timezone Posix String

  • Option 59: OPT_BOOTFILE_URL - Configuration Server URL

    Option 60: OPT_BOOTFILE_PARAM, the first parameter - Configuration File Path Name

The DHCPv6 client uses the following IAID format based on the interface-id on which it is running:

  • Octet 1, bits 7-4: These bits are reserved and must be 0

  • Octet 1, Bits 3-0: These bits contain the interface type:

    0—VLAN

    • 1—Ethernet port

    • 2—Port channel

    • 3—Tunnel

  • Octets 2-4: The octets contain a value depending on the interface type in the network format:

    • VLAN

Octet 2: Reserved, must be 0

Octets 3-4: VLAN ID (1-4095)

  • Ethernet port

Octet 2, bits 7-4: Slot number

Octet 2, bits 3-0: Port Type:

0—Ethernet

1—Fast Ethernet

2—Giga Ethernet

3—2.5 Giga Ethernet

4—5 Giga Ethernet

5—10 Giga Ethernet

6—12 Giga Ethernet

7—13.6 Giga Ethernet

8—16 Giga Ethernet

9—20 Giga Ethernet

10—40 Giga Ethernet

11—100 Giga Ethernet

Octet 3: Unit number

Octet 4: Port number

  • Port channel

Octets 2-3: Reserved, must be 0

Octet 4: Port channel number

  • Tunnel

Octets 2-3: Reserved, must be 0

Octet 4: Tunnel number

When IPv6 Forwarding is enabled only stateless information is required from a DHCPv6 server.

When IPv6 forwarding is changed from disabled to enabled, IPv6 addresses assigned by a DHCPv6 are removed.

When IPv6 forwarding is changed from enabled to disabled receiving IPv6 addresses from a DHCPv6 server is resumed.

The DHCPv6 client, server, and relay functions are mutually exclusive on an interface.

Example

The following example enables IPv6 on VLAN 100 and acquires an IPv6 address:

switchxxxxxx(config)# interface vlan 100
switchxxxxxx(config-if)# ipv6 address dhcp
switchxxxxxx(config-if)# exit

ipv6 dhcp client information refresh

To configure the refresh time for IPv6 client information refresh time on a specified interface if the DHCPv6 server reply does not include the Information Refresh Time, use the ipv6 dhcp client information refresh command in Interface Configuration mode. To return to the default value of the refresh time, use the no form of this command.

Syntax

ipv6 dhcp client information refresh seconds | infinite

no ipv6 dhcp client information refresh

Parameters

  • seconds—The refresh time, in seconds. The value cannot be less than the minimal acceptable refresh time configured by the ipv6 dhcp client information refresh command. The maximum value that can be used is 4,294967,294 seconds (0xFFFFFFFE).

  • infinite—Infinite refresh time.

Default Configuration

The default is 86,400 seconds (24 hours).

Command Mode

Interface Configuration mode

User Guidelines

The ipv6 dhcp client information refresh command specifies the information refresh time. If the server does not sends an information refresh time option then a value configured by the command is used.

Use the infinite keyword, to prevent refresh, if the server does not send an information refresh time option.

Example

The following example configures an upper limit of 2 days:

switchxxxxxx(config)# interface vlan 100
switchxxxxxx(config-if)# ipv6 dhcp client information refresh 172800
switchxxxxxx(config-if)# exit

ipv6 dhcp client information refresh minimum

To configure the minimum acceptable refresh time on the specified interface, use the ipv6 dhcp client information refresh minimum command in Interface Configuration mode. To remove the configured refresh time, use the no form of this command.

Syntax

ipv6 dhcp client information refresh minimum seconds | infinite

no ipv6 dhcp client information refresh minimum

Parameters

  • seconds—The refresh time, in seconds. The minimum value that can be used is 600 seconds. The maximum value that can be used is 4,294,967,294 seconds (0xFFFFFFFE).

  • infinite—Infinite refresh time.

Default Configuration

The default is 86,400 seconds (24 hours).

Command Mode

Interface Configuration mode

User Guidelines

The ipv6 dhcp client information refresh minimum command specifies the minimum acceptable information refresh time. If the server sends an information refresh time option of less than the configured minimum refresh time, the configured minimum refresh time will be used instead.

This command may be configured in the following situations:

  • In unstable environments where unexpected changes are likely to occur.

  • For planned changes, including renumbering. An administrator can gradually decrease the time as the planned event nears.

  • Limit the amount of time before new services or servers are available to the client, such as the addition of a new Simple Network Time Protocol (SNTP) server or a change of address of a Domain Name System (DNS) server.

If you configure the infinite keyword client never refreshes the information.

Example

The following example configures an upper limit of 2 days:

switchxxxxxx(config)# interface vlan 100
switchxxxxxx(config-if)# ipv6 dhcp client information refresh 172800
switchxxxxxx(config-if)# exit

ipv6 dhcp duid-en

To set the Vendor Based on Enterprise Number DHVPv6 Unique Identified (DUID-EN) format, use the ipv6 dhcp duid-en command in Global Configuration mode.

To return to the default value, use the no form of this command.

Syntax

ipv6 dhcp duid-en enterprise-number identifier

no ipv6 dhcp duid-en

Parameters

  • enterprise-number—The vendor’s registered Private Enterprise number as maintained by IANA.

  • identifier—The vendor-defined non-empty hex string (up to 64 hex characters). If the number of the character is not even ’0’ is added at the right. Each 2 hex characters can be separated by a period or colon.

Default Configuration

DUID Based on Link-layer Address (DUID-LL) is used. The base MAC Address is used as a Link-layer Address.

Command Mode

Global Configuration mode

User Guidelines

By default, the DHCPv6 uses the DUID Based on Link-layer Address (see RFC3315) with the Base MAC Address as a Link-layer Address.

Use this command to change the DUID format to the Vendor Based on Enterprise Number.

Examples

Example 1. The following sets the DIID-EN format:

ipv6 dhcp duid-en 9 0CC084D303000912

Example 2. The following sets the DIID-EN format using colons as delimiter:

switchxxxxxx(config)# ipv6 dhcp duid-en 9 0C:C0:84:D3:03:00:09:12

ipv6 dhcp relay destination (Global)

To specify a globally-defined relay destination address to which client messages are forwarded, use the ipv6 dhcp relay destination command in Global Configuration mode. To remove a relay destination address, use the no form of this command.

Syntax

ipv6 dhcp relay destination {ipv6-address [interface-id]} | interface-id

no ipv6 dhcp relay destination [{ipv6-address [interface-id]} | interface-id]

Parameters

  • ipv6-address [interface-id]—Relay destination IPv6 address in the form documented in RFC 4291 where the address is specified in hexadecimal using 16-bit values between colons. There are the following types of relay destination address:

    • Link-local Unicast address. A user must specify the interface-id argument for this kind of address

    • Global Unicast IPv6 address. If the interface-id argument is omitted then the Routing table is used.

  • interface-id—Interface identifier that specifies the output interface for a destination. If this argument is configured, client messages are forwarded to the well-known link-local Multicast address All_DHCP_Relay_Agents_and_Servers (FF02::1:2) through the link to which the output interface is connected.

Default Configuration

There is no globally-defined relay destination.

Command Mode

Global Configuration mode

User Guidelines

The ipv6 dhcp relay destination command specifies a destination address to which client messages are forwarded. The address is used by all DHCPv6 relays running on the switch. Up to 100 addresses can be defined.

When a relay service is running on an interface, a DHCP for IPv6 message received on that interface will be forwarded to all configured relay destinations configured per interface and globally. Multiple destinations can be configured on one interface, and multiple output interfaces can be configured for one destination. Unspecified, loopback, and Multicast addresses are not acceptable as the relay destination.

Use the no form of the command with the ipv6-address and interface-id arguments to remove only the given globally-defined address with the given output interface.

Use the no form of the command with the ipv6-address argument to remove only the given globally-defined address for all output interfaces.

The no form of the command without the arguments removes all the globally-defined addresses.

Examples

Example 1. The following example sets the relay unicast link-local destination address per VLAN 200:

switchxxxxxx(config)# ipv6 dhcp relay destination FE80::1:2 vlan 200

Example 2. The following example sets that client messages are forwarded to VLAN 200:

switchxxxxxx(config)# ipv6 dhcp relay destination vlan 200

Example 3. The following example sets the unicast global relay destination address:

switchxxxxxx(config)# ipv6 dhcp relay destination 3002::1:2

ipv6 dhcp relay destination (Interface)

To specify a destination address to which client messages are forwarded and to enable DHCP for IPv6 relay service on the interface, use the ipv6 dhcp relay destination command in Interface Configuration mode. To remove a relay destination on the interface or to delete an output interface for a destination, use the no form of this command.

Syntax

ipv6 dhcp relay destination [{ipv6-address [interface-id]} | interface-id]

no ipv6 dhcp relay destination [{ipv6-address [interface-id]} | interface-id]

Parameters

  • ipv6-address [interface-id]—Relay destination IPv6 address in the form documented in RFC 4291 where the address is specified in hexadecimal using 16-bit values between colons. There are the following types of relay destination address:

    • Link-local Unicast address. A user must specify the interface-id argument for this kind of address

    • Global Unicast IPv6 address. If the interface-id argument is omitted then the Routing table is used.

  • interface-id—Interface identifier that specifies the output interface for a destination. If this argument is configured, client messages are forwarded to the well-known link-local Multicast address All_DHCP_Relay_Agents_and_Servers (FF02::1:2) through the link to which the output interface is connected.

Default Configuration

The relay function is disabled, and there is no relay destination on an interface.

Command Mode

Interface Configuration mode

User Guidelines

This command specifies a destination address to which client messages are forwarded, and it enables DHCP for IPv6 relay service on the interface. Up to 10 addresses can be defined per one interface and up to 100 addresses can be defined per switch.

DHCPv6 Relay inserts the Interface-id option if an IPv6 global address is not defined on the interface on which the relay is running. The Interface-id field of the option is the interface name (a value of the ifName field of the ifTable) on which the relay is running.

When relay service is running on an interface, a DHCP for IPv6 message received on that interface will be forwarded to all configured relay destinations configured per interface and globally.

The incoming DHCP for IPv6 message may have come from a client on that interface, or it may have been relayed by another relay agent.

The relay destination can be a Unicast address of a server or another relay agent, or it may be a Multicast address. There are two types of relay destination addresses:

  • A link-local Unicast or Multicast IPv6 address, for which a user must specify an output interface

  • A global Unicast IPv6 address. A user can optionally specify an output interface for this kind of address.

If no output interface is configured for a destination, the output interface is determined by routing tables. In this case, it is recommended that a Unicast or Multicast routing protocol be running on the router.

Multiple destinations can be configured on one interface, and multiple output interfaces can be configured for one destination. When the relay agent relays messages to a Multicast address, it sets the hop limit field in the IPv6 packet header to 32. Unspecified, loopback, and node-local Multicast addresses are not acceptable as the relay destination.

Note that it is not necessary to enable the relay function on an interface for it to accept and forward an incoming relay reply message from servers. By default, the relay function is disabled, and there is no relay destination on an interface.

Use the no form of the command with arguments to remove a specific address.

Use the no form of the command without arguments to remove all the defined addresses and to disable the relay on the interface.

Examples

Example 1. The following example sets the relay Unicast link-local destination address per VLAN 200 and enables the DHCPv6 Relay on VLAN 100 if it was not enabled:

switchxxxxxx(config)# interface vlan 100
switchxxxxxx(config-if)# ipv6 dhcp relay destination FE80::1:2 vlan 200
switchxxxxxx(config-if)# exit

Example 2. The following example sets the relay well known Multicast link-local destination address per VLAN 200 and enables the DHCPv6 Relay on VLAN 100 if it was not enabled:

switchxxxxxx(config)# interface vlan 100
switchxxxxxx(config-if)# ipv6 dhcp relay destination vlan 200
switchxxxxxx(config-if)# exit

Example 3. The following example sets the Unicast global relay destination address and enables the DHCPv6 Relay on VLAN 100 if it was not enabled:

switchxxxxxx(config)# interface vlan 100
switchxxxxxx(config-if)# ipv6 dhcp relay destination 3002::1:2
switchxxxxxx(config-if)# exit

Example 4. The following example enables DHCPv6 relay on VLAN 100:

switchxxxxxx(config)# interface vlan 100
switchxxxxxx(config-if)# ipv6 dhcp relay destination
switchxxxxxx(config-if)# exit

Example 5. The following example disables DHCPv6 relay on VLAN 100:

switchxxxxxx(config)# interface vlan 100
switchxxxxxx(config-if)# no ipv6 dhcp relay destination
switchxxxxxx(config-if)# exit

show ipv6 dhcp

To display the Dynamic DHCP unique identifier (DUID) on a specified device, use the show ipv6 dhcp command in User EXEC mode.This information is relevant for DHCPv6 clients and DHCPv6 relays.

Syntax

show ipv6 dhcp

Command Mode

User EXEC mode

User Guidelines

This command uses the DUID, which is based on the link-layer address for both client and server identifiers. The device uses the MAC address from the lowest-numbered interface to form the DUID.

Examples

Example 1. The following is sample output from this command when the switch’s DUID format is vendor based on enterprise number:

switchxxxxxx# show ipv6 dhcp
The switch’s DHCPv6 unique identifier(DUID)is 0002000000090CC084D303000912
  Format: 2
  Enterprise Number: 9
  Identifier: 0CC084D303000912

Example 2. The following is sample output from this command when the switch’s DUID format is the vendor-based on link-layer address:

switchxxxxxx# show ipv6 dhcp
The switch’s DHCPv6 unique identifier(DUID)is 000300010024012607AA
  Format: 3
  Hardware type: 1
  MAC Address: 0024.0126.07AA

Example 3. The following is sample output from this command when the switch’s DUID format is vendorbased on link-layer address and DHCPv6 Relay is supported:

switchxxxxxx# show ipv6 dhcp
The switch’s DHCPv6 unique identifier(DUID)is 000300010024012607AA
  Format: 3
  Hardware type: 1
  MAC Address: 0024.0126.07AA
Relay Destinations:
  2001:001:250:A2FF:FEBF:A056
  2001:1001:250:A2FF:FEBF:A056
  2001:1011:250:A2FF:FEBF:A056 via VLAN 100
  FE80::250:A2FF:FEBF:A056 via VLAN 100
  FE80::250:A2FF:FEBF:A056 via VLAN 200

show ipv6 dhcp interface

To display DHCP for IPv6 interface information, use the show ipv6 dhcp interface command in User EXEC mode.

Syntax

show ipv6 dhcp interface [interface-id]

Parameters

  • interface-id—Interface identifier.

Command Mode

User EXEC mode

User Guidelines

If no interfaces are specified in the command, all interfaces on which DHCP for IPv6 (client or server) is enabled are displayed. If an interface is specified in the command, only information about the specified interface is displayed.

Note. This new output format is supported starting with the SW version supporting statefull configuration

Example

The following is sample output from this command when DHCPv6 client is enabled:

switchxxxxxx# show ipv6 dhcp interface
VLAN 100 is in client mode
  Configuration:
    Statefull Service is enabled (rapid-commit)
    Auto-Configuration is enabled
    Information Refresh Time: 86400 seconds
    Information Refresh Minimum Time: 600 seconds
  State:
    DHCP Operational mode is enabled
    Statefull Service is available
  DHCP server:
    Address: FE80::204:FCFF:FEA1:7439
    DUID: 000300010002FCA17400
    Preference: 20
  IPv6 Address Information:
    IA NA: IA ID 0x00040001, T1 120, T2 192
    IPv6 Address: 30e0::12:45:11
      preferred lifetime: 300, valid lifetime: 54333
      expires at Nov 08 2002 09:11 (54331 seconds)
      renew for address will be sent in 54301 seconds
    IPv6 Address: 3012::13:af:25
      preferred lifetime: 280, valid lifetime: 51111
      expires at Nov 08 2002 08:17 (51109 seconds)
      renew for address will be sent in 5101 seconds
  Stateless Information:
    Information Refresh Time:  86400 seconds
    expires at Nov 08 2002 08:17 (51109 seconds)
    DNS Servers: 1001::1, 2001::10
    DNS Domain Search List: company.com beta.org
    SNTP Servers: 2004::1
    POSIX Timezone string: EST5EDT4,M3.2.0/02:00,M11.1.0/02:00
    Configuration Server: config.company.com
    Configuration Path Name: qqq/config/aaa_config.dat
    Indirect Image Path Name: qqq/config/aaa_image_name.txt
VLAN 105 is in client mode
 Configuration:
    Statefull Service is enabled
    Auto-Configuration is disabled
    Information Refresh Time: 86400 seconds
    Information Refresh Minimum Time: 600 seconds
  State:
    DHCP Operational mode is enabled
    Statefull Service is not available (IPv6 routing is enabled)
  DHCP server:
    Address: FE80::204:FCFF:FEA1:7439
    DUID: 000300010002FCA17400
    Preference: 20
  Stateless Information:
    Information Refresh Time:  86400 seconds
    expires at Nov 08 2002 08:17 (51109 seconds)
    DNS Servers: 1001::1, 2001::10
    DNS Domain Search List: company.com beta.org
    SNTP Servers: 2004::1
    POSIX Timezone string: EST5EDT4,M3.2.0/02:00,M11.1.0/02:00
    Configuration Server: config.company.com
    Configuration Path Name: qqq/config/aaa_config.dat
    Indirect Image Path Name: qqq/config/aaa_image_name.txt
VLAN 107 is in client mode
 Configuration:
    Statefull Service is enabled
    Auto-Configuration is enabled
    Information Refresh Time: 86400 seconds
    Information Refresh Minimum Time: 600 seconds
  State:
    DHCP Operational mode is enabled
    Statefull Service is not available (IPv6 routing is enabled)
  DHCP server:
    Address: FE80::204:FCFF:FEA1:7439
    DUID: 000300010002FCA17400
    Preference: 20
  Stateless Information:
    Information Refresh Time:  86400 seconds
    expires at Nov 08 2002 08:17 (51109 seconds)
    DNS Servers: 1001::1, 2001::10
    DNS Domain Search List: company.com beta.org
    SNTP Servers: 2004::1
    POSIX Timezone string: EST5EDT4,M3.2.0/02:00,M11.1.0/02:00
    Configuration Server: config.company.com
    Configuration Path Name: qqq/config/aaa_config.dat
    Indirect Image Path Name: qqq/config/aaa_image_name.txt
VLAN 110 is in client mode
 Configuration:
    Statefull Service is enabled
    Auto-Configuration is disabled
    Information Refresh Time: 86400 seconds
    Information Refresh Minimum Time: 600 seconds
  State:
    DHCP Operational mode is disabled (IPv6 is not enabled)
VLAN 1000 is in client mode
 Configuration:
    Statefull Service is enabled
    Auto-Configuration is enabled
    Information Refresh Time: 86400 seconds
    Information Refresh Minimum Time: 600 seconds
  State:
    DHCP Operational mode is disabled (Interface status is DOWN)
  DHCP server:
    Address: FE80::204:FCFF:FEA1:7439
    DUID: 000300010002FCA17400
    Preference: 20
  Stateless Information:
    Information Refresh Time:  86400 seconds
    expires at Nov 08 2002 08:17 (51109 seconds)
    DNS Servers: 1001::1, 2001::10
    DNS Domain Search List: company.com beta.org
    SNTP Servers: 2004::1
    POSIX Timezone string: EST5EDT4,M3.2.0/02:00,M11.1.0/02:00
    Configuration Server: config.company.com
    Configuration Path Name: qqq/config/aaa_config.dat
    Indirect Image Path Name: qqq/config/aaa_image_name.txt
VLAN 1010 is in relay mode
  DHCP Operational mode is enabled
  Relay source interface: VLAN 101
  Relay destinations:
    2001:001:250:A2FF:FEBF:A056
    FE80::250:A2FF:FEBF:A056 via FastEthernet 1/0/10