03-Layer 3—IP Services Configuration Examples

HomeSupportConfigure & DeployConfiguration ExamplesH3C Fixed Port Campus Switches Configuration Examples-11xx[R1213Pxx][R9126Pxx]-6W10103-Layer 3—IP Services Configuration Examples
08-DHCPv6 Server and DHCPv6 Prefix Client Configuration Examples

Introduction

To simplify host configuration, IPv6 supports stateful and stateless address autoconfiguration.

·     Stateless address autoconfiguration enables a host to automatically generate an IPv6 address and other configuration information by using its link-layer address and the prefix information advertised by a router.

·     Stateful address autoconfiguration enables a host to acquire an IPv6 address and other configuration information from a server (for example, a DHCPv6 server).

The following information provides configuration examples of stateless address autoconfiguration and stateful address autoconfiguration.

Prerequisites

The configuration examples in this document were created and verified in a lab environment, and all the devices were started with the factory default configuration. If you have configured the devices, make sure the existing configurations do not conflict with the following example configurations. When you are working on a live network, make sure you understand the potential impact of every command on your network.

This document assumes that you have basic knowledge of DHCPv6.

Example: Configuring the DHCPv6 server and the DHCPv6 prefix client

Network configuration

As shown in Figure 1, Host A and Device C obtain IPv6 prefixes from the DHCPv6 prefix client and generate IPv6 global unicast addresses through stateless address autoconfiguration. Host B and Device D use the stateful address autoconfiguration method to obtain IPv6 global unicast addresses from the IPv6 address pool on the DHCPv6 prefix client.

Configure the network as follows:

·     Configure Device A as the DHCPv6 server. Assign IPv6 address 1::1/64 to Twenty-FiveGigE1/0/1. Create an IPv6 address pool and apply a prefix pool that contains prefix 2001:0410::/32 to that address pool. The IPv6 address pool can then assign prefixes to the DHCPv6 prefix client.

·     Configure Device B as the DHCPv6 prefix client. Enable the DHCPv6 prefix client to perform the following tasks: Obtain prefix 2001:410::/48 from the DHCPv6 server. The prefix ID of that prefix is 11. Automatically generate an IPv6 address for Twenty-FiveGigE1/0/2 and advertise the obtained prefix to endpoints.

·     Configure Device C to obtain an IPv6 prefix from the DHCPv6 prefix client through the IPv6 ND protocol and generate an IPv6 address for Twenty-FiveGigE1/0/1 through stateless address autoconfiguration.

·     Configure Host A to obtain an IPv6 prefix from the DHCPv6 prefix client through the IPv6 ND protocol and automatically generate an IPv6 address.

·     Create an IPv6 address pool on Device B by using the prefix associated with prefix ID 11. This IPv6 address pool is used for IPv6 address assignment to Host B and Twenty-FiveGigE1/0/1 of Device D.

Figure 1 Network diagram

 

Restrictions and guidelines

·     After you configure an IPv6 global unicast address for an interface, the interface will automatically generate a link-local address if it is not configured with any link-local address.

·     When you configure the DHCPv6 prefix client to use a prefix for IPv6 interface address generation, make sure the specified sub-prefix length is 64. If the specified sub-prefix length is not 64, Endpoints attached to the DHCPv6 prefix client cannot use the prefixes obtained from the DHCPv6 prefix client for stateless address autoconfiguration.

Applicable hardware and software versions

The following matrix shows the hardware and software versions to which this configuration example is applicable:

 

Hardware

Software version

S6550X-HI switch series

Release 1116 and later, Release 1213P51 and later

S6880 switch series

Release 1116 and later, Release 1213P51 and later

S9820-8M switch

Release 1116 and later, Release 1213P51 and later

S5580X-HI switch series

Release 1213P50 and later

S5580X-EI switch series

Release 1213P50 and later

S5580S-EI switch series

Release 1213P50 and later

 

Procedure

Configuring the DHCPv6 server

# Configure an IPv6 address for Twenty-FiveGigE1/0/1, and enable RA message advertisement on that interface.

<DeviceA> system-view

[DeviceA] interface Twenty-FiveGigE 1/0/1

