How to disable IPv6 on Centos

There are times where you might need to disable IPv6 on your Centos Server. Below are the options that you can use:

Add kernel variable into /etc/sysctl.conf.

You can do this by editing /etc/sysctl.conf using your favourite editor.

for us, we use "nano /etc/sysctl.conf" and add below kernel variable:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

Once done, you can run "sysctl -p" to force the changes.

OR

you do it by opening your command prompt and run below command.

echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6

OR

you do it by opening your command prompt and run below command.

sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1

All of the above will help you to disable the IPv6 features.

Was this answer helpful?

Also Read

How to install WordPress by using Plesk

Step 1 Login to the Plesk Panel. Then, from the hosting servers menu that located in the left,...

Page says function not found, but the page exists

If your web application uses a function found in a particular file, but the application says that...

Failed to create new post or pages to wordpress

Issue:There will be a time where you will not be able to create a new post or pages to your...

How to redirect page from html file

Place the following HTML redirect code between the <HEAD> and </HEAD> tags of your...

My website is running slow

If you are using a forum or content management system, make sure that caching is enabled. Caching...