Example for Configuring a DHCPv6 Server
Networking Requirements
If a large number of IPv6 addresses need to be manually configured, the workload on configuration will be huge, and the manually configured addresses have poor manageability. The administrator requires that IPv6 addresses and network configuration parameters be obtained automatically to facilitate centralized management and hierarchical IPv6 network deployment.
Configuration Roadmap
Enable IPv6 functions on the interface so that devices can communicate using IPv6.
Enable the DHCPv6 Server function so that devices can assign IPv6 addresses using DHCPv6.
Procedure
- Enable the DHCP service.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] dhcp enable
- Configure a DHCPv6 server.
[RouterA] dhcpv6 pool pool1 [RouterA-dhcpv6-pool-pool1] address prefix fc00:3::/64 [RouterA-dhcpv6-pool-pool1] dns-server fc00:3::1 [RouterA-dhcpv6-pool-pool1] excluded-address fc00:3::1 [RouterA-dhcpv6-pool-pool1] quit
- Configure IPv6 functions on an interface.
[RouterA] ipv6 [RouterA] interface gigabitethernet 0/0/1 [RouterA-GigabitEthernet0/0/1] ipv6 enable [RouterA-GigabitEthernet0/0/1] ipv6 address fc00:3::1/64
- Enable the DHCPv6 server function on the interface.
[RouterA-GigabitEthernet0/0/1] dhcpv6 server pool1
- Enable the RA message advertisement function to make the DHCPv6 client learn the default route destined for the IPv6 gateway through RA messages. Configure the M and O flags of the advertised RA messages to make the DHCPv6 client obtain an IPv6 address and other network parameters using DHCP.
[RouterA-GigabitEthernet0/0/1] undo ipv6 nd ra halt [RouterA-GigabitEthernet0/0/1] ipv6 nd autoconfig managed-address-flag [RouterA-GigabitEthernet0/0/1] ipv6 nd autoconfig other-flag [RouterA-GigabitEthernet0/0/1] ipv6 nd ra prefix default no-advertise //Specifies that RA packets do not carry the default prefix generated based on the interface IPv6 address. [RouterA-GigabitEthernet0/0/1] quit [RouterA] quit
- Verify the configuration.
# Run the display dhcpv6 pool command on the RouterIndustrial Switch Router to check information about the DHCPv6 address pool.
<RouterA> display dhcpv6 pool pool1 DHCPv6 pool: pool1 Address prefix: FC00:3::/64 Lifetime valid 172800 seconds, preferred 86400 seconds 0 in use, 0 conflicts Excluded-address FC00:3::1 1 excluded addresses Information refresh time: 86400 DNS server address: FC00:3::1 Conflict-address expire-time: 172800 renew-time-percent : 50 rebind-time-percent : 80 Active normal clients: 0 Logging : Disable
# Run the display dhcpv6 server command on the RouterIndustrial Switch Router to check information about the DHCPv6 server.
<RouterA> display dhcpv6 server Interface DHCPv6 pool GigabitEthernet0/0/1 pool1
Configuration File
Configuration file of RouterA
# sysname RouterA # ipv6 # dhcp enable # dhcpv6 pool pool1 address prefix FC00:3::/64 excluded-address FC00:3::1 dns-server FC00:3::1 # interface GigabitEthernet0/0/1 ipv6 enable ipv6 address FC00:3::1/64 undo ipv6 nd ra halt ipv6 nd ra prefix default no-advertise ipv6 nd autoconfig managed-address-flag ipv6 nd autoconfig other-flag dhcpv6 server pool1 # return