[DeviceA-Twenty-FiveGigE1/0/1] ipv6 address 1::1/64

[DeviceA-Twenty-FiveGigE1/0/1] undo ipv6 nd ra halt

[DeviceA-Twenty-FiveGigE1/0/1] quit

# Create prefix pool 1 that contains prefix 2001:0410::/32, and specify the length of assigned prefixes as 48.

[DeviceA] ipv6 dhcp prefix-pool 1 prefix 2001:0410::/32 assign-len 48

# Create IPv6 address pool 1.

[DeviceA] ipv6 pool 1

# Specify network segment 1::/64 for IPv6 address pool 1. The specified network segment must contain the IPv6 address previously configured for Twenty-FiveGigE1/0/1.

[DeviceA-ipv6-pool-1] network 1::/64

# Apply prefix pool 1 to IPv6 address pool 1, and set the preferred lifetime to 1 day and valid lifetime to 3 days for dynamically assigned prefixes.

[DeviceA-ipv6-pool-1] prefix-pool 1 preferred-lifetime 86400 valid-lifetime 259200

[DeviceA-ipv6-pool-1] quit

# Enable the DHCPv6 server on Twenty-FiveGigE1/0/1, enable desired address/prefix assignment and rapid address/prefix assignment on that interface, and set the server preference to the highest.

[DeviceA] interface Twenty-FiveGigE 1/0/1

[DeviceA-Twenty-FiveGigE1/0/1] ipv6 dhcp select server

[DeviceA-Twenty-FiveGigE1/0/1] ipv6 dhcp server allow-hint preference 255 rapid-commit

[DeviceA-Twenty-FiveGigE1/0/1] quit

# Configure static routes to the host networks.

[DeviceA] ipv6 route-static 2001:0410:0:1:: 64 1::2

[DeviceA] ipv6 route-static 2001:0410:0:2:: 64 1::2

Configuring the DHCPv6 prefix client

1.     Enable IPv6 prefix acquisition from the DHCPv6 server.

 

 

NOTE:

You can enable the DHCPv6 prefix client to obtain an IPv6 prefix from the DHCPv6 server or use the ipv6 prefix command to manually assign an IPv6 prefix to the DHCPv6 prefix client. This example introduces how to configure DHCPv6-based IPv6 prefix acquisition.

 

# Configure an IPv6 address for Twenty-FiveGigE1/0/1.

<DeviceB> system-view

[DeviceB] interface Twenty-FiveGigE 1/0/1

[DeviceB-Twenty-FiveGigE1/0/1] ipv6 address 1::2/64

# Configure Twenty-FiveGigE1/0/1 as a DHCPv6 client to obtain an IPv6 prefix and other network settings, associate prefix ID 11 to the obtained IPv6 prefix, enable support for rapid address/prefix assignment on that DHCPv6 client.

[DeviceB-Twenty-FiveGigE1/0/1] ipv6 dhcp client pd 11 rapid-commit

[DeviceB-Twenty-FiveGigE1/0/1] quit

2.     Enable the DHCPv6 prefix client to generate an IPv6 address for Twenty-FiveGigE1/0/2 with the specified prefix and advertise the prefix to Device C and Host A in RA messages.

# Enable Twenty-FiveGigE1/0/2 to dynamically obtain and advertise the IPv6 prefix associated with prefix ID 11, and to automatically generate an IPv6 global unicast address based on the obtained IPv6 prefix and 0:0:0:1::10/64 (sub-prefix bit and host bit).

[DeviceB] interface Twenty-FiveGigE 1/0/2

[DeviceB-Twenty-FiveGigE1/0/2] ipv6 address 11 0:0:0:1::10/64

# Enable RA message advertisement on Twenty-FiveGigE1/0/2.

[DeviceB-Twenty-FiveGigE1/0/2] undo ipv6 nd ra halt

# Enable advertising invalid delegated prefixes. When a DHCPv6 server-assigned prefix goes invalid, the device sends out RA messages immediately. Upon receiving the RA messages, endpoints will no longer use the IPv6 addresses generated based on the prefix.

[DeviceB] interface Twenty-FiveGigE 1/0/2

