IPv6 on CentOS 6 and CentOS 7.4 VPS

ipv6For almost 20 years I’m working in IT and I hear “we’re running our of IPv4 addresses” and “IP version 6 is coming”. Although this is the truth, there are still not a lot of situations I come across that I need an IPv6 address.

And then there was this situation where I very recently came across the IP version 6 beast and a couple of times in my most recent certification. So that immediately makes it current!

With my VPS provider such an address is standard in their portal, in their DNS and in my VPS. It is the future, so I better make sure my VPS runs with it.

It apparently is the default of my provider to give a whole range of these next generation addresses, which confused me. In their portal I had this one address and in my Linux CentOS 7 VPS I had another address. So what’s going on?

The one in their portal was the first address in the range so I’ve decided to roll with that one. I’m having CentOS 6 and CentOS 7 machines and configuring these IP adresses is almost the same on them.

Setup IPv6

On CentOS 6 only:

# vi /etc/sysctl.conf

Change the IPv6 values to:

net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0

# reboot

On both CentOS 6 and CentOS 7:

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

Add your additional IP config:


And restart your network:

# /etc/init.d/network restart (CentOS 6)

# systemctl restart network (CentOS 7)

Test your config

You can ping your machines with ping6 or ping -6 and SSH into them via IPv6 with the ssh -6 command. You don’t need the IPv6 address, just use your FQDN, the -6 forces it to IPv6.

I was wondering and did check if my new IP version 6 addresses obey the firewalld rules just like IPv4 does. I used nmap and was pleased: the output between the two commands was the same and as expected!

# yum install nmap

# nmap myserver.domain.com

# nmap -6 myserver.domain.com

NOTE: Testing from two different locations failed for me. It seemed that our next gen IP was just not correctly configured at these locations. So try to rule this out when you test and fail.

UPDATE: Somewhat related, when using a static configuration CentOS is know for keep touching your resolv.conf. Check how to void this here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.