Fixing incorrect IPv6 routing tables

Students have sometimes difficulties to understand how IPv6 static routes work. A typical exam question to check their ability at understanding IPv6 static routes is to prepare a simple network containing static routes that have been incorrectly specified. Here is a simple IPMininet example network with four routers and two hosts:


        h1 -- ra ---- rb ---- re -- h2
              |       |       |
              + ----- rc ---- +

The script which generates this example is available from https://github.com/obonaventure/RoutingExamples/blob/master/static/static-err2.py.

When using this script, we observe that h1 cannot reach h2:

mininet> pingall
*** Ping: testing reachability over IPv4 and IPv6
h1 --IPv6--> X 
h2 --IPv6--> X 
*** Results: 100% dropped (0/2 received)
mininet> h1 traceroute6 h2
traceroute to 2001:2345:2::2 (2001:2345:2::2) from 2001:2345:1::1, 30 hops max, 16 byte packets
 1  2001:2345:1::a (2001:2345:1::a)  0.049 ms  0.132 ms  0.031 ms
 2  2001:2345:7::b (2001:2345:7::b)  0.072 ms  0.041 ms  0.033 ms
 3  * * *
 4  *^C
mininet> h2 traceroute6 h1
traceroute to 2001:2345:1::1 (2001:2345:1::1) from 2001:2345:2::2, 30 hops max, 16 byte packets
 1  2001:2345:2::e (2001:2345:2::e)  0.048 ms  0.227 ms  0.114 ms
 2  2001:2345:2::e (2001:2345:2::e)  2997.1 ms !H  2999.34 ms !H  2999 ms !H

The IPv6 routing tables on the different routers are configured as follows :

mininet> ra ip -6 route
2001:2345:1::/64 dev ra-eth2  proto kernel  metric 256  pref medium
2001:2345:2::/47 via 2001:2345:7::b dev ra-eth0  proto zebra  metric 20  pref medium
2001:2345:4::/64 dev ra-eth1  proto kernel  metric 256  pref medium
2001:2345:7::/64 dev ra-eth0  proto kernel  metric 256  pref medium
2001:2345:4::/46 via 2001:2345:4::c dev ra-eth1  proto zebra  metric 20  pref medium
mininet> rb ip -6 route
2001:2345:3::/48 via 2001:2345:5::c dev rb-eth1  proto zebra  metric 20  pref medium
2001:2345:2::/47 via 2001:2345:5::c dev rb-eth1  proto zebra  metric 20  pref medium
2001:2345:5::/64 dev rb-eth1  proto kernel  metric 256  pref medium
2001:2345:6::/64 dev rb-eth2  proto kernel  metric 256  pref medium
2001:2345:7::/64 dev rb-eth0  proto kernel  metric 256  pref medium
2001:2345:4::/46 via 2001:2345:5::c dev rb-eth1  proto zebra  metric 20  pref medium
2001:2345::/44 via 2001:2345:7::a dev rb-eth0  proto zebra  metric 20  pref medium
mininet> rc ip -6 route
2001:2345:3::/64 dev rc-eth2  proto kernel  metric 256  pref medium
2001:2345::/46 via 2001:2345:4::b dev rc-eth0  proto zebra  metric 20  pref medium
2001:2345:4::/64 dev rc-eth0  proto kernel  metric 256  pref medium
2001:2345:5::/64 dev rc-eth1  proto kernel  metric 256  pref medium
2001:2345:6::/47 via 2001:2345:5::b dev rc-eth1  proto zebra  metric 20  pref medium
mininet> re ip -6 route
2001:2345:2::/64 dev re-eth2  proto kernel  metric 256  pref medium
2001:2345:3::/64 dev re-eth1  proto kernel  metric 256  pref medium
2001:2345:5::/48 via 2001:2345:6::b dev re-eth0  proto zebra  metric 20  pref medium
2001:2345:6::/64 dev re-eth0  proto kernel  metric 256  pref medium
2001:2345::/40 via 2001:2345:6::c dev re-eth0  proto zebra  metric 20  pref medium

