IPv6 gives a much wider addressing scheme than IPv4, which is among the many causes it was developed. However, I’ve encountered uncommon instances the place IPv6 prompted community issues.
Since some {hardware} doesn’t make the most of IPv6 (and a few directors may go with IPv4), a easy and momentary answer is to disable IPv6. The protocol may be reactivated as soon as the issue is completely resolved.
If you’ve got {hardware} that implements IPv6 completely and software program that makes use of it appropriately, this isn’t an issue. But if you’re having community issues with Linux servers or desktops and have exhausted all potential areas, you might need to attempt disabling v6 of the networking protocol.
I’ve had a number of instances the place communication between a Linux desktop and an older router always dropped and disabling IPv6 was the one answer that labored. After some time, I re-enabled IPv6 to see if a router firmware replace (and a desktop OS replace) had mounted the issue. In some instances, it mounted the issue and IPv6 might stay enabled, though in different instances IPv6 must be disabled once more.
I’ll present you learn how to disable IPv6 on a Linux machine. (Note: I like to recommend disabling IPv6 solely when you’ve got exhausted all different choices. Also, it is best to think about it a brief answer.)
SEE: Top instructions Linux directors have to know (TechRepublic Premium)
Command line
You guessed it: we can be working with the command line. I’ll present you learn how to disable IPv6 on Red Hat and Debian primarily based distributions.
Here’s learn how to disable the protocol on a Red Hat-based system:
- Open a terminal window.
- Switch to root consumer.
- Issue the command sysctl -w internet.ipv6.conf.all.disable_ipv6=1
- Issue the command sysctl -w internet.ipv6.conf.default.disable_ipv6=1
To re-enable IPv6, enter the next instructions:
sysctl -w internet.ipv6.conf.all.disable_ipv6=0
sysctl -w internet.ipv6.conf.default.disable_ipv6=0
Here’s learn how to disable the protocol on a Debian-based machine.
- Open a terminal window.
- Issue the command sudo nano /and many others/sysctl.conf
- Add the next to the underside of the file:
internet.ipv6.conf.all.disable_ipv6 = 1
internet.ipv6.conf.default.disable_ipv6 = 1
internet.ipv6.conf.lo.disable_ipv6 = 1
- Save and shut the file.
- Restart the machine.
To re-enable IPv6, take away the earlier traces from /and many others/sysctl.conf and restart the machine.
SEE: How to view SSH keys in Linux, macOS, and Windows (TechRepublic)
The warnings
If you occur to make use of X Forwarding over ssh, disabling IPv6 can break this method. To repair this, you must open the file /and many others/ssh/sshd_config file and edit the file #FamilyAddress any a Family Address inet. Save that file and restart sshd.
If you employ Postfix, you might expertise issues beginning the service. To resolve this downside, you will want to make use of an IPv4 loopback. Open the /and many others/postfix/major.cf file, remark out the localhost line and add the IPv4 loopback like this:
#inet_interfaces = localhost
inet_interfaces = 127.0.0.1
SEE: How to set momentary surroundings variables in Linux (TechRepublic)
An imperfect answer
This is not an ideal answer, however generally you must be inventive in downside fixing. If you are experiencing unusual community errors with Linux servers and desktops, attempt disabling IPv6 to assist troubleshoot or present a brief repair.
This article was initially printed in June 2016. It was up to date by Antony Peyton in January 2025.