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

My images are broken, or don't show up!

Firstly, check to see whether they are uploaded to our server and are in the correct...

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 user from http to https?

Scenario: You want to force all users/client to access your website using https instead of http....

How to redirect user from none www to www.domain?

Scenario: You want to force all users/client to access your website using https instead of http....

Turn On/Off Directory Browsing

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