First, find the network interface used by the server with ip a command.
[root@15-204-47-122 ~]# ip a 1: lo:mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno1: mtu 1500 qdisc mq state UP group default qlen 1000 link/ether a8:a1:59:c0:de:80 brd ff:ff:ff:ff:ff:ff altname enp3s0f0 inet 15.204.47.122/24 brd 15.204.47.255 scope global eno1 valid_lft forever preferred_lft forever inet6 fe80::aaa1:59ff:fec0:de80/64 scope link valid_lft forever preferred_lft forever 3: enp3s0f1: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether a8:a1:59:c0:de:81 brd ff:ff:ff:ff:ff:ff 4: enp0s20f0u8u3c2: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 5a:58:d0:03:8e:b3 brd ff:ff:ff:ff:ff:ff [root@15-204-47-122 ~]#
The interface eno1 has the public IPv4 address of the server associated, so it is the public interface used by the server.
Find the IPv6 IP address and gateway, This you can find in the OVH Manager server details page.
Edit ifcfg file for the network interface
vi /etc/sysconfig/network-scripts/ifcfg-eno1
At the end of the configuration, add
IPV6INIT=yes IPV6_AUTOCONF=no IPV6_FAILURE_FATAL=no IPV6ADDR=2604:2dc0:200:1f7a::/64
2604:2dc0:200:1f7a::/64 – is the IPv6 IP address found in OVH Manager.
Here is the full configuration
BOOTPROTO=static DEVICE=eno1 HWADDR=a8:a1:59:c0:de:80 IPADDR=15.204.47.122 NETMASK=255.255.255.0 GATEWAY=15.204.47.254 ONBOOT=yes TYPE=Ethernet USERCTL=no IPV6INIT=yes IPV6_AUTOCONF=no IPV6_FAILURE_FATAL=no IPV6ADDR=2604:2dc0:200:1f7a::/64
Create route file
vi /etc/sysconfig/network-scripts/route6-eno1
Add
2604:2dc0:0200:1fff:00ff:00ff:00ff:00ff dev eno1 default via 2604:2dc0:0200:1fff:00ff:00ff:00ff:00ff
Here ‘2604:2dc0:0200:1fff:00ff:00ff:00ff:00ff” is gateway address you get from OVH Manager server network page. eno1 is your public network interface name.
After reboot, the IPv6 network will work on the server.
Back to IP