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

Cannot connect to database

This error will occur within a web application when any of the following conditions are met:...

I've updated my website, but still see the old version. What's going on?

You must Refresh your browser. Your computer holds a copy of your website in 'cache'. Things to...

Failed to upload image or file to wordpress

Issue:There will be possibilities where you will not be able to upload any images or files to...

Turn On/Off Directory Browsing

For Linux server: Turn on Directory Browsing -create a .htaccess file in the specific directory...

Common SEO Tips and Tricks

Include a title tag on all of your pages. Include a meta description tag on your homepage...