HideIPVPN services

How to Disable IPv6 on Linux

Follow this step-by-step tutorial to learn how to disable IPv6 on Linux from the command line.

  1. Open the Terminal (pin 1).
    linux terminal disable ipv6 
  2. Type:
    sudo su
    and enter your password to act as root.
  3. Type:
    nano /etc/sysctl.conf
    and press “Enter” to open the configuration file. Or, just use your favorite text editor to edit this file.
  4. Add the following lines to the sysctl.conf file:

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

    For nano, press “CTRL+O” then “Enter” to save the modifications and “CTRL+X” to close the file.

  5. In the Terminal type:
    cat /proc/sys/net/ipv6/conf/all/disable_ipv6
    and press “Enter”.

    If the output is “1”, your have IPv6 already disabled and no further actions are required. If the output is “0”, follow the next steps.

  6. Type:
    sysctl -p


    You should get something like this:
  7. Type:
    cat /proc/sys/net/ipv6/conf/all/disable_ipv6
     and press “Enter”.

    Now you should get “1” as a result, which means you have successfully disabled IPv6.
Exit mobile version