How to configure IPv6 Static Route | 您所在的位置:网站首页 › 不锈钢过滤网目数标准 › How to configure IPv6 Static Route |
Lesson Contents If you know how to configure a static route for IPv4, you shouldn’t have any issues with IPv6 static routes. The configuration and syntax are similar. There are only some minor differences. In this lesson, I will show you how to configure all IPv6 static route types. ConfigurationTo demonstrate this topology, I will use the following topology: R1 and R2 are connected with a serial link. R2 has a loopback interface with IPv6 address 2001:DB8:2:2::2/64. Let’s see if we can reach this address. Static route for a prefixLet’s start with a simple example where we create a static route for the prefix we want to reach: 2001:DB8:2:2::/64. Static route for a prefix – outgoing interfaceLike with IPv4, it is possible to use an interface as the next hop. This will only work with point-to-point interfaces: R1(config)#ipv6 route 2001:DB8:2:2::/64 Serial 0/0/0Here’s what the routing table looks like: R1#show ipv6 route static S 2001:DB8:2:2::/64 [1/0] via Serial0/0/0, directly connectedLet’s see if it works: R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 msOur ping is working. If you try this with a FastEthernet interface, you’ll see that the router will accept the command, but the ping won’t work. You can’t use this for multi-access interfaces. Static route for a prefix – global unicast next hopInstead of an outgoing interface, we can also specify the global unicast address as the next hop: R1(config)#ipv6 route 2001:DB8:2:2::/64 2001:DB8:12:12::2Here’s what the routing table looks like: R1#show ipv6 route static S 2001:DB8:2:2::/64 [1/0] via 2001:DB8:12:12::2Let’s see if it works: R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 msNo problem at all… Instead of global unicast addresses, you can also use unique local addresses. These are the IPv6 equivalent of IPv4 private addresses. Static route for a prefix – link-local next hopOne of the differences between IPv4 and IPv6 is that IPv6 generates a link-local address for each interface. These link-local addresses are also used by routing protocols like RIPng, EIGRP, OSPFv3, etc, as the next-hop addresses. Let’s see what the link-local address is of R2: R2#show ipv6 interface Serial 0/0/0 | include link-local IPv6 is enabled, link-local address is FE80::21C:F6FF:FE11:41F0Let’s use this as the next-hop address. When you use a global unicast address as the next hop, your router can look at the routing table and figure out what outgoing interface to use to reach this global unicast address. With link-local addresses, the router has no clue which outgoing interface to use so you will have to specify both the outgoing interface and the link-local address: R1(config)#ipv6 route 2001:DB8:2:2::/64 Serial 0/0/0 FE80::21C:F6FF:FE11:41F0Here’s what the routing table looks like: R1#show ipv6 route static S 2001:DB8:2:2::/64 [1/0] via FE80::21C:F6FF:FE11:41F0, Serial0/0/0Just to be sure, let’s try a ping: R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 msNo problems there. Static default routeJust like IPv4, we can also create static default routes. A default route has only zeroes (::) and a /0 prefix length. This is the equivalent of 0.0.0.0/0 in IPv4. We can do this with an interface, global unicast, or link-local address. Let’s try all options! Static default route – outgoing interfaceLet’s start with the outgoing interface first: R1(config)#ipv6 route ::/0 Serial 0/0/0Here’s the routing table: R1#show ipv6 route static S ::/0 [1/0] via Serial0/0/0, directly connectedLet’s try a quick ping: R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 ms Static default route – global unicast next hopInstead of an outgoing interface, let’s try a global unicast next-hop address: R1(config)#ipv6 route ::/0 2001:DB8:12:12::2Here’s the routing table: R1#show ipv6 route static S ::/0 [1/0] via 2001:DB8:12:12::2Let’s try a quick ping: R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 msTime for the next option. Static default route – link-local next hopLet’s replace the global unicast next hop address with a link-local address: R1(config)#ipv6 route ::/0 Serial 0/0/0 FE80::21C:F6FF:FE11:41F0Here’s the routing table: R1#show ipv6 route static S ::/0 [1/0] via FE80::21C:F6FF:FE11:41F0, Serial0/0/0Let’s try a quick ping: R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 msOur ping is working. Static host routeWe can also create static routes for a single IPv6 address, called a static host route. These examples are the same as the ones you have seen before, but this time, we will create an entry for 2001:DB8:2:2::2/128, which is similar to using a /32 subnet mask in IPv4. Static host route – outgoing interfaceFirst, we will try the outgoing interface: R1(config)#ipv6 route 2001:DB8:2:2::2/128 Serial 0/0/0Here is the routing table: R1#show ipv6 route static S 2001:DB8:2:2::2/128 [1/0] via Serial0/0/0, directly connectedLet’s try a quick ping: R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 ms Static host route – global unicast next hopLet’s try a global unicast address as the next hop: R1(config)#ipv6 route 2001:DB8:2:2::2/128 2001:DB8:12:12::2Here is the routing table: R1#show ipv6 route static S 2001:DB8:2:2::2/128 [1/0] via 2001:DB8:12:12::2And let’s try a quick ping: R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 ms Static host route – link-local next hopLast but not least, a link-local address as the next hop address: R1(config)#ipv6 route 2001:DB8:2:2::2/128 Serial 0/0/0 FE80::21C:F6FF:FE11:41F0Here’s R1’s routing table: R1#show ipv6 route static S 2001:DB8:2:2::2/128 [1/0] via FE80::21C:F6FF:FE11:41F0, Serial0/0/0Let’s try another ping: R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 ms Static floating routeWe can also configure floating static routes. To test this, I have to add another router: R3 is added to our topology, and I configured the same loopback address (2001:DB8:23:23::23/128) on both routers. R3 will be used as our main path to reach this address. When the link is down, we want to use R2. Here’s the static route that is used to use R3 as the primary path: R1(config)#ipv6 route 2001:DB8:23:23::/64 2001:DB8:13:13::3 Static floating route – outgoing interfaceLet’s try the outgoing interface first. The static route looks like this: R1(config)#ipv6 route 2001:DB8:23:23::/64 Serial 0/0/0 2Note that at the end of the line above, I specified the administrative distance with a value of 2. With both interfaces up, R1 will send all traffic to R3: R1#show ipv6 route static S 2001:DB8:23:23::/64 [1/0] via 2001:DB8:13:13::3Above, you can see that the default administrative distance is 1. Let’s shut the FastEthernet 0/0 interface to test our static floating route: R1(config)#interface FastEthernet 0/0 R1(config-if)#shutdownLet’s look at the routing table again: R1#show ipv6 route static S 2001:DB8:2:2::/64 [2/0] via Serial0/0/0, directly connectedThe entry to R2 is now installed. You can also see the administrative distance value of two in the routing table. Static floating route – global unicast next hopInstead of the outgoing interface, we can also use a global unicast address as the next hop: R1(config)#ipv6 route 2001:DB8:2:2::/64 2001:DB8:12:12::2 2The routing table will then look like this: R1#show ipv6 route static S 2001:DB8:2:2::/64 [2/0] via 2001:DB8:12:12::2 Static floating route – link-local next hopOr use a link-local address as the next hop: R1(config)#ipv6 route 2001:DB8:2:2::/64 Serial 0/0/0 FE80::21C:F6FF:FE11:41F0 2Here is the routing table: R1#show ipv6 route static S 2001:DB8:2:2::/64 [2/0] via FE80::21C:F6FF:FE11:41F0, Serial0/0/0 ConclusionYou have now learned how to configure the following IPv6 static routes: Static route for a prefix Static default route Static host route Static floating routeAnd how to do this with different next-hop types: Outgoing interface (only for point-to-point interfaces) Global unicast address Link-local addressI hope these examples have been useful to you! |
CopyRight 2018-2019 实验室设备网 版权所有 |