Site icon David Yin's Blog

How to Disable IPv6 permanently on Ubuntu 22.04

I followed the instruction on my old post to disable IPv6 on my Ubuntu 22.04 box. But it is not enough to make it permanently. Every time I reboot the machine, the IPv6 comes again.

 

Here is the solution to make it right.

 

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

Then, change the permission of this file to make it executable.

sudo chmod 755 /etc/rc.local

Reboot the machine.

Done.

Exit mobile version