Basic IPv6 configuration example
Network requirements
As shown in Figure 86, 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 86: Network diagram
Configuration procedure
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
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
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.
Verifying the configuration
# Display IPv6 interface information on Router A.
[RouterA] display ipv6 interface gigabitethernet 1/0/1 GigabitEthernet1/0/1 current state: UP Line protocol current state: UP IPv6 is enabled, link-local address is FE80::20F:E2FF:FE00:2 Global unicast address(es): 3001::1, subnet is 3001::/64 Joined group address(es): FF02::1 FF02::2 FF02::1:FF00:1 FF02::1:FF00:2 MTU is 1500 bytes ND DAD is enabled, number of DAD attempts: 1 ND reachable time is 30000 milliseconds ND retransmit interval is 1000 milliseconds Hosts use stateless autoconfig for addresses IPv6 Packet statistics: InReceives: 25829 InTooShorts: 0 InTruncatedPkts: 0 InHopLimitExceeds: 0 InBadHeaders: 0 InBadOptions: 0 ReasmReqds: 0 ReasmOKs: 0 InFragDrops: 0 InFragTimeouts: 0 OutFragFails: 0 InUnknownProtos: 0 InDelivers: 47 OutRequests: 89 OutForwDatagrams: 48 InNoRoutes: 0 InTooBigErrors: 0 OutFragOKs: 0 OutFragCreates: 0 InMcastPkts: 6 InMcastNotMembers: 25747 OutMcastPkts: 48 InAddrErrors: 0 InDiscards: 0 OutDiscards: 0 [RouterA] display ipv6 interface gigabitethernet 1/0/2 GigabitEthernet1/0/2 current state: UP Line protocol current state: UP IPv6 is enabled, link-local address is FE80::20F:E2FF:FE00:1C0 Global unicast address(es): 2001::1, subnet is 2001::/64 Joined group address(es): FF02::1 FF02::2 FF02::1:FF00:1 FF02::1:FF00:1C0 MTU is 1500 bytes ND DAD is enabled, number of DAD attempts: 1 ND reachable time is 30000 milliseconds ND retransmit interval is 1000 milliseconds ND advertised reachable time is 0 milliseconds ND advertised retransmit interval is 0 milliseconds ND router advertisements are sent every 600 seconds ND router advertisements live for 1800 seconds Hosts use stateless autoconfig for addresses IPv6 Packet statistics: InReceives: 272 InTooShorts: 0 InTruncatedPkts: 0 InHopLimitExceeds: 0 InBadHeaders: 0 InBadOptions: 0 ReasmReqds: 0 ReasmOKs: 0 InFragDrops: 0 InFragTimeouts: 0 OutFragFails: 0 InUnknownProtos: 0 InDelivers: 159 OutRequests: 1012 OutForwDatagrams: 35 InNoRoutes: 0 InTooBigErrors: 0 OutFragOKs: 0 OutFragCreates: 0 InMcastPkts: 79 InMcastNotMembers: 65 OutMcastPkts: 938 InAddrErrors: 0 InDiscards: 0 OutDiscards: 0
# Display IPv6 interface information on Router B.
[RouterB] display ipv6 interface gigabitethernet 1/0/1 GigabitEthernet1/0/1 current state: UP Line protocol current state: UP IPv6 is enabled, link-local address is FE80::20F:E2FF:FE00:1234 Global unicast address(es): 3001::2, subnet is 3001::/64 Joined group address(es): FF02::1 FF02::2 FF02::1:FF00:2 FF02::1:FF00:1234 MTU is 1500 bytes ND DAD is enabled, number of DAD attempts: 1 ND reachable time is 30000 milliseconds ND retransmit interval is 1000 milliseconds Hosts use stateless autoconfig for addresses IPv6 Packet statistics: InReceives: 117 InTooShorts: 0 InTruncatedPkts: 0 InHopLimitExceeds: 0 InBadHeaders: 0 InBadOptions: 0 ReasmReqds: 0 ReasmOKs: 0 InFragDrops: 0 InFragTimeouts: 0 OutFragFails: 0 InUnknownProtos: 0 InDelivers: 117 OutRequests: 83 OutForwDatagrams: 0 InNoRoutes: 0 InTooBigErrors: 0 OutFragOKs: 0 OutFragCreates: 0 InMcastPkts: 28 InMcastNotMembers: 0 OutMcastPkts: 7 InAddrErrors: 0 InDiscards: 0 OutDiscards: 0
# Ping Router A and Router B from the host, and ping Router A and the host from Router B to verify that they can reach each other.
NOTE: To ping a link-local address, use the –i parameter to specify an interface for the link-local address. | ||
[RouterB] ping ipv6 -c 1 3001::1 Ping6(56 data bytes) 3001::2 --> 3001::1, press CTRL_C to break 56 bytes from 3001::1, icmp_seq=0 hlim=64 time=4.404 ms --- Ping6 statistics for 3001::1 --- 1 packet(s) transmitted, 1 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 4.404/4.404/4.404/0.000 ms [RouterB] ping ipv6 -c 1 2001::15B:E0EA:3524:E791 Ping6(56 data bytes) 3001::2 --> 2001::15B:E0EA:3524:E791, press CTRL_C to break 56 bytes from 2001::15B:E0EA:3524:E791, icmp_seq=0 hlim=64 time=5.404 ms --- Ping6 statistics for 2001::15B:E0EA:3524:E791 --- 1 packet(s) transmitted, 1 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 5.404/5.404/5.404/0.000 ms
The output shows that Router B can ping Router A and the host. The host can also ping Router B and Router A (output not shown).