Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've done lots of research on how to disable IPv6 on RedHat Linux and I have it almost completely disabled. However the loopback interface is still getting an inet6 loopback address (::1/128). I can't find where IPV6 is still enabled for loopback.

To disable IPV6 I added the following settings to /etc/sysctl.conf:

net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.all.disable_ipv6=1

And also added the following line to /etc/sysconfig/network:

NETWORKING_IPV6=no

After rebooting, the inet6 address is gone from my physical interface (eth0), but is still there for lo:

# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:50:56:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 10.x.x.x/21 brd 10.x.x.x scope global eth0

If I manually remove the IPV6 address from loopback and then bounce the interface, it comes back:

# ip addr del ::1/128 dev lo
# ip addr show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
# ip link set lo down
# ip link set lo up
# ip addr show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever

I believe IPV6 should be disabled at the kernel level as confirmed by sysctl:

# sysctl net.ipv6.conf.lo.disable_ipv6
net.ipv6.conf.lo.disable_ipv6 = 1

Any ideas on what else would cause the loopback interface to get an IPV6 address?

share|improve this question

migrated from stackoverflow.com Nov 26 '12 at 21:24

This question came from our site for professional and enthusiast programmers.

    
It's highly unlikely that you really want to disable IPv6. It's almost certainly going to cause you a lot of problems. What are you really trying to do? –  Michael Hampton Nov 26 '12 at 21:26
    
What problems exactly are you talking about Michael? –  FINESEC Nov 26 '12 at 23:00
    
I want to diable IPv6 because I'm installing middleware that actually doesn't operate properly when IPv6 interfaces are present (it can bind to the IPv6 interface instead of the IPv4 one). It's a known issue with the software. Besides that issue it's generally good practice on Linux to disable protocols or services that are not needed to reduce exposure to security risks and/or improve performance. –  Marc D Nov 27 '12 at 13:52

2 Answers 2

1) Disable ipv6 kernel module by creating file /etc/modprobe.d/ECS.conf containing:

alias net-pf-10 off
alias ipv6 off

2) Edit /etc/sysconfig/network and set:

NETWORKING_IPV6=off

3) Disable iptables for IPV6:

chkconfig ip6tables off

4) Reboot (I don't recommend removing the ipv6 kernel module manually)

share|improve this answer
    
ipv6 module is being loaded by the cnic driver which is in turn loaded by the Broadcom Ethernet driver. Last time I tried messing with these modules I hosed the network controller and couldn't connect to the box. So I'm looking for any other way. Thanks for the reminder on ip6tables, I have no rules defined there. –  Marc D Nov 27 '12 at 14:01

I usually just use the modprobe/modload framework to disable loading the ipv6 kernel module (/etc/modules, /etc/modprobe.d on Debian - Red Hat may have chosen different directories), or just don't build IPv6 support if building a custom kernel.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.