[DeviceB-Twenty-FiveGigE1/0/2] ipv6 nd ra invalid-delegated-prefix advertise enable

[DeviceB-Twenty-FiveGigE1/0/2] quit

3.     Create an IPv6 address pool with prefix ID 11 on the DHCPv6 prefix client, and configure the DHCPv6 prefix client as DHCPv6 server for IPv6 address assignment to Device D and Host B.

# Enable Twenty-FiveGigE1/0/3 to dynamically obtain the IPv6 prefix associated with prefix ID 11, and to automatically generate an IPv6 global unicast address based on the obtained IPv6 prefix and 0:0:0:2::10/64 (sub-prefix bit and host bit).

[DeviceB-Twenty-FiveGigE1/0/3] ipv6 address 11 0:0:0:2::10/64

[DeviceB-Twenty-FiveGigE1/0/3]quit

# Create IPv6 address pool 2.

[DeviceB] ipv6 pool 2

# Specify the IPv6 network segment associated with prefix ID 11 for dynamic prefix assignment in IPv6 address pool 2.

[DeviceB-ipv6-pool-1] network prefix 11

[DeviceB-ipv6-pool-1] quit

# Enable the DHCPv6 server on Twenty-FiveGigE1/0/3, enable desired address/prefix assignment and rapid address/prefix assignment on that interface, and set the server preference to the highest.

[DeviceB] interface Twenty-FiveGigE 1/0/3

[DeviceB-Twenty-FiveGigE1/0/3] ipv6 dhcp select server

[DeviceB-Twenty-FiveGigE1/0/3] ipv6 dhcp server allow-hint preference 255 rapid-commit

[DeviceB-Twenty-FiveGigE1/0/3] quit

Configuring DHCPv6 clients

Configuring stateless address autoconfiguration

# Configure Device C and Host A.

1.     Enable the stateless address autoconfiguration feature on Twenty-FiveGigE1/0/1 of Device C, so the interface can automatically generate a global unicast address.

<DeviceC> system-view

[DeviceC] interface Twenty-FiveGigE 1/0/1

[DeviceC-Twenty-FiveGigE1/0/1] ipv6 address auto

2.     Enable Host A to automatically obtain an IPv6 address. In this example, the operating system is Windows 10.

a.     Click Network in the desktop, and then open Network and Internet.

b.     Open the Network and Sharing Center window, and then select the network (Ethernet xxx) on which the host resides.

c.     Click Properties.

d.     Select Internet Protocol Version 6 (TCP/IPv6), click Properties, select Obtain an IPv6 address automatically in the pop-up window, and then click OK.

Configuring stateful address autoconfiguration

# Configure Device D and Host B.

1.     Configure Twenty-FiveGigE1/0/1 as a DHCPv6 client to obtain an IPv6 prefix and other network settings, and enable support for rapid address/prefix assignment on that DHCPv6 client.

<DeviceD> system-view

[DeviceD] interface Twenty-FiveGigE 1/0/1

[DeviceD-Twenty-FiveGigE1/0/1] ipv6 address dhcp-alloc rapid-commit

[DeviceD-Twenty-FiveGigE1/0/1] quit

2.     Enable Host B to automatically obtain an IPv6 address.

The configuration procedure is similar as that of Host A.

Verifying the configuration

Verifying the DHCPv6 server configuration

# View information about IPv6 address pool 1.

<DeviceA> display ipv6 dhcp pool 1

DHCPv6 pool: 1

  Network: 1::/64

    Preferred lifetime 604800 seconds, valid lifetime 2592000 seconds

  Prefix pool: 1

    Preferred lifetime 86400 seconds, valid lifetime 259200 seconds

# View information about IPv6 prefix pool 1.

<DeviceA> display ipv6 dhcp prefix-pool 1

Prefix: 2001:410::/32

Assigned length: 48

Total prefix number: 65536

Available: 65535

In-use: 1

Static: 0

# View DHCPv6 prefix binding information.

<DeviceA> display ipv6 dhcp server pd-in-use

Pool: 1

 IPv6 prefix             Hardware address     Type      Lease expiration

 2001:410::/48           2455-d9ca-0207       Auto(C)   Jul 25 09:44:02 2022

If the type of a prefix binding is Auto(C), the binding is a committed dynamic binding whose IPv6 prefix has been dynamically assigned to the DHCPv6 client.

Verifying the DHCPv6 prefix client configuration

Verifying that the stateless address autoconfiguration feature is configured correctly

# View the IPv6 global unicast addresses of Twenty-FiveGigE1/0/1 on Device B.

<DeviceB> display ipv6 interface Twenty-FiveGigE 1/0/1

Twenty-FiveGigE1/0/1 current state: UP

Line protocol current state: UP

IPv6 is enabled, link-local address is FE80::2655:D9FF:FECA:206

  Global unicast address(es):

    1::2, subnet is 1::/64

  Joined group address(es):

    FF02::1

    FF02::2

    FF02::18C

    FF02::1:FF00:2

    FF02::1:FFCA:206

    FF0E::18C

  MTU is 1500 bytes

  ND DAD is enabled, number of DAD attempts: 1

  ND reachable time is 30000 milliseconds

  ND retransmit interval is 1000 milliseconds

  Hosts use stateless autoconfig for addresses

IPv6 Packet statistics:

  InReceives:                    0

  InTooShorts:                   0

  InTruncatedPkts:               0

  InHopLimitExceeds:             0

  InBadHeaders:                  0

  InBadOptions:                  0

  ReasmReqds:                    0

  ReasmOKs:                      0

  InFragDrops:                   0

  InFragTimeouts:                0

  OutFragFails:                  0

  InUnknownProtos:               0

  InDelivers:                    0

  OutRequests:                   0

  OutForwDatagrams:              0

  InNoRoutes:                    0

  InTooBigErrors:                0

  OutFragOKs:                    0

  OutFragCreates:                0

  InMcastPkts:                   0

  InMcastNotMembers:             0

  OutMcastPkts:                  0

  InAddrErrors:                  0

  InDiscards:                    0

  OutDiscards:                   0

# View the IPv6 global unicast addresses generated by Twenty-FiveGigE1/0/2 of Device B based on the obtained prefix.

<DeviceB> display ipv6 interface Twenty-FiveGigE 1/0/2

Twenty-FiveGigE1/0/2 current state: UP

Line protocol current state: UP

IPv6 is enabled, link-local address is FE80::2655:D9FF:FECA:207

  Global unicast address(es):

    2001:410:0:1::10, subnet is 2001:410:0:1::/64

  Joined group address(es):

    FF02::1

    FF02::2

    FF02::18C

    FF02::1:FF00:10

    FF02::1:FFCA:207

    FF0E::18C

  MTU is 1500 bytes

  ND DAD is enabled, number of DAD attempts: 1

  ND reachable time is 30000 milliseconds

  ND retransmit interval is 1000 milliseconds

  ND advertised reachable time is 0 milliseconds

  ND advertised retransmit interval is 0 milliseconds

  ND router advertisements are sent every 600 seconds

  ND router advertisements live for 1800 seconds

  Hosts use stateless autoconfig for addresses

IPv6 Packet statistics:

  InReceives:                    0

  InTooShorts:                   0

  InTruncatedPkts:               0

  InHopLimitExceeds:             0

  InBadHeaders:                  0

  InBadOptions:                  0

  ReasmReqds:                    0

  ReasmOKs:                      0

  InFragDrops:                   0

  InFragTimeouts:                0

  OutFragFails:                  0

  InUnknownProtos:               0

  InDelivers:                    0

  OutRequests:                   0

  OutForwDatagrams:              0

  InNoRoutes:                    0

  InTooBigErrors:                0

  OutFragOKs:                    0

  OutFragCreates:                0

  InMcastPkts:                   0

  InMcastNotMembers:             0

  OutMcastPkts:                  0

  InAddrErrors:                  0

  InDiscards:                    0

  OutDiscards:                   0

# View the IPv6 global unicast addresses generated by Twenty-FiveGigE1/0/3 of Device B based on the obtained prefix.

<DeviceB> display ipv6 interface Twenty-FiveGigE 1/0/3

Twenty-FiveGigE1/0/3 current state: UP

Line protocol current state: UP

IPv6 is enabled, link-local address is FE80::2655:D9FF:FECA:208

  Global unicast address(es):

    2001:410:0:2::10, subnet is 2001:410:0:2::/64

  Joined group address(es):

    FF02::1

    FF02::2

    FF02::18C

    FF02::1:2

    FF02::1:FF00:10

    FF02::1:FFCA:208

    FF05::1:3

    FF0E::18C

  MTU is 1500 bytes

  ND DAD is enabled, number of DAD attempts: 1

  ND reachable time is 30000 milliseconds

  ND retransmit interval is 1000 milliseconds

  Hosts use stateless autoconfig for addresses

IPv6 Packet statistics:

  InReceives:                    0

  InTooShorts:                   0

  InTruncatedPkts:               0

  InHopLimitExceeds:             0

  InBadHeaders:                  0

  InBadOptions:                  0

  ReasmReqds:                    0

  ReasmOKs:                      0

  InFragDrops:                   0

  InFragTimeouts:                0

  OutFragFails:                  0

  InUnknownProtos:               0

  InDelivers:                    0

  OutRequests:                   0

  OutForwDatagrams:              0

  InNoRoutes:                    0

  InTooBigErrors:                0

  OutFragOKs:                    0

  OutFragCreates:                0

  InMcastPkts:                   0

  InMcastNotMembers:             0

  OutMcastPkts:                  0

  InAddrErrors:                  0

  InDiscards:                    0

  OutDiscards:                   0

# View information about the neighbors of Twenty-FiveGigE1/0/2 on Device B.

<DeviceB> display ipv6 neighbors interface Twenty-FiveGigE 1/0/2

Type: S-Static    D-Dynamic    O-Openflow     R-Rule    IS-Invalid static

IPv6 address              MAC address    VID  Interface           State T  Age

2001:410::2ACC:53FF:FE48:406 7e0e-0ceb-0406 --   WGE1/0/2             STALE D  584

2001:410:0:1:9086:E493:B7EF:A029 0800-2700-98d2 --   WGE1/0/2             REACH D  409

2001:410:0:1:A941:6AE0:DCC4:517E 0800-2700-98d2 --   WGE1/0/2             REACH D  419

FE80::2ACC:53FF:FE48:406  7e0e-0ceb-0406 --   WGE1/0/2             STALE D  574

FE80::A941:6AE0:DCC4:517E 0800-2700-98d2 --   WGE1/0/2             REACH D  409

According to the information above, the IPv6 global unicast address obtained by Device C is 2001:410::2ACC:53FF:FE48:406. The host has obtained IPv6 global unicast address 2001:410:0:1:A941:6AE0:DCC4:517E and its temporary IPv6 global unicast address is 2001:410:0:1:9086:E493:B7EF:A029.

 

 

NOTE:

The display ipv6 neighbors command displays information about IPv6 global unicast addresses only after you perform a link connectivity test (such as ping test) based on IPv6 global unicast addresses. If you do not perform such a link connectivity test, this command only displays information about IPv6 link-local addresses.

 

Verifying that the stateful address autoconfiguration feature is configured correctly

# View information about IPv6 address pool 2.

<DeviceB> display ipv6 dhcp pool 2

DHCPv6 pool: 2

  Network: 2001:410::/48

    Preferred lifetime 604800 seconds, valid lifetime 2592000 seconds

# View DHCPv6 address binding information.

<DeviceB> display ipv6 dhcp server ip-in-use

Pool: 2

 IPv6 address            Hardware address     Type      Lease expiration

 2001:410::1             28cc-5348-0306       Auto(C)   Aug 24 09:44:46 2022

 2001:410::2             0800-2700-48ec       Auto(C)   Aug 24 09:53:13 2022

Verifying DHCPv6 client configurations

Verifying that the stateless address autoconfiguration feature is configured correctly

# View the IPv6 global unicast addresses of Twenty-FiveGigE1/0/1 on Device C.

<DeviceC> display ipv6 interface Twenty-FiveGigE 1/0/1

Twenty-FiveGigE1/0/1 current state: UP

Line protocol current state: UP