In the output above, note the length of the different prefixes on each router. Can you explain why h1 cannot reach h2 and fix the routing tables so that the two hosts and the four routers car reach any of the IPv6 addresses defined in the network ?

Here is the list of network links to let you match the different interface names.

mininet> links
ra-eth2<->h1-eth0 (OK OK)
ra-eth0<->rb-eth0 (OK OK)
ra-eth1<->rc-eth0 (OK OK)
rb-eth1<->rc-eth1 (OK OK)
rb-eth2<->re-eth0 (OK OK)
rc-eth2<->re-eth1 (OK OK)
re-eth2<->h2-eth0 (OK OK)

Here is another example that uses fewer routes, but still results in an invalid network. The script which generates this second example is available from https://github.com/obonaventure/RoutingExamples/blob/master/static/static-default.py.

This second example uses the same network topology as the first one.

mininet> pingall
*** Ping: testing reachability over IPv4 and IPv6
h1 --IPv6--> X 
h2 --IPv6--> X 
*** Results: 100% dropped (0/2 received)
mininet> h1 traceroute6 h2
traceroute to 2001:2345:2::2 (2001:2345:2::2) from 2001:2345:1::1, 30 hops max, 16 byte packets
 1  2001:2345:1::a (2001:2345:1::a)  0.054 ms  0.027 ms  0.012 ms
 2  * * *
^C
mininet> h2 traceroute6 h1
traceroute to 2001:2345:1::1 (2001:2345:1::1) from 2001:2345:2::2, 30 hops max, 16 byte packets
 1  2001:2345:2::e (2001:2345:2::e)  0.049 ms  0.251 ms  0.039 ms
 2  2001:2345:3::c (2001:2345:3::c)  0.044 ms  0.139 ms  0.129 ms
 3  2001:2345:2::e (2001:2345:2::e)  0.141 ms  0.153 ms  0.124 ms
 4  2001:2345:3::c (2001:2345:3::c)  0.037 ms  0.115 ms  0.037 ms
 5  * 2001:2345:2::e (2001:2345:2::e)  0.301 ms  0.033 ms
 6  2001:2345:3::c (2001:2345:3::c)  0.505 ms  0.067 ms  0.056 ms
 7  2001:2345:2::e (2001:2345:2::e)  0.258 ms  0.054 ms  0.2 ms
 8  2001:2345:3::c (2001:2345:3::c)  0.295 ms  0.07 ms  0.195 ms
 9  2001:2345:2::e (2001:2345:2::e)  0.212 ms *  0.081 ms
10  2001:2345:3::c (2001:2345:3::c)  0.063 ms  0.064 ms  0.051 ms
11  2001:2345:2::e (2001:2345:2::e)  0.232 ms  0.062 ms  0.062 ms
12  2001:2345:3::c (2001:2345:3::c)  0.056 ms  0.072 ms  0.055 ms
13  2001:2345:2::e (2001:2345:2::e)  0.209 ms  0.055 ms^C

The output of traceroute6 is very different from the first example. Here are the IPv6 routing tables of the four routers.

