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

The Geek Diary

CONCEPTS | BASICS | HOWTO

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

How to enable IPv6 on CentOS / RHEL 6

By admin

IPv6 is by default enabled on CentOS/RHEL 6 systems. But in case, if it was disabled for some reason, you can follow the short howto below to re-enable it. There are basically 2 ways to disable IPv6 on CentOS/RHEL 6.

  1. Disable IPv6 in kernel module (requires reboot)
  2. Disable IPv6 using sysctl settings (no reboot required)

Method 1 : Using /etc/modprobe.d/ipv6.conf (requires reboot)

1. Confirm if ipv6 is used. IPV6 is not used if no lines with inet6 shows up.

# ifconfig |grep inet6
#

2. Modify the configuration file /etc/modprobe.d/*.conf or /etc/modprobe.conf which prevents kernel from loading ipv6 module

# grep ipv6 /etc/modprobe.conf /etc/modprobe.d/*.conf
/etc/modprobe.d/ipv6.conf:1:options ipv6 disable=1        ### we need to remove this line

After removing (or hashing it out) the above line, verify:

# cat /etc/modprobe.d/ipv6.conf
# options ipv6 disable=1

3. Enable ip6tables service if it is needed

# chkconfig ip6tables on

4. Reboot

# shutdown -r now

5. Verify if you can now see the inet6 line in the ifconfig command output.

# ifconfig |grep inet6
          inet6 addr: 2405:200:a60:fd00:250:56ff:fe96:f0e/64 Scope:Global
          inet6 addr: fe80::250:56ff:fe96:f0e/64 Scope:Link
          inet6 addr: ::1/128 Scope:Host

Method 2 : Using /etc/sysctl.conf (online)

1. Append below line to the file /etc/sysctl.conf.

# vi /etc/sysctl.conf
# IPv6 support in the kernel, set to 0 by default
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0

2. To apply the changes for the current sysctl parameters, execute :

# sysctl -p

3. Use, ‘sysctl -a’ to verify the parameter values.

# sysctl -a | grep net.ipv6.conf
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
How to enable IPv6 on CentOS / RHEL 7
CentOS / RHEL 6 : How to disable IPv6
CentOS / RHEL 7 : How to disable IPv6

Filed Under: CentOS/RHEL 6, Linux

Some more articles you might also be interested in …

  1. /etc/rsyslog.conf – Setup a Filter to Discard or Redirect Messages
  2. How to Install NTP Service and Client in CentOS/RHEL 8
  3. How to extend ASM disk from OS level in CentOS/RHEL
  4. How to Switch Back To Previous Version of openjdk in CentOS/RHEL
  5. How to monitor /etc/shadow and /etc/passwd file for changes with Auditd?
  6. How to Remove/ Disable Bash shell Command History on Linux
  7. How to Recover from a Corrupted or empty /etc/mtab file in CentOS/RHEL 7
  8. How to Enable/Disable CPUs (Limiting CPU count) in CentOS / RHEL
  9. Swapon Fails To Mount Swap – Gives Invalid Argument Error
  10. CentOS / RHEL 6 : how to start the services interactively during boot (to disable/abort some services)

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary