Example for Configuring a DHCPv6 PD Client
Networking Requirements
In Figure 9-19, the RouterIndustrial Switch Router is required to function as a DHCPv6 PD client and obtain an IPv6 address prefix from the DHCPv6 PD server. You can configure the RouterIndustrial Switch Router as a DHCPv6 PD client to assign IPv6 addresses and other network configuration parameters to DHCPv6 clients. This reduces the pressure on the DHCPv6 server and facilitates layered IPv6 network deployment. The address of the DHCPv6 PD server is fc00:1::1/64. The DHCPv6 PD server and client are on the same link. In this example, the DHCPv6 PD client assigns network parameters including the DNS server address fc00:2::1/64 and DNS suffix example.com to users.
Configuration Roadmap
On the device functioning as a DHCPv6 PD client, enable IPv6 on an interface to implement IPv6 communication.
On the device functioning as a DHCPv6 PD client, enable the DHCPv6 PD client function, so that the device can obtain IPv6 address prefixes through DHCPv6.
- On the device functioning as a DHCPv6 PD server, enable the DHCPv6 PD server function and configure the DNS server address, so that the device can obtain the DNS server address through DHCPv6.
Procedure
- On Router A, configure the IPv6 function on an interface.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] ipv6 [RouterA] interface gigabitethernet 0/0/1 [RouterA-GigabitEthernet0/0/1] ipv6 enable [RouterA-GigabitEthernet0/0/1] ipv6 address auto link-local
- On Router A, enable the DHCPv6 PD client function.
# Enable the DHCPv6 PD client function on GE0/0/1.
[RouterA-GigabitEthernet0/0/1] dhcpv6 client pd myprefix [RouterA-GigabitEthernet0/0/1] quit
# Set the DNS suffix to example.com. This frees users from entering the DNS suffix when accessing the specified network resource.
[RouterA] dns domain example.com
- On Router B, configure the DHCPv6 PD server function.
- Configure Router A to send RA messages to assign address prefixes to hosts.
# Configure the device to send RA messages and configure M and O flag bits.
[RouterA] interface gigabitethernet 0/0/2 [RouterA-GigabitEthernet0/0/2] ipv6 enable [RouterA-GigabitEthernet0/0/2] ipv6 address auto link-local [RouterA-GigabitEthernet0/0/2] undo ipv6 nd ra halt [RouterA-GigabitEthernet0/0/2] ipv6 nd autoconfig managed-address-flag [RouterA-GigabitEthernet0/0/2] ipv6 nd autoconfig other-flag [RouterA-GigabitEthernet0/0/2] ipv6 address myprefix ::1:0:0:0:1/64 [RouterA-GigabitEthernet0/0/2] quit
- Verify the configuration.
# Run the display dhcpv6 client command on the Router A to check the DHCPv6 client configuration.
<RouterA> display dhcpv6 client GigabitEthernet0/0/1 is in DHCPv6-PD client mode. State is BOUND. Preferred server DUID : 000300060819A6CDA894 Reachable via address : FE80::A19:A6FF:FECD:A897 IA PD IA ID 0x00000051 T1 43200 T2 69120 Prefix name : myprefix Obtained : 2012-12-22 09:33:09 Renews : 2012-12-22 21:33:09 Rebinds : 2012-12-23 04:45:09 Prefix : FC00:1::/48 Lifetime valid 172800 seconds, preferred 86400 seconds Expires at 2012-12-24 09:33:09(172792 seconds left) DNS server : FC00:2::1
# Run the display dhcpv6 client statistics on the Router A to check DHCPv6 message statistics on the DHCPv6 client.
<RouterA> display dhcpv6 client statistics Message statistics of interface GigabitEthernet0/0/1: Message Received Advertise 1 Reply 1 Reconfigure 0 Invalid 0 Message Sent Solicit 1 Request 1 Confirm 0 Renew 0 Rebind 0 Release 0 Decline 0 Information-request 0
Configuration File
Configuration file of Router A
# sysname RouterA # ipv6 # interface GigabitEthernet0/0/1 ipv6 enable ipv6 address auto link-local dhcpv6 client pd myprefix # dns domain example.com # interface GigabitEthernet0/0/2 ipv6 enable ipv6 address auto link-local undo ipv6 nd ra halt ipv6 nd autoconfig managed-address-flag ipv6 nd autoconfig other-flag ipv6 address myprefix ::1:0:0:0:1/64 # return
Configuration file of Router B
# sysname RouterB # dhcp enable # dhcpv6 pool pool1 prefix-delegation fc00:1::/60 63 dns-server FC00:2::1 #