How to disable IPV6

Just like other linux OS’s you can add these lines to /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
sudo sysctl -p

And that does nothing to disable IPV6, because you have to disable IPV6 at kernel boot time.

Here is what works, in ipfire, to turn off IPV6 with kernel load option.

edit /etc/default/grub

Add this line:
GRUB_CMDLINE_LINUX_DEFAULT=“ipv6.disable=1”
change this line:
GRUB_CMDLINE_LINUX=“rd.auto panic=10 console=tty1”
to this:
GRUB_CMDLINE_LINUX=“rd.auto panic=10 console=tty1 ipv6.disable=1”

once the file is saved, apply changes to boot loader with command:
grub-mkconfig -o /boot/grub/grub.cfg

Then reboot, log back in and test to see if it worked..

ls -al /proc/sys/net/ipv6/
ls: cannot access ‘/proc/sys/net/ipv6/’: No such file or directory

ls -al /proc/net/if_inet6/
ls: cannot access ‘/proc/net/if_inet6/’: No such file or directory

It worked.

1 Like

Thanks.
I was a bit hesitant as to disable ipv6 on the router, my IPFire, saw no obvious way to do it in WUI, but this gives a way to do it.

What’s the point since IPFire 2 doesn’t support IPv6?

3 Likes

and there it is www.ipfire.org - Reducing Attack Surface

ok…

but what is encapsulation as referred to here: www.ipfire.org - Protocols

and if you install netsnmpd you can use ipv6 ? www.ipfire.org - Net-SNMP

Admittedly you always need to look at the connected devices to see if they use IPV6 or not, many modern devices do by default - but has ipv4 as well, and if IPFire does not use it the only address range that will be practically usable is of course IPV4.

2 Likes

Encapsulation is, generally speaking, putting one thing inside another. So, when talking about IPv6 and IPv6, you can embed an IPv6 packet inside IPv4. The other end will receive the IPv4 packet, remove the encapsulation and see the IPv6 packet.
Similar stuff goes on in IPsec where IPv4 packets are embedded in ESP packets, and, going further, if you’re using NAT, the ESP is then embedded in a UDP packet.

2 Likes

ipv6 is disabled by default in IPFire.

The default sysctl.conf contains the lines that disable ipv6.

https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=config/etc/sysctl.conf;hb=093843686eeb69f41112bdf380e49461676794cc#l30

You don’t need to as they are already added to that file.

Incorrect.
The IPFire initscript for sysctl checks if sysctl.conf is present, and applies all the defined settings, so it will also be applied at reboot.

3 Likes