Example for Configuring a DHCPv6 Relay to Assign IPv6 Addresses to the Clients in Multiple Network Segments Connected to the Relay
Networking Requirements
As shown in Figure 9-18, the DHCPv6 server needs to dynamically assign IPv6 addresses to the clients on two network segments fc00:1::/64 and fc00:2::/64, and the DHCPv6 server and clients are in different links. The addresses fc00:1::1/64 and fc00:2::1/64 on RouterA are used as the gateway addresses of the clients on the network segments fc00:1::/64 and fc00:2::/64.
Configuration Roadmap
Configure the DHCPv6 relay function on RouterA to forward DHCPv6 packets between the DHCPv6 server and clients so that the clients can dynamically obtain IPv6 addresses.
The RouterIndustrial Switch Router is used as an example to describe the DHCPv6 server configuration procedure.
Procedure
- Configure RouterA as the DHCPv6 relay.
# Enable the DHCP service.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] dhcp enable
# Configure IPv6 addresses for interfaces.
[RouterA] ipv6 [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ipv6 enable [RouterA-GigabitEthernet1/0/0] ipv6 address fc00:1::1 64 [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] ipv6 enable [RouterA-GigabitEthernet2/0/0] ipv6 address fc00:2::1 64 [RouterA-GigabitEthernet2/0/0] quit [RouterA] interface gigabitethernet 3/0/0 [RouterA-GigabitEthernet3/0/0] ipv6 enable [RouterA-GigabitEthernet3/0/0] ipv6 address fc00:3::1 64 [RouterA-GigabitEthernet3/0/0] quit
# Enable the DHCPv6 relay function.
[RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] dhcpv6 relay destination fc00:3::3 [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] dhcpv6 relay destination fc00:3::3 [RouterA-GigabitEthernet2/0/0] quit
# Configure RouterA to function as the gateway to send the M and O flags of RA messages to clients so that the clients can obtain IPv6 addresses through DHCPv6.
[RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] undo ipv6 nd ra halt [RouterA-GigabitEthernet1/0/0] ipv6 nd autoconfig managed-address-flag [RouterA-GigabitEthernet1/0/0] ipv6 nd autoconfig other-flag [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] undo ipv6 nd ra halt [RouterA-GigabitEthernet2/0/0] ipv6 nd autoconfig managed-address-flag [RouterA-GigabitEthernet2/0/0] ipv6 nd autoconfig other-flag [RouterA-GigabitEthernet2/0/0] quit
- Configure RouterB as the DHCPv6 server.
<Huawei> system-view [Huawei] sysname RouterB [RouterB] dhcp enable [RouterB] ipv6 [RouterB] interface gigabitethernet 1/0/0 [RouterB-GigabitEthernet1/0/0] ipv6 enable [RouterB-GigabitEthernet1/0/0] ipv6 address fc00:3::3 64 [RouterB-GigabitEthernet1/0/0] quit [RouterB] dhcpv6 pool pool1 [RouterB-dhcpv6-pool-pool1] address prefix fc00:1::/64 [RouterB-dhcpv6-pool-pool1] excluded-address fc00:1::1 [RouterB-dhcpv6-pool-pool1] quit [RouterB] dhcpv6 pool pool2 [RouterB-dhcpv6-pool-pool2] address prefix fc00:2::/64 [RouterB-dhcpv6-pool-pool1] excluded-address fc00:2::1 [RouterB-dhcpv6-pool-pool2] quit [RouterB] dhcpv6 server preference 255 [RouterB] ipv6 route-static :: 0 fc00:3::1
- Configure the DHCPv6 client (Windows 7 is used as an example of the operating system on the PC).
- Right-click Network and choose Properties to display the Network and Sharing Center window.
- Click Local Area Connection to display the Local Area Connection Status window.
- Click Properties to display the Local Area Connection Properties window.
- Select Internet Protocol Version 6 (TCP/IPv6) and click Properties to display the Internet Protocol Version 6 (TCP/IPv6) Properties window. Select Obtain an IPv6 address automatically and Obtain DNS server address automatically, and click OK.
- Verify the configuration.
# Run the display dhcpv6 relay command on RouterA to check the DHCPv6 relay configuration.
[RouterA] display dhcpv6 relay Interface Mode Destination -------------------------------------------------------------------------------- GigabitEthernet1/0/0 Relay FC00:3::3 GigabitEthernet2/0/0 Relay FC00:3::3 -------------------------------------------------------------------------------- Print count : 2 Total count : 2
# Run the display dhcpv6 pool command on RouterB to check the DHCPv6 address pool configuration.[RouterB] display dhcpv6 pool DHCPv6 pool: pool1 Address prefix: FC00:1::/64 Lifetime valid 172800 seconds, preferred 86400 seconds 4 in use, 0 conflicts Excluded-address FC00:1::1 1 excluded addresses Information refresh time: 86400 Conflict-address expire-time: 172800 renew-time-percent : 50 rebind-time-percent : 80 Active normal clients: 4 Logging : Disable DHCPv6 pool: pool2 Address prefix: FC00:2::/64 Lifetime valid 172800 seconds, preferred 86400 seconds 2 in use, 0 conflicts Excluded-address FC00:2::1 1 excluded addresses Information refresh time: 86400 Conflict-address expire-time: 172800 renew-time-percent : 50 rebind-time-percent : 80 Active normal clients: 2 Logging : Disable Total of dhcpv6 pool : 2
# Run the display dhcpv6 pool pool1 allocated address and display dhcpv6 pool pool2 allocated address commands on RouterB to check the assignment of IPv6 addresses in the DHCPv6 address pool.[RouterB] display dhcpv6 pool pool1 allocated address Address Valid Expires Left ------------------------------------------------------------------------------- FC00:1::2 172800 2013-09-06 03:09:02 166610 FC00:1::3 172800 2013-09-06 03:09:02 166610 FC00:1::4 172800 2013-09-06 03:09:02 166610 FC00:1::5 172800 2013-09-06 03:09:02 166610 ------------------------------------------------------------------------------- Total : 4 [RouterB] display dhcpv6 pool pool2 allocated address Address Valid Expires Left ------------------------------------------------------------------------------- FC00:2::2 172800 2013-09-06 03:09:02 166610 FC00:2::3 172800 2013-09-06 03:09:02 166610 ------------------------------------------------------------------------------- Total : 2
Configuration Files
Configuration file of RouterA
# sysname RouterA # ipv6 # dhcp enable # interface GigabitEthernet1/0/0 ipv6 enable ipv6 address FC00:1::1/64 undo ipv6 nd ra halt ipv6 nd autoconfig managed-address-flag ipv6 nd autoconfig other-flag dhcpv6 relay destination FC00:3::3 # interface GigabitEthernet2/0/0 ipv6 enable ipv6 address FC00:2::1/64 undo ipv6 nd ra halt ipv6 nd autoconfig managed-address-flag ipv6 nd autoconfig other-flag dhcpv6 relay destination FC00:3::3 # interface GigabitEthernet3/0/0 ipv6 enable ipv6 address FC00:3::1/64 # return
Configuration file of RouterB
# sysname RouterB # ipv6 # dhcp enable # dhcpv6 server preference 255 # dhcpv6 pool pool1 address prefix FC00:1::/64 excluded-address FC00:1::1 # dhcpv6 pool pool2 address prefix FC00:2::/64 excluded-address FC00:2::1 # interface GigabitEthernet1/0/0 ipv6 enable ipv6 address FC00:3::3/64 # ipv6 route-static :: 0 FC00:3::1 # return