Linux IPv6 Static Routes – Ubuntu/Debian & Fedora/RedHat

Looking at my blog statistics I realized that my most popular posts are those related to practical configuration and How To. This post will be one of them.

During the various tests I’ve performed on Linux platforms, one issue that was common –  that if you configure a default gateway like that:


iface eth0 inet6 static
address xxxx:xxxx::xxxx/64
gateway xxxx:xxxx::yyyy


vi /etc/sysconfig/network


vi /etc/sysconfig/network-scripts/ifcfg-eth0


The above works fine when you do network restarts however will fail after a system reboot. The failure is rather interesting. After the reboot it looks like everything is fine till the moment you do some traffic. For instance doing a ping6 will allow one single packet, after which the default is present in the routing table but no packets flow. The situation can be ameliorated by putting in your



ip -6 route add ::/0 via xxxx:xxxx::yyyy dev eth0

The drawback is that even if it works after reboots, you will have to manually add it back after a network restart.
This was not good enough for production.

After searching for some time I finally found how to configure static routes in the right manner so they would work after both reboots and network restart.
An article describing that can be found here or here.

The typical configuration for Ubuntu will be:

vi /etc/network/interfaces

iface eth0 inet6 static
address xxxx:xxxx::xxxx
netmask 64
up ip -6 route add ::/0 via xxxx:xxxx::yyyy dev eth0
down ip -6 route del ::/0 via xxxx:xxxx::yyyy dev eth0

so the routes would add/delete themselves on interface ups or downs.

In case of Fedora/RedHat there is a substitute for the well know


the equivalent for IPv6 would be:

vi /etc/sysconfig/network-scripts/route6-eth0
::/0 via xxxx:xxxx::yyyy dev eth0

Hope this helps.


4 thoughts on “Linux IPv6 Static Routes – Ubuntu/Debian & Fedora/RedHat

  1. You actually make it appear really easy along with your presentation however I in finding this topic to be actually one thing that I feel I would by no means understand. It kind of feels too complex and very broad for me. I am looking forward to your next submit, I’ll attempt to get the hold of it!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s