Disable IPv6 on Linux server.

Published: 2022-01-06

IPv6 is now becoming increasingly popular, but there are still many websites that do not support it. Sometimes when IPv6 is enabled on the server, requests are made through the IPv6 egress by default, which may cause problems such as slow access and API interface IP restrictions. Therefore, sometimes it is instead necessary to disable IPv6. Log in to the server via SSH, copy the following command, and press Enter to execute it to disable IPv6.

wget -O disable_ipv6.sh http://downinfo.myhostadmin.net/vps/disable_ipv6.sh && bash disable_ipv6.sh && rm -rf disable_ipv6.sh

image.png

Supports centos6, centos7, centos8, Debian8, Debian9, ubuntu16, ubuntu18, ubuntu20.

dibian8 manual disable

1. vi /etc/network/interfaces   

2. Comment out the IPv6 section by adding #

image.png


3.service networking restart #restart network