IPv6 is enabled, link-local address is FE80::7C0E:CFF:FEEB:406

  Global unicast address(es):

    2001:410:0:1:7C0E:CFF:FEEB:406, subnet is 2001:410:0:1::/64 [AUTOCFG]

      [valid lifetime 259019s/preferred lifetime 86219s]

  Joined group address(es):

    FF02::1

    FF02::2

    FF02::18C

    FF02::1:FF48:406

    FF0E::18C

  MTU is 1500 bytes

  ND DAD is enabled, number of DAD attempts: 1

  ND reachable time is 30000 milliseconds

  ND retransmit interval is 1000 milliseconds

  Hosts use stateless autoconfig for addresses

IPv6 Packet statistics:

  InReceives:                    0

  InTooShorts:                   0

  InTruncatedPkts:               0

  InHopLimitExceeds:             0

  InBadHeaders:                  0

  InBadOptions:                  0

  ReasmReqds:                    0

  ReasmOKs:                      0

  InFragDrops:                   0

  InFragTimeouts:                0

  OutFragFails:                  0

  InUnknownProtos:               0

  InDelivers:                    0

  OutRequests:                   0

  OutForwDatagrams:              0

  InNoRoutes:                    0

  InTooBigErrors:                0

  OutFragOKs:                    0

  OutFragCreates:                0

  InMcastPkts:                   0

  InMcastNotMembers:             0

  OutMcastPkts:                  0

  InAddrErrors:                  0

  InDiscards:                    0

  OutDiscards:                   0

# View the IPv6 global unicast addresses obtained by Host A on the related PC.

C:\Users\UserAccount>ipconfig /all

 

Verifying that the stateful address autoconfiguration feature is configured correctly

# View the IPv6 global unicast addresses assigned by Device B to Device D.

<DeviceD> display ipv6 dhcp client

Twenty-FiveGigE1/0/1:

  Type: Stateful client requesting address

    State: OPEN

    Client DUID: 0003000128cc53480300

    Preferred server:

      Reachable via address: FE80::2655:D9FF:FECA:208

      Server DUID: 000300012455d9ca0200

    IA_NA: IAID 0x00000002, T1 302400 sec, T2 483840 sec

      Address: 2001:410::1

        Preferred lifetime 604800 sec, valid lifetime 2592000 sec

        Will expire on Aug 24 2022 at 09:44:35 (2589132 seconds left)

# View the IPv6 global unicast addresses obtained by Host B on the related PC.

C:\Users\UserAccount>ipconfig /all

 

Configuration files

Device A

#

 ipv6 dhcp prefix-pool 1 prefix 2001:410::/32 assign-len 48

#

ipv6 dhcp pool 1

 network 1::/64

 prefix-pool 1 preferred-lifetime 86400 valid-lifetime 259200

#

interface Twenty-FiveGigE1/0/1

 port link-mode route

 ipv6 dhcp select server

 ipv6 dhcp server allow-hint preference 255 rapid-commit

 ipv6 address 1::1/64

 undo ipv6 nd ra halt

#

 ipv6 route-static 2001:410:0:1:: 64 1::2

 ipv6 route-static 2001:410:0:2:: 64 1::2

#

Device B

#

ipv6 dhcp pool 2

 network prefix 11

#

interface Twenty-FiveGigE1/0/1

 port link-mode route

 ipv6 address 1::2/64

 ipv6 dhcp client pd 11 rapid-commit

#

interface Twenty-FiveGigE1/0/2

 port link-mode route

 ipv6 address 11 ::1:0:0:0:10/64

 undo ipv6 nd ra halt

 ipv6 nd ra invalid-delegated-prefix advertise enable

#

interface Twenty-FiveGigE1/0/3

 port link-mode route

 ipv6 dhcp select server

 ipv6 dhcp server allow-hint preference 255 rapid-commit

 ipv6 address 11 ::2:0:0:0:10/64

#

Device C

#

interface Twenty-FiveGigE1/0/1

 port link-mode route

 ipv6 address auto

#

Device D

#

interface Twenty-FiveGigE1/0/1

 port link-mode route

 ipv6 address dhcp-alloc rapid-commit

#

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网