Native IPv6 Networking On RedHat And Debian Based Distributions

| 6 Comments | 1 TrackBack
We have had a nice native IPv6 network at Blacknight for a while. Until recently we haven't been making much use of it, but that is changing. Various hosts on the network such as www and mail are gradually being IPv6 enabled. Documentation for setting up native IPv6 on Redhat based distributions was a bit lacking so I've included the steps for adding an IPv6 address to eth0 below. I've also added details on how to add it to Debian based distributions.
Much like IPv4 you need three items, an IPv6 address, the subnet mask and the IPv6 Gateway address. For the examples below I'll use the following info:
IPv6 Address: 2001:0db8:100:f101::2
Netmask: 64
Gateway: 2001:0db8:100:f101::1

Once you have it set up you can use ping6 to ping something like and make sure everything is working as expected.

RedHat Based Distributions:

Documentation on the web for IPv6 seems to be sparse, or my GoogleFoo is getting worse. However there is information available in /usr/share/doc/initscripts-7.93.25.EL/sysconfig.txt on RedHat Enterprise Linux. There are two files to be edited: /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth0. In /etc/sysconfig/network you have to add the following two lines:
In /etc/sysconfig/network-scripts/ifcfg-eth0 add the following:
Once both files are saved, you can run "service network restart" in order to bring the changes into effect. Debian Based Distributions: In Debain and Ubuntu there is only one file to be editted, /etc/network/interfaces. You add the following:
iface eth0 inet6 static
    address 2001:0db8:100:f101::2
    netmask 64
    gateway 2001:0db8:100:f101::1
One the file has been saved, run "/etc/init.d/networking restart".

Update: April 1st 2007 Posted updated to make more sense. I am now using IPs from the IPv6 Documentation Prefix. Thanks Colm.

1 TrackBack

from IPV6 on RedHat on March 31, 2007 2:31 PM

TITLE: URL: IP: BLOG NAME: IPV6 on RedHat DATE: 03/31/2007 02:31:28 PM Read More


eh, your gateway isn't in the same subnet as the address. They're not even the same /48. never mind /64. And you really shouldn't be using the all-zeroes address in a subnet as a gateway, there've been a few proposals to make it do different things.

Additionally, you should really be using the IPv6 documentation prefix (2001:db8::/32) for all examples and documentation. The addresses you give are *extremely* confusing, and are actually two completely different 6to4 prefixes that will *never* route like that in the real world.


Didn't realise there was a documentation prefix. Post has been edited accordingly.

For the record,rather than use the real address I was working on, I used ipv6calc to convert RFC1918 addresses to IPv6, forgetting about the subnet mask.

o.k., with respect, you really shouldn't be writing blogposts guiding others on IPv6, because you're making mistake after mistake.

This article it titled "native" (well natvie), but the addresses you've first used were tunnelled addresses. 6to4 is not a general "convert IPv4 addresses to IPv6", it's just a tunnelling mechanism with an embedded IPv4 address.

Your fixes have more problems. Now you're using a /32 as a LAN, but you're only supposed to use /64's for LANs, that way things like EUI-64 work. This is the core of IPv6 network design.

Which brings me to by next point; the above configuration is not suitable for the vast majority of cases. Most hosts should be assigned an address automatically via a mechanism called EUI-64, and you should be running IPv6 router advertisements on the gateway. This is much of the point of IPv6, it makes network administration easier by avoiding the kind of configuration you have here.

On both redhat and debian/ubuntu, you need only load the IPv6 module, and it will automatically configure an address and gateway if the network is running IPv6 router-advertisements (see radvd for a daemon which does this on linux/bsd).

Hard-coded addresses are only suitable in a tiny minority of cases, like when you have a server that needs to keep the same address when you change network card (autoconfigured addresses are MAC dependent).

I think you need to step back from doing IPv6 for a while, and I recommend reading Dave Malone and Richard Murphy's "IPv6 network adminstration". You need to clear up some basic misconceptions and mis-understandings before you break something really seriously on yourself.

You'll find my name in the credits for that howto. You don't need to point me to it.

IPv6 is excellently documented online, including in that very howto. I duspute your assertion, it may work at first, but what about when you later want to re-number the network, or change gateway? IPv6 gives you that flexibility natively, and you're just throwing it away. I never hard-code gateways, even when I use static addresses, and instead use router advertisements. There are very powerful reasons in favour of doing that.

There is *nothing* wrong with being a newb, and learning as you go along. That's great, and it's brilliant that you're taking up IPv6, it's *great* to see adopters. If you ask questions on ILUG, or SAGE, or IE-NOG, you'll get plenty of answers :-)

But giving out advice on something you're learning as you go along is just a terrible idea, because then our mistakes get repeated by others :/


As I see it, despite the errors in the addresses I gave in the first version of the post, the basic info on how to add the static addresses was spot on. The documentation in that howto deals with adding the addresses using ifconfig and ip, but doesn't deal with doing it using the native methods in distributions, whether it be sysconfig or /etc/network/interfaces.

It might not be the pure IPv6 way to do it, but it sure as hell works if you want to add an IPv6 address to the system. Not every network has Radvd setup. The title could probably be better than "Native IPv6 Networking" in retrospect.

There are very powerful reasons to advertise routes on the network. I have a copy of IPv6 Network Administration here beside me, and my poor head is getting slightly overwhelmed at just how much IPv6 can do, and I'm going to enjoy repeatedly breaking my little test network at home while playing with Radvd and Quagga.

About this Entry

This page contains a single entry by Niall Donegan published on March 30, 2007 3:38 PM.

Internet Explorer 6 On Linux With IE4Linux was the previous entry in this blog.

Rescanning For IDE DVD Drive In Ubuntu is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.


OpenID accepted here Learn more about OpenID
Creative Commons License
This blog is licensed under a Creative Commons License.
Powered by Movable Type 5.02