• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Disable IPv6 on Linux

Written by Rahul, Updated on January 4, 2016

IPv6 is the next-generation internet protocol, designed to replace the current Internet Protocol, IP Version 4. IP addresses are required for communication between two devices. It is an identity of a computer over Internet.

This article will help you to disable IPv6 from your Linux box.

1. Check IPv6 Address

Use ifconfig command to view current IPv6 address on your system. You will get results something like below.

[[email protected] ~]# ifconfig 

eth0: flags=4163  mtu 1500
        inet 45.55.65.94  netmask 255.255.224.0  broadcast 45.55.95.255
        inet6 fe80::601:92ff:fe35:ea01  prefixlen 64  scopeid 0x20<link>
        ether 04:01:92:35:ea:01  txqueuelen 1000  (Ethernet)
        RX packets 2411381  bytes 794420295 (757.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2151232  bytes 351005391 (334.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163  mtu 1500
        inet6 fe80::601:92ff:fe35:ea02  prefixlen 64  scopeid 0x20<link>
        ether 04:01:92:35:ea:02  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 648 (648.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 123828  bytes 21997128 (20.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 47584  bytes 4822673 (4.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 47584  bytes 4822673 (4.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

2. Disable IPv6 Temporarily

If to disable IPv6 for your current session, Simply use following command to set run time variable. Remember that below change will be discards after system reboot.

$ sudo echo "1" > /proc/sys/net/ipv6/conf/all/disable_ipv6

3. Disable IPv6 Permanent

To disable IPv6 permanently, edit /etc/sysctl.conf file and add/update following parameters

$ vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

and reload sysctl configuration using following command

$ sudo sysctl -p

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

1 Comment

  1. Avatar AJ Reply
    August 8, 2017 at 9:49 pm

    Hi,

    I am running fedora 26 vm, I am expecting my machine to have an ipv6 address but I don’t see that in `ip -6 addr`. What changes do I need to make to enable/accept ipv6 via dhcp client

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • (Solved) apt-add-repository command not found – Ubuntu & Debian 0
  • How to Install .NET Core on Debian 10 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy