Skip to content

Disable ipv6 on Ubuntu 20.04

homepage-banner

How to disable ipv6 on Ubuntu 20.04?

tune

add the following lines into /etc/sysctl.conf

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

check

cat /proc/sys/net/ipv6/conf/all/disable_ipv6

1

you may also find the inet6 in ifconfig is disappeared.

Back to Table of Contents

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.com, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No personal information is collected.
Feedback