mininet> rb ip -6 route
2001:2345:5::/64 dev rb-eth1  proto kernel  metric 256  pref medium
2001:2345:6::/64 dev rb-eth2  proto kernel  metric 256  pref medium
2001:2345:7::/64 dev rb-eth0  proto kernel  metric 256  pref medium
2001:2345::/44 via 2001:2345:7::a dev rb-eth0  proto zebra  metric 20  pref medium
mininet> rc ip -6 route
2001:2345:3::/64 dev rc-eth2  proto kernel  metric 256  pref medium
2001:2345::/46 via 2001:2345:3::e dev rc-eth2  proto zebra  metric 20  pref medium
2001:2345:4::/64 dev rc-eth0  proto kernel  metric 256  pref medium
2001:2345:5::/64 dev rc-eth1  proto kernel  metric 256  pref medium
mininet> re ip -6 route
2001:2345:2::/64 dev re-eth2  proto kernel  metric 256  pref medium
2001:2345:3::/64 dev re-eth1  proto kernel  metric 256  pref medium
2001:2345:6::/64 dev re-eth0  proto kernel  metric 256  pref medium
2001:2345::/40 via 2001:2345:3::c dev re-eth1  proto zebra  metric 20  pref medium
mininet> ra ip -6 route
2001:2345:1::/64 dev ra-eth2  proto kernel  metric 256  pref medium
2001:2345:4::/64 dev ra-eth1  proto kernel  metric 256  pref medium
2001:2345:7::/64 dev ra-eth0  proto kernel  metric 256  pref medium
default via 2001:2345:4::c dev ra-eth1  proto zebra  metric 20  pref medium

Here is another example that uses fewer routes, but still results in an invalid network. The script which generates this third example is available from https://github.com/obonaventure/RoutingExamples/blob/master/static/static-err3.py.

In this example, the traceroute6 output is again different.

mininet> h2 traceroute6 h1 
traceroute to 2001:2345:1::1 (2001:2345:1::1) from 2001:2345:2::2, 30 hops max, 16 byte packets
 1  2001:2345:2::e (2001:2345:2::e)  0.1 ms  0.259 ms  0.03 ms
 2  2001:2345:3::c (2001:2345:3::c)  0.078 ms !N  0.036 ms !N  0.031 ms !N
mininet> h1 traceroute6 h2 
traceroute to 2001:2345:2::2 (2001:2345:2::2) from 2001:2345:1::1, 30 hops max, 16 byte packets
 1  2001:2345:1::a (2001:2345:1::a)  0.062 ms  0.024 ms  0.012 ms
 2  2001:2345:7::b (2001:2345:7::b)  0.048 ms  0.02 ms  0.012 ms
 3  * * *

Here are the IPv6 routing tables created in this network.

mininet> ra ip -6 route
2001:2345:1::/64 dev ra-eth2  proto kernel  metric 256  pref medium
2001:2345:2::/47 via 2001:2345:7::b dev ra-eth0  proto zebra  metric 20  pref medium
2001:2345:4::/64 dev ra-eth1  proto kernel  metric 256  pref medium
2001:2345:7::/64 dev ra-eth0  proto kernel  metric 256  pref medium
default via 2001:2345:4::c dev ra-eth1  proto zebra  metric 20  pref medium
mininet> rb ip -6 route
2001:2345::/47 via 2001:2345:7::a dev rb-eth0  proto zebra  metric 20  pref medium
2001:2345::/46 via 2001:2345:6::e dev rb-eth2  proto zebra  metric 20  pref medium
2001:2345:5::/64 dev rb-eth1  proto kernel  metric 256  pref medium
2001:2345:6::/64 dev rb-eth2  proto kernel  metric 256  pref medium
2001:2345:7::/64 dev rb-eth0  proto kernel  metric 256  pref medium
mininet> rc ip -6 route
2001:2345:3::/64 dev rc-eth2  proto kernel  metric 256  pref medium
2001:2345:2::/47 via 2001:2345:3::e dev rc-eth2  proto zebra  metric 20  pref medium
2001:2345:4::/64 dev rc-eth0  proto kernel  metric 256  pref medium
2001:2345:5::/64 dev rc-eth1  proto kernel  metric 256  pref medium
mininet> re ip -6 route
2001:2345:2::/64 dev re-eth2  proto kernel  metric 256  pref medium
2001:2345:3::/64 dev re-eth1  proto kernel  metric 256  pref medium
2001:2345:6::/64 dev re-eth0  proto kernel  metric 256  pref medium
2001:2345::/40 via 2001:2345:3::c dev re-eth1  proto zebra  metric 20  pref medium
Written on December 16, 2017