Example for Configuring IPv6 Static Routes
Networking Requirements
On an IPv6 network, hosts on different network segments are connected using several Routers. Every two hosts on different network segments can communicate with each other without using dynamic routing protocols.
Configuration Roadmap
The configuration roadmap is as follows:
- Configure IPv6 addresses for interfaces so that devices can communicate with each other.
- Configure the IPv6 default gateway on each host, and configure IPv6 static routes and default routes on each Router so that hosts on different network segments can communicate with each other.
Procedure
- Configure IPv6 addresses for interfaces on each Router.
# Configure IPv6 addresses for interfaces on RouterA.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] ipv6 [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ipv6 enable [RouterA-GigabitEthernet1/0/0] ipv6 address 10::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 1::1/64
The configurations of RouterB and RouterC are similar to the configuration of RouterA, and are not mentioned here.
- Configure IPv6 static routes.
# Configure an IPv6 default route on RouterA.
[RouterA] ipv6 route-static :: 0 gigabitethernet 1/0/0 10::2
# Configure two IPv6 static routes on RouterB.
[RouterB] ipv6 route-static 1:: 64 gigabitethernet 1/0/0 10::1
[RouterB] ipv6 route-static 3:: 64 gigabitethernet 2/0/0 20::2
# Configure an IPv6 default route on RouterC.
[RouterC] ipv6 route-static :: 0 gigabitethernet 1/0/0 20::1
- Configure host addresses and gateways.
Configure IPv6 addresses for hosts according to the networking diagram, and set default gateway addresses of PC1, PC2, and PC3 to 1::1, 2::1, and 3::1 respectively.
- Verify the configuration.
# Check the IPv6 routing table of RouterA.
[RouterA] display ipv6 routing-table
Routing Table : Public Destinations : 5 Routes : 5 Destination : :: PrefixLength : 0 NextHop : 10::2 Preference : 60 Cost : 0 Protocol : Static RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet1/0/0 Flags : D Destination : ::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : InLoopBack0 Flags : D Destination : 1:: PrefixLength : 64 NextHop : 1::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet2/0/0 Flags : D Destination : 1::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet2/0/0 Flags : D Destination : FE80:: PrefixLength : 10 NextHop : :: Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : NULL0 Flags : D
# Run the ping command to verify the connectivity.
[RouterA] ping ipv6 3::1
PING 3::1 : 56 data bytes, press CTRL_C to break
Reply from 3::1
bytes=56 Sequence=1 hop limit=64 time = 63 ms
Reply from 3::1
bytes=56 Sequence=2 hop limit=64 time = 62 ms
Reply from 3::1
bytes=56 Sequence=3 hop limit=64 time = 62 ms
Reply from 3::1
bytes=56 Sequence=4 hop limit=64 time = 63 ms
Reply from 3::1
bytes=56 Sequence=5 hop limit=64 time = 63 ms
--- 3::1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 62/62/63 ms
# Run the tracert command to verify the connectivity.
[RouterA] tracert ipv6 3::1
traceroute to 3::1 30 hops max,60 bytes packet 1 10::2 11 ms 3 ms 4 ms 2 3::1 4 ms 3 ms 3 ms
Configuration Files
Configuration file of RouterA
#
sysname RouterA
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 10::1/64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 1::1/64
#
ipv6 route-static :: 0 GigabitEthernet1/0/0 10::2
#
return
Configuration file of RouterB
#
sysname RouterB
#
ipv6
#
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 2::1/64
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 10::2/64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 20::1/64
#
ipv6 route-static 1:: 64 GigabitEthernet1/0/0 10::1
ipv6 route-static 3:: 64 GigabitEthernet2/0/0 20::2
#
return
Configuration file of RouterC
#
sysname RouterC
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 20::2/64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 3::1/64
#
ipv6 route-static :: 0 GigabitEthernet1/0/0 20::1
#
return