Configure IPv6 on your CentOS server
Configure IPv6 on your CentOS server
IPv6 was developed to counter the long-anticipated problem of IPv4 exhaustion. IPv6 is not only intended to replace IPv4 but also boasts of certain characteristics which are superior to IPv4 address like more efficient routing, directed data flows, simplified network configuration, security and much more.
Edit network file
# vim /etc/sysconfig/network
Add the following line at the end of the file.
NETWORKING_IPV6=yes
save & exit
If your interface is eth0, Then I would recommend you to create a new alias , so it will not cause any downtime.
So I have created a alias as eth0:3
vim /etc/sysconfig/network-scripts/ifcfg-eth0:3
Before proceeding this, You have better to edit the network config via your console or IPMI. So if anything goes wrong you can immediately revert the changes.
Sample configuration
BOOTPROTO="static" DEVICE="eth0:3" ONBOOT="yes" IPV6INIT=yes IPV6ADDR="2a01:7c8:aac8:229::1/48" IPV6_AUTOCONF=yes IPV6_DEFAULTGW="2a01:7c8:aac8::1" IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no
You have to replace with following
DEVICE="Your Device" IPV6ADDR="Your ipv6" IPV6_DEFAULTGW="Your G/W"
ifup eth0:3
Then check your interface,
[[email protected] ~]# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 136.144.185.213 netmask 255.255.255.0 broadcast 136.144.185.255 inet6 fe80::5054:ff:fe94:9462 prefixlen 64 scopeid 0x20<link> inet6 2a01:7c8:aac8:229:5054:ff:fe94:9462 prefixlen 64 scopeid 0x0<global> ether 52:54:00:94:94:62 txqueuelen 1000 (Ethernet) RX packets 25418355 bytes 2415236744 (2.2 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4738017 bytes 2310932947 (2.1 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 724 bytes 71870 (70.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 724 bytes 71870 (70.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Finally restart the network
# service network restart