Tuesday, August 4, 2009

Configuring IPv6 address on Linux

My environment: RH FC8 x86_64

To enable IPv6 globally, modify the file

# vi /etc/sysconfig/network

And append the following:

NETWORKING_IPV6=yes

Then change the NIC config file

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

And append the following IPv6 parameters:

IPV6INIT=yes
IPV6ADDR=<IPv6-IP-Address>
IPV6_DEFAULTGW=<IPv6-IP-Gateway-Address>

If you want to acquire the IPv6 address via DHCPv6 server, first make sure you have the DHCPv6 client installed:

# rpm –q dhcpv6-client

then modifiy the NIC config file and append the following parameters:

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

IPV6INIT=yes
DHCPV6C=yes

Edit the main DHCPv6 client config file

# cp /usr/share/doc/dhcpv6-client-*/dhcp6c.conf /etc/
# vi /etc/dhcp6c.conf

interface eth0 {
    send rapid-commit;
    request domain-name-servers;
};

Restart the network service

# /etc/init.d/network restart

Then check your eth0 configuration to make sure you get the ipv6 address:

# ifconfig eth0

4 comments:

Jeremy said...

What DHCPv6 server are you using?

Panda eats bamboo said...

dhcp6s on Linux

Jeremy said...

cool, so if you happen to have any Windows Vista and above hosts, make sure your router (or radvd if it's also your Linux box) has the "AdvManagedFlag on;" added to the interface. Otherwise, Vista will never do a DHCPv6 solicit multicast message..

I have a pretty in depth discussion on this very thing on our company blog:

http://www.commandinformation.com/blog/?p=114

Panda eats bamboo said...

Thanks Jeremy, that's useful~