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.
Configuration
To 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 prefix
Let’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 interface
Like 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/0
Here’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 connected
Let’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 ms
Our ping is working.
Static route for a prefix – global unicast next hop
Instead 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::2
Here’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::2
Let’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 ms
No problem at all…
Static route for a prefix – link-local next hop
One 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:41F0
Let’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:41F0
Here’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/0
Just 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 ms
No problems there.
Static default route
Just 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 interface
Let’s start with the outgoing interface first:
R1(config)#ipv6 route ::/0 Serial 0/0/0
Here’s the routing table:
R1#show ipv6 route static
S ::/0 [1/0]
via Serial0/0/0, directly connected
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 default route – global unicast next hop
Instead of an outgoing interface, let’s try a global unicast next-hop address:
R1(config)#ipv6 route ::/0 2001:DB8:12:12::2
Here’s the routing table:
R1#show ipv6 route static
S ::/0 [1/0]
via 2001:DB8:12:12::2
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
Time for the next option.
Static default route – link-local next hop
Let’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:41F0
Here’s the routing table:
R1#show ipv6 route static
S ::/0 [1/0]
via FE80::21C:F6FF:FE11:41F0, Serial0/0/0
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
Our ping is working.
Static host route
We 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 interface
First, we will try the outgoing interface:
R1(config)#ipv6 route 2001:DB8:2:2::2/128 Serial 0/0/0
Here is the routing table:
R1#show ipv6 route static
S 2001:DB8:2:2::2/128 [1/0]
via Serial0/0/0, directly connected
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 – global unicast next hop
Let’s try a global unicast address as the next hop:
R1(config)#ipv6 route 2001:DB8:2:2::2/128 2001:DB8:12:12::2
Here is the routing table:
R1#show ipv6 route static
S 2001:DB8:2:2::2/128 [1/0]
via 2001:DB8:12:12::2
And 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 hop
Last 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:41F0
Here’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/0
Let’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 route
We 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.
Hello,
please help me with IPv6 default route.
for example:
Futura(config)#ipv6 route ::/0 fastEthernet 0/0 FE80::CE0A:22FF:FED5:0
so ::/0 means, any address, where must match 0 bytes.
Is my example of default route correct?
Thank you
Hi,
Using ::/0 for the default route is correct. The :: part means all 0s and the /0 represents the network mask, not the bytes.
Rene
Hello Rene,
Thanks alot for your amazing way to explain this.
I have a question, how did you get the address FE80::CE0A:22FF:FED5:0
is it any address start with FE80 (link local) or what? I did not get it.
Thanks in advance
Wisam
Hi Wisam,
Everything that starts with FE80::/10 is a link-local address. The remaining part of the address was generated with EUI-64. This article will help:
https://networklessons.com/ipv6/ipv6-eui-64-explained
Rene
Hello Rene,
Thanks alot for your reply.
I still did not get how you get it to write it in your command line below,
“Futura(config)#ipv6 route 2001::2/128 fastEthernet 0/0 FE80::CE0A:22FF:FED5:0”
where we can find it? do we have to use show command before we add this line.
Thanks Rene
Wisam