• 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. How to disable ICMP redirects on CentOS/RHEL
  2. apt-get Command Examples in Linux
  3. TIME_WAIT queue troubles
  4. “Read-only locking type set. Write locks are prohibited. Can’t get lock for [volume group]” – error during lvextend
  5. CentOS / RHEL 6 : How to extract initramfs image and edit/view it
  6. MySQL Server Error – “Can’t Create A New Thread (errno 11)”
  7. How To Create An Almost Root Equivalent Users But Not Root Identical User in Linux
  8. getopt Command Examples in Linux
  9. wifi-menu: command not found
  10. ldd Command Options in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright