search
top

How To Disable IPv6 In Fedora 21

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.
NETWORKING_IPV6=no

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.
IPV6_DEFROUTE=”yes”
IPV6_FAILURE_FATAL=”no”
IPV6_PEERDNS=”yes”
IPV6_PEERROUTES=”yes”

Change the two lines from yes to no
IPV6INIT=”no”
IPV6_AUTOCONF=”no”

Remove module
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.

ipv601

You may get problems after disabling IPv6.

Issue SSH:

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:
#ListenAddress 0.0.0.0

Then, restart ssh to reflect the changes.

$ sudo systemctl restart sshd

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.

top