How to disable IPv6 in Ubuntu

How to disable IPv6 in Ubuntu

Step 1: Open /etc/sysctl.conf
sudo nano /etc/sysctl.conf
Step 2: Add following lines:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Step 3: Check whether IPv6 was disabled
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
If result is 1, it’s OK, else go to step 4.
Step 4: Activate sysctl.conf
sudo sysctl -p
Do step 3 again.

Hope this helpful to you!

%d bloggers like this: