You are here: Home / Disable IPv6 on Ubuntu

Disable IPv6 on Ubuntu

Quick Notes

edit the /etc/sysctl.conf file

 

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

and/or run:

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

 

Verify:

ip a

 

sudo sysctl -p

 

 

/etc/rc.local

For Ubuntu 22.04 and older versions

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

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

exit 0

 

For Ubuntu 24.04 and newer versions

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

/sbin/sysctl -p/etc/sysctl.conf
/etc/init.d/procps restart

exit 0

 

sudo chmod 755 /etc/rc.local

 

If those do not work, then edit grub:

 

/etc/default/grub.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"

 

sudo update-grub

 

 

 

Filed under:
Navigation