Native IPv6 Networking On RedHat And Debian Based Distributions
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 sixxs.net 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:
NETWORKING_IPV6=yes IPV6_DEFAULTGW=2001:0db8:100:f101::1In /etc/sysconfig/network-scripts/ifcfg-eth0 add the following:
IPV6INIT=yes IPV6ADDR="2001:0db8:100:f101::2/64"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::1One 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 TrackBacks
Listed below are links to blogs that reference this entry: Native IPv6 Networking On RedHat And Debian Based Distributions.
TrackBack URL for this entry: http://blog.moybella.net/cgi-bin/mt-tb.cgi/43

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.
Colm,
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.
Colm,
To quote from the Section 3.3.2 from the Linux IPv6 Howto:
"For servers it's probably easier to remember simpler addresses, this can also be accommodated. It is possible to assign an additional IPv6 address to an interface"
I am an IPv6 newb, and still trying to learn as I go along. The main reason for this post was that when I tried to assign an IPv6 address to a RHEL box, the documentation available online was non-existent. If you put in the above config with a valid host, gateway and netmask, it will work. I have proved it on numerous hosts at this stage.
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 :/
Colm,
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.