Example for Configuring a DHCPv6 Relay to Assign IPv6 Addresses to the Clients in One Network Segment Connected to the Relay
Networking Requirements
As shown in Figure 9-17, the IPv6 network segment address is fc00:1::/64 and the DHCPv6 server address is fc00:2::3/64. Users expect to obtain IPv6 addresses using DHCPv6. The DHCPv6 client and server are on different network segments; therefore, a DHCPv6 relay agent is required to forward DHCPv6 messages.
It is required that the RouterIndustrial Switch Router should function as the DHCPv6 relay agent to forward DHCPv6 messages between the DHCPv6 client and the DHCPv6 server. In addition, the RouterIndustrial Switch Router functions as the gateway device of the network at fc00:1::/64. The M flag bit and O flag bit in RA messages allow hosts on the network to obtain IPv6 addresses and other network configuration parameters through DHCPv6.
Configuration Roadmap
Enable IPv6 functions on the interface so that devices can implement IPv6 communication.
Enable the DHCPv6 relay function so that the DHCPv6 server and client on different links can transmit packets.
Procedure
- Enable the DHCP service.
<Huawei> system-view [Huawei] sysname Router A [Router A] dhcp enable
- Configure IPv6 functions on an interface.
[Router A] ipv6 [Router A] interface gigabitethernet 1/0/0 [Router A-GigabitEthernet1/0/0] ipv6 enable [Router A-GigabitEthernet1/0/0] ipv6 address fc00:1::1 64 [Router A-GigabitEthernet1/0/0] quit [Router A] interface gigabitethernet 2/0/0 [Router A-GigabitEthernet2/0/0] ipv6 enable [Router A-GigabitEthernet2/0/0] ipv6 address fc00:2::1 64 [Router A-GigabitEthernet2/0/0] quit
- Enable the DHCPv6 relay function.
[Router A] interface gigabitethernet 1/0/0 [Router A-GigabitEthernet1/0/0] dhcpv6 relay destination fc00:2::3
- Configure RouterA as a gateway device.
# Configure RouterA to send RA messages and configure M and O flag bits.
[Router A-GigabitEthernet1/0/0] undo ipv6 nd ra halt [Router A-GigabitEthernet1/0/0] ipv6 nd autoconfig managed-address-flag [Router A-GigabitEthernet1/0/0] ipv6 nd autoconfig other-flag [Router A-GigabitEthernet1/0/0] quit
- Verify the configuration.
# Run the display dhcpv6 relay command on RouterA to check configurations of DHCPv6 relay agent.
[Router A] display dhcpv6 relay Interface Mode Destination ------------------------------------------------------------------ GigabitEthernet1/0/0 Relay FC00:2::3 ------------------------------------------------------------------ Print count : 1 Total count : 1
# Run the display dhcpv6 relay statistics on RouterA to check DHCP message statistics on the DHCPv6 relay agent.
[Router A] display dhcpv6 relay statistics MessageType Receive Send Error Solicit 0 0 0 Advertise 0 0 0 Request 0 0 0 Confirm 0 0 0 Renew 0 0 0 Rebind 0 0 0 Reply 0 0 0 Release 0 0 0 Decline 0 0 0 Reconfigure 0 0 0 Information-request 0 0 0 Relay-forward 0 0 0 Relay-reply 0 0 0 UnknownType 0 0 0
Configuration File
Configuration file of RouterA
# sysname Router A # ipv6 # dhcp enable # interface GigabitEthernet1/0/0 ipv6 enable ipv6 address FC00:1::1/64 dhcpv6 relay destination FC00:2::3 undo ipv6 nd ra halt ipv6 nd autoconfig managed-address-flag ipv6 nd autoconfig other-flag # interface GigabitEthernet2/0/0 ipv6 enable ipv6 address FC00:2::1/64 # return