IPv6 address and prefix acquisition configuration example

Network requirements

As shown in Figure 103, configure GigabitEthernet 1/0/1 of the router to use DHCPv6 to obtain configuration parameters from the DHCPv6 server. The parameters include IPv6 address, IPv6 prefix, DNS server address, domain name suffix, SIP server address, and SIP server domain name.

Figure 103: Network diagram

Configuration procedure

You must configure the DHCPv6 server before configuring the DHCPv6 client. For information about configuring the DHCPv6 server, see "Configuring the DHCPv6 server."

# Configure an IPv6 address for GigabitEthernet 1/0/1 that connects to the DHCPv6 server.

<Router> system-view
[Router] interface gigabitethernet 1/0/1
[Router-GigabitEthernet1/0/1] ipv6 address 1::2/48

# Configure GigabitEthernet 1/0/1 to use DHCPv6 for IPv6 address and prefix acquisition. Specify IDs for the dynamic IPv6 prefix and dynamic DHCPv6 option group, and configure the client to support rapid address and prefix assignment.

[Router-GigabitEthernet1/0/1] ipv6 dhcp client stateful prefix 1 rapid-commit option-group 1
[Router-GigabitEthernet1/0/1] quit

Verifying the configuration

# Display DHCPv6 client information. The output shows that the DHCPv6 client has obtained an IPv6 address, an IPv6 prefix, and other configuration parameters from the DHCPv6 server.

[Router] display ipv6 dhcp client
GigabitEthernet1/0/1:
  Type: Stateful client requesting address and prefix
    State: OPEN
    Client DUID: 00030001d07e28db74fb
    Preferred server:
      Reachable via address: FE80::2E0:1FF:FE00:19
      Server DUID: 0003000100e001000000
    IA_NA: IAID 0x00000a02, T1 50 sec, T2 80 sec
      Address: 1:1::2/128
        Preferred lifetime 100 sec, valid lifetime 200 sec
        Will expire on Mar 27 2014 at 15:29:34 (198 seconds left)
    IA_PD: IAID 0x00000a02, T1 50 sec, T2 80 sec
      Prefix: 12:34::/48
        Preferred lifetime 100 sec, valid lifetime 200 sec
        Will expire on Mar 27 2014 at 15:29:34 (198 seconds left)
    DNS server addresses:
      2000::FF
    Domain name:
      example.com
    SIP server addresses:
      2:2::4
    SIP server domain names:
      bbb.com

# Display brief IPv6 information for all interfaces on the device. The output shows that the DHCPv6 client has obtained an IPv6 address.

[Router] display ipv6 interface brief
*down: administratively down
(s): spoofing
Interface                                Physical   Protocol   IPv6 Address
GigabitEthernet1/0/1                     up         up         1:1::2

# Display information about the dynamic IPv6 prefix. The output shows that the client has obtained an IPv6 prefix.

[Router] display ipv6 prefix 1
Number: 1
Type  : Dynamic
Prefix: 12:34::/48
Preferred lifetime 100 sec, valid lifetime 200 sec

# Display information about the dynamic DHCPv6 option group. The output shows that the client has created a dynamic DHCPv6 option group for saving configuration parameters.

[Router] display ipv6 dhcp option-group 1
DHCPv6 option group: 1
  DNS server addresses:
    Type: Dynamic (DHCPv6 address and prefix allocation)
    Interface: GigabitEthernet1/0/1
    2000::FF
  Domain name:
    Type: Dynamic (DHCPv6 address and prefix allocation)
    Interface: GigabitEthernet1/0/1
    example.com
  SIP server addresses:
    Type: Dynamic (DHCPv6 address and prefix allocation)
    Interface: GigabitEthernet1/0/1
    2:2::4
  SIP server domain names:
    Type: Dynamic (DHCPv6 address and prefix allocation)
    Interface: GigabitEthernet1/0/1
    bbb.com