How to configure IPv6 Static Route

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 r2 serial link ipv6 addresses

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.

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

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:23:23::/64 2001:DB8:12:12::2 2

The routing table will then look like this:

R1#show ipv6 route static 

S   2001:DB8:23:23::/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:23:23::/64 Serial 0/0/0 FE80::21C:F6FF:FE11:41F0 2

Here is the routing table:

R1#show ipv6 route static 

S   2001:DB8:23:23::/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!

Tags:


Forum Replies

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

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

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

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

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