Difference between revisions of "Disable ipv6"

From Wasya Wiki
Jump to: navigation, search
 
Line 1: Line 1:
 
From: https://itsfoss.com/disable-ipv6-ubuntu-linux/
 
From: https://itsfoss.com/disable-ipv6-ubuntu-linux/
  
<pre>
 
 
You have see the sysctl command in the tutorial about restarting network in Ubuntu. We are going to use it here as well. To disable IPv6 you only have to input 3 commands:
 
You have see the sysctl command in the tutorial about restarting network in Ubuntu. We are going to use it here as well. To disable IPv6 you only have to input 3 commands:
 +
 +
<pre>
  
 
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
 
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
 
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
 
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
 
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
 
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
 +
</pre>
 +
 
You can check if it worked using:
 
You can check if it worked using:
  
ip a
+
  ip a
You should see no IPv6 entry:
+
 
</pre>
+
You should see no IPv6 entry.
  
 
One method to make this option persist is modifying /etc/sysctl.conf
 
One method to make this option persist is modifying /etc/sysctl.conf
Line 20: Line 23:
 
net.ipv6.conf.lo.disable_ipv6=1
 
net.ipv6.conf.lo.disable_ipv6=1
 
</pre>
 
</pre>
 +
 +
For the settings to take effect use:
 +
 +
  sudo sysctl -p
 +
 +
== Trash ==
 +
If IPv6 is still enabled after rebooting, you must create (with root privileges) the file /etc/rc.local and fill it with:
 +
 +
<pre>
 +
#!/bin/bash
 +
# /etc/rc.local
 +
 +
/etc/sysctl.d
 +
/etc/init.d/procps restart
 +
 +
exit 0
 +
</pre>
 +
  sudo chmod 755 /etc/rc.local

Latest revision as of 19:29, 12 June 2024

From: https://itsfoss.com/disable-ipv6-ubuntu-linux/

You have see the sysctl command in the tutorial about restarting network in Ubuntu. We are going to use it here as well. To disable IPv6 you only have to input 3 commands:


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

You can check if it worked using:

 ip a

You should see no IPv6 entry.

One method to make this option persist is modifying /etc/sysctl.conf

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

For the settings to take effect use:

 sudo sysctl -p

Trash

If IPv6 is still enabled after rebooting, you must create (with root privileges) the file /etc/rc.local and fill it with:

#!/bin/bash
# /etc/rc.local

/etc/sysctl.d
/etc/init.d/procps restart

exit 0
 sudo chmod 755 /etc/rc.local