254
IPv6 configuration examples
Basic IPv6 configuration example
Network requirements
As shown in Figure 94, configure IPv6 addresses for the routers and verify that they can reach each
other. Configure a route to the host on Router B. Enable IPv6 for the host to automatically obtain an
IPv6 address through IPv6 ND. The host has a route to Router B.
Figure 94 Network diagram
Configuration procedure
1. Configure Router A:
# Configure a global unicast address for interface GigabitEthernet 1/0/1.
<RouterA> system-view
[RouterA] interface gigabitethernet 1/0/1
[RouterA-GigabitEthernet1/0/1] ipv6 address 3001::1/64
[RouterA-GigabitEthernet1/0/1] quit
# Configure a global unicast address for interface GigabitEthernet 1/0/2 and enable it to
advertise RA messages (an interface does not advertises RA messages by default).
[RouterA] interface gigabitethernet 1/0/2
[RouterA-GigabitEthernet1/0/2] ipv6 address 2001::1/64
[RouterA-GigabitEthernet1/0/2] undo ipv6 nd ra halt
[RouterA-GigabitEthernet1/0/2] quit
2. Configure Router B:
# Configure a global unicast address for interface GigabitEthernet 1/0/1.
<RouterB> system-view
[RouterB] interface gigabitethernet 1/0/1
[RouterB-GigabitEthernet1/0/1] ipv6 address 3001::2/64
[RouterB-GigabitEthernet1/0/1] quit
# Configure an IPv6 static route to the host.
[RouterB] ipv6 route-static 2001:: 64 3001::1
3. Configure the host:
Enable IPv6 on the host to automatically obtain an IPv6 address through IPv6 ND.
# Display neighbor information for GigabitEthernet 1/0/2 on Router A.
[RouterA] display ipv6 neighbors interface gigabitethernet 1/0/2
Type: S-Static D-Dynamic O-Openflow R-Rule I-Invalid
IPv6 address Link Layer VID Interface State T Age
FE80::215:E9FF:FEA6:7D14 0015-e9a6-7d14 N/A GE1/0/2 STALE D 1238
2001::15B:E0EA:3524:E791 0015-e9a6-7d14 N/A GE1/0/2 STALE D 1248
The output shows that the IPv6 global unicast address that the host obtained is
2001::15B:E0EA:3524:E791.