• 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

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. Linux OS Service ‘squid’
  2. dphys-swapfile Command Examples in Linux
  3. Xen Hypervisor (xm) command Cheat Sheet
  4. pmap: command not found
  5. How to use ‘yum’ to connect ULN on CentOS/RHEL/OEL 6
  6. lrzip Command Examples in Linux
  7. check-language-support: command not found
  8. daemonize Command Examples in Linux
  9. How to Verify if a Disk/Partition is in Use by Oracle ASM, was used by Oracle ASM or is never used by Oracle ASM
  10. dnsmap Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright