• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 7 : How to disable IPv6 on a specific interface only

by admin

We have already seen how to disable ipv6 globally on CentOS / RHEL 7. There could be an ask to disable ipv6 just for a particular interface on the system and not for all the available interfaces or system wide. The posts describe steps to disable ipv6 on a particular interface in CentOS / RHEL 7.

Note : Adding IPV6INIT=no in the specific interface configuration files is not helpful and it does not disable ipv6 on that interface.

Disabling ipv6 on a particular interface only

1. Below ipv6 parameter can be used on per interface basis to enable or disable ipv6.

net.ipv6.conf.[interface].disable_ipv6 = [value]

Here,
interface – name of the inerface where ipv6 needs to be disabled. For example eth1
value – 0 (enable) or 1 (disable) ipv6 on the interface.

2. So to disable ipv6 just on eth1 interface, you can add below parameter in /etc/sysctl.conf file to make permanent changes.

# vi /etc/sysctl.conf
net.ipv6.conf.eth0.disable_ipv6 = 1

3. Run below command to apply the changes immediately;

# sysctl -p

Conclusion

It is not helpful to add IPV6INIT=no parameter to interfaces that need to disable IPv6. Link local ipv6 can still be seen on that interface. Changing the sysctl parameter for the specific interface can disable the ipv6 on that particular interface only and not globally on the system.

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. dig Command Examples in Linux
  2. How to configure iSCSI target using targetcli in CentOS / RHEL 7
  3. How to configure NTP server and client in CentOS / RHEL 7
  4. How to use shell aliases in Linux
  5. Linux Interview Questions : Open Files / Open File Descriptors
  6. nohup Command Options in Linux
  7. How to prevent non-root user from creating crontab entry
  8. How to Create a MySQL Docker Container for Testing
  9. CentOS/RHEL7 – Tuned Profiles Oracle
  10. How To Create An Almost Root Equivalent Users But Not Root Identical User in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright