Disable IPv6 on Centos 6, 5

Check whether ur system is enabled with IPv6 (::1:500,:::22) or just for IPv4 (0.0.0.0:22)
====================================

netstat -atnu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 192.168.122.1:53            0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:34843               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:5672                0.0.0.0:*                   LISTEN
tcp        0    128 116.90.239.114:22           116.90.239.126:52548        ESTABLISHED
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0      0 :::5989                     :::*                        LISTEN
udp        0      0 0.0.0.0:783                 0.0.0.0:*
udp        0      0 127.0.0.1:4500              0.0.0.0:*
udp        0      0 116.90.239.114:4500         0.0.0.0:*
udp        0      0 0.0.0.0:42018               0.0.0.0:*
udp        0      0 0.0.0.0:930                 0.0.0.0:*
udp        0      0 192.168.122.1:53            0.0.0.0:*
udp        0      0 0.0.0.0:67                  0.0.0.0:*
udp        0      0 0.0.0.0:34384               0.0.0.0:*
udp        0      0 0.0.0.0:848                 0.0.0.0:*
udp        0      0 0.0.0.0:5353                0.0.0.0:*
udp        0      0 0.0.0.0:111                 0.0.0.0:*
udp        0      0 127.0.0.1:500               0.0.0.0:*
udp        0      0 116.90.239.114:500          0.0.0.0:*
udp        0      0 0.0.0.0:631                 0.0.0.0:*
udp        0      0 ::1:500                     :::*
====================================
# ping6 ::1    ———–> Ping your loopback ipv6 IP.


Since the /etc/modprobe.conf has been deprecated on lates RHEL6 OS. so u need to configure at /etc/modprobe.d folder
U may find different ways on google to disable ipv6 in redhat enterprise linux 6 but that may hardly work for your rhel6. So here is the best way to disable and sharpshoot.
—————————
Add a new file /etc/modprobe.d/disable_ipv6.conf containing (it doesn’t exist on ur system)
options ipv6 disable = 1
—————————-
OR, Similarly, another method that u can fire the ass to disable IPv6 on ur system:
—————————-
Add a new file /etc/modprobe.d/modprobe.conf.dist containing ( this file doesn’t exits by default)
install ipv6 /bin/true
—————————
Edit /etc/sysconfig/network and add a line saying
NETWORKING_IPV6=off
—————————
Then do

service ip6tables stop
chkconfig ip6tables off

then reboot.
—————————
Now check whether ur Ports are listening on IPv6 IPz or not

netstat -antu

—————————

netstat -atnu

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp        0      0 192.168.122.1:53            0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:34843               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:5672                0.0.0.0:*                   LISTEN
tcp        0    128 116.90.239.114:22           116.90.239.126:52548        ESTABLISHED
udp        0      0 0.0.0.0:783                 0.0.0.0:*
udp        0      0 127.0.0.1:4500              0.0.0.0:*
udp        0      0 116.90.239.114:4500         0.0.0.0:*
udp        0      0 0.0.0.0:42018               0.0.0.0:*
udp        0      0 0.0.0.0:930                 0.0.0.0:*
udp        0      0 192.168.122.1:53            0.0.0.0:*
udp        0      0 0.0.0.0:67                  0.0.0.0:*
udp        0      0 0.0.0.0:34384               0.0.0.0:*
udp        0      0 0.0.0.0:848                 0.0.0.0:*
udp        0      0 0.0.0.0:5353                0.0.0.0:*
udp        0      0 0.0.0.0:111                 0.0.0.0:*
udp        0      0 127.0.0.1:500               0.0.0.0:*
udp        0      0 116.90.239.114:500          0.0.0.0:*
udp        0      0 0.0.0.0:631                 0.0.0.0:*
====================================
# ping6 ::1    ———–> Ping your loopback ipv6 IP.
socket : Address family not supported by protocol

HOWTO Disable IPv6 in Redhat, previous ver. (rhel 4, rhel5)

If, for some reason, you want to disable IPv6 on a Red Hat environment,
here’s how to do it.
Edit /etc/sysconfig/network
Change the following:
NETWORKING_IPV6=yes to
NETWORKING_IPV6=no

Edit /etc/modprobe.conf
Add the following if it does not exist:
alias net-pf-10 off
alias ipv6 off

Stop the ipv6tables service

service ip6tables stop

Disable the ipv6tables service

chkconfig ip6tables off

After these changes, IPv6 will be disabled after the next reboot of your
system.

Now check whether ur Ports are listening on IPv6 IPz or not

netstat -antu

Comments are closed.