Today we’ll learn how to disable IPv6 on Fedora 21. The steps will work on Fedora 19 – 22. Currently our network configuration these days does not require IPv6 support.
Internet Protocol version 6 (IPv6) is the latest version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. IPv6 was developed by the Internet Engineering Task Force (IETF) to deal with the long-anticipated problem of IPv4 address exhaustion.
So let’s get started.
Edit /etc/sysconfig/network and tell it no IPV6.
$ sudo vi /etc/sysconfig/network
Append to the file and save the changes.
Next edit /etc/hosts and comment out or remove ::1 entry.
::1 localhost6.localdomain6 localhost6
Now we need to edit /etc/sysconfig/network-scripts/ifcfg-enp0s3 or whatever your nic is named and remove the following.
Change the two lines from yes to no
Create a /etc/modprobe.d/ipv6.conf file and add the following to prevent ipv6 module in the kernel from loading.
install ipv6 /bin/true
Now all the changes are in place, reboot the system. Once the system has come back up let’s check to see if the ipv6 module is loaded. open a terminal and type.
$ sudo lsmod | grep -i ipv6
It should come back empty.
You may get problems after disabling IPv6.
If you get issues with SSH after disabling IPv6, do the following.
Edit /etc/ssh/sshd_config file,
$ sudo vi /etc/ssh/sshd_config
Change the line #AddressFamily any and to AddressFamily inet
Then remove the hash mark (#) in front of the line:
Then, restart ssh to reflect the changes.
$ sudo systemctl restart sshd