How to configure IPv6 Static Route

If you know how to configure a static route for IPv4 then 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 r2 serial link ipv6 addresses

R1 and R2 are connected with a serial link. R2 has a loopback interface with IPv6 addresss 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

Just 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.

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 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…

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 hop

One of the differences between IPv4 and IPv6 is that IPv6 generates a link-local address for each interface. In fact, 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 will be able to 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, this is 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:

r1 r2 r3 serial fastethernet ipv6 addresses

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 interface

Let’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 2

Note 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::3

Above 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)#shutdown

Let’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 connected

The 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 hop

Instead 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 2

The 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 hop

Or 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 2

Here 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

Conclusion

You have now learned how to configure the following IPv6 static routes:

  • Static route for a prefix
  • Static default route
  • Static host route
  • Static floating route

And how to do this with different next hop types:

  • Outgoing interface (only for point-to-point interfaces)
  • Global unicast address
  • Link-local address

I hope these examples have been useful to you!

Forum Replies

  1. Ok first question. In you post you have the following below. YOu will notice its pointing to :2:2 however there is no :2:2 network on any of the routers is this a typo did you mean to say :23:23::??? also its a 64 instead of a 128 which is what the loopback is. However maybe all addresses are held within the 128?? So your just pointing to a non-existent address knowing that since the one is a prefix of 128 that can hold all addresses so its being sent that way. very cryptic though and I wanted to confirm.

    if this is just a typo then you might want to

    ... Continue reading in our forum

  2. Hello Brian

    It seems that @ReneMolenaar is using the 2001:2:2::/64 prefix for the L0 interface on R2 in the first diagram, but when he adds R3 to the topology, he changes it to 2001:23:23::/64. I’ll let him know to change it so that it is consistent all the way through the lesson, either 2:2 or 23:23, including the routing tables.

    ... Continue reading in our forum

  3. Hello @lagapides

    Could you please explain why this happens? I just tried to lab it out (using F0/0) and it didn’t work as well

    “Just like with IPv4, it is possible to use an interface as the next hop. This will only work with point-to-point interfaces, 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.”

  4. Hello Sales

    It is generally not a good idea to configure default route using only physical interface as next-hop if this physical interface is NOT point-to-point. For example its NOT good to use physical interface as nex-hop if it is an Ethernet interface, because ethernet is broadcast multi access by its nature.

    I suggest you to do small l

    ... Continue reading in our forum

27 more replies! Ask a question or join the discussion by visiting our Community Forum