This section provides an example for configuring DHCPv6 relay. This configuration example applies to carrier IP devices.
On the network shown in Figure 1, DHCPv6 clients reside on the network segment 2001:db8:1::/64, and the DHCPv6 server resides on the network segment 2001:db8:2::/64. To allow the DHCPv6 clients to obtain IPv6 addresses and other configuration parameters from the DHCPv6 server, configure DHCPv6 relay on the device in between to relay DHCPv6 messages.
The configuration roadmap is as follows:
To complete the configuration, you need the following data:
Number of the interface to have DHCPv6 relay enabled and IPv6 address of the interface
IPv6 address of the DHCPv6 server
# Configure IPv6 addresses for interfaces.
<HUAWEI> system-view [~HUAWEI] sysname DeviceA [*HUAWEI] commit [~DeviceA] interface gigabitethernet 0/1/0 [~DeviceA-GigabitEthernet0/1/0] ipv6 enable [*DeviceA-GigabitEthernet0/1/0] ipv6 address 2001:db8:1::2/64 [*DeviceA-GigabitEthernet0/1/0] undo shutdown [*DeviceA-GigabitEthernet0/1/0] commit [~DeviceA-GigabitEthernet0/1/0] quit [~DeviceA] interface gigabitethernet 0/1/8 [~DeviceA-GigabitEthernet0/1/8] ipv6 enable [*DeviceA-GigabitEthernet0/1/8] ipv6 address 2001:db8:2::1/64 [*DeviceA-GigabitEthernet0/1/8] undo shutdown [*DeviceA-GigabitEthernet0/1/8] commit [~DeviceA-GigabitEthernet0/1/8] quit
# Enable DHCPv6.
[~DeviceA] dhcpv6 enable
# Configure DHCPv6 relay forwarding on GE 0/1/0.
[~DeviceA] interface gigabitethernet 0/1/0 [~DeviceA-GigabitEthernet0/1/0] dhcpv6 relay destination 2001:db8:2::2 [*DeviceA-GigabitEthernet0/1/0] commit [~DeviceA-GigabitEthernet0/1/0] quit
Run the display dhcpv6 relay statistics command on the DHCPv6 relay agent. The command output shows statistics about various DHCPv6 messages.
[~DeviceB] display dhcpv6 relay statistics ------------------------------------------------------------------- Bad Packets received : 0 DHCPv6 packets received from clients : 41357 DHCPv6 SOLICIT packets received : 41357 DHCPv6 REQUEST packets received : 0 DHCPv6 CONFIRM packets received : 0 DHCPv6 RENEW packets received : 0 DHCPv6 REBIND packets received : 0 DHCPv6 DECLINE packets received : 0 DHCPv6 RELEASE packets received : 0 DHCPv6 INFORMATION-REQUEST packets received : 0 DHCPv6 packets received from relay agents or servers: 6 DHCPv6 RELAY-FORWARD packets received : 6 DHCPv6 RELAY-REPLY packets received : 0 DHCPv6 packets sent to clients : 0 DHCPv6 ADVERTISE packets sent : 0 DHCPv6 REPLY packets sent : 0 DHCPv6 RECONFIGURE packets sent : 0 DHCPv6 packets sent to relay agents or servers : 41333 DHCPv6 RELAY-FORWARD packets sent : 41333 DHCPv6 RELAY-REPLY packets sent : 0 DHCPv6 packets dropped : 33 Table Full : 0 General Error : 33 IPSec Authentication Failed : 0 -------------------------------------------------------------------
DHCPv6 Relay configuration file
# sysname DeviceA dhcpv6 enable # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8:1::2/64 dhcpv6 relay destination 2001:db8:2::2 # interface GigabitEthernet 0/1/8 undo shutdown ipv6 enable ipv6 address 2001:db8:2::1/64 # return