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.

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

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!

Tags: ,


Forum Replies

  1. Hello Renne,

    What does " 2.0.0.0/24 is subnetted, 1 subnets" mean in below output?

    ********

    Branch#show ip route 
    Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
           E1 - OSPF external type 1, E2 - OSPF external type 2
           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1,
           o - ODR, P - periodic downloaded static route
    
    Gateway of last resort is not set
    
    C    192.168.12.0/24 is directly connect
    ... Continue reading in our forum

  2. Florian,
    In the case of a point-to-point link, it is always sufficient to specify the outgoing interface. In the case of a broadcast/multi-access interface (like Ethernet), Cisco’s best practice is to specify BOTH the interface AND the next hop IP address. While in most cases, you can get away with using only the next-hop IP, there are a few circumstances where this can result in unexpected behavior. Cisco has a pretty good article explaining how you can get into trouble without specifying both here:

    http://www.cisco.com/c/en/us/support/docs/dial-access/floa

    ... Continue reading in our forum

  3. Hello Said

    As long as you have connectivity between directly connected routers and you’ve installed the remote networks on each router, you should be OK. No additional configuration should be necessary.

    However, keep in mind that if your three routers are connected to each other in a loop, and you have created static routes to all possible networks, you may have created a routing loop.

    I suggest you try to simplify your topology further and try configuring two routers only and have them share their networks. Once you get that working, you can expand to three

    ... Continue reading in our forum

  4. Hello Lazaros,
    Thank you for your valuable reply.
    My lab setup is as follows, I got R1 connected to R2 (in middle) and R2 is connected to R3, no connection is made between R1 and 3 (no loops here) now lets say R1 has networks 10.0.0.0 on fa interface and 192.168.12.0 on S0 —>R2
    R2 has 2 networks 192.168.12.0 and 192.168.23.0 which connects to both R1 and R3
    R3 has similar setup as R1, network 172.16.0.0 on its Fa interface and 192.168.23.0 on S0 -->R2
    R2 have both directly connected networks plus 172.16.0.0 and 10.0.0.0 configured as static routes.
    R1 has a st

    ... Continue reading in our forum

  5. Got it working! my bad, just added a default route on both edge routers and it worked
    Thanks for the help guys.

    Sid

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