How to turn off IPv4 without disabling IPv6
Good morning kernel hackers,
we are a small company in Switzerland running some IPv6 only networks. The systems in the IPv6 only networks do not need any IPv4 support anymore and thus for switches/routers we turned the support off.
Today we tried to turn off IPv4 in the Linux kernel at compile time. But it seems that as soon as we turn off CONFIG_INET, CONFIG_IPV6 is automatically turned off as well.
While you can argue that "turning off IPv4 is not necessary", this is not our point. As IPv4 resources have depleted almost everywhere in the world a move to IPv6 is inevitable, especially if you are a small organisation offering Internet services.
Being a (new) small organisation you are already disadvantaged in terms of IPv4 resources that you can afford, so our objective is to make the life in the IPv6 world as easy as possible.
If we can build operating systems that don't run IPv4 anymore, operators have at least a certain degree of complexity less and can start fresh into adventures, without having to care about iptables, about IPv4 routing, etc.
Coming back to my original question: is there a way or how would we turn off IPv4 support in the Linux kernel? So far the only operating system that is reported to be able to run without IPv4 is FreeBSD [0], but I hope we can add more in the near future.
Best,
Nico
[0] https://ungleich.ch/en-us/cms/blog/2019/01/09/die-ipv4-die/
--
Your Swiss, Open Source and IPv6 Virtual Machine. Now on www.datacenterlight.ch.
Quoted 7 lines · Nico Schottelius
running some IPv6 only
networks. The systems in the IPv6 only networks do not need any IPv4 support anymore and thus for switches/routers we turned the support off.Today we tried to turn off IPv4 in the Linux kernel at compile time. But it seems that as soon as we turn off
CONFIG_INET,CONFIG_IPV6is automatically turned off as well.
Even if you don't want global nor even link-scope IPv4, way too many programs assume that at least 127.0.0.1 (ie, lo) is working. They can't be reconfigured to use ::1 without patching and rebuilding.
Quoted 2 lines
Coming back to my original question: is there a way or how would we turn off IPv4 support in the Linux kernel?
I believe this is not worth your time for today.
Just do what IPv6-haters do on stock modern distros: have no routes for the other IP version configured; non-buggy programs will do the right thing.
This seems to work well. Heck, I had a busy dev server with broken IPv4, I didn't notice that for 1.5 years until I tried to pull something directly from Github (which is still v4 only).
You're a network admin so you know far more than me wrt anything that goes over the wire -- but as as a distro developer/user, I'd say there's a considerable cost to have every of tens of thousands programs shipped by a distro, and many more that are private to a company/university/etc, updated to autodetect how to access "localhost" on a particular box.
That's an extra moving part where there was none before. Complexity is bad. Having the IPv4 stack built just for the lo interface simplifies things.
Meow!
Signature · 4 lines
⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Did ya know that typing "test -j8" instead of "ctest -j8" ⢿⡄⠘⠷⠚⠋⠀ will make your testsuite pass much faster, and fix bugs? ⠈⠳⣄⠀⠀⠀⠀
Hey Adam,
thanks for the fast response.
Quoted 5 lines · Adam Borowski
Quoted 3 lines · Nico Schottelius
running some IPv6 only
networks. The systems in the IPv6 only networks do not need any IPv4 support anymore and thus for switches/routers we turned the support off.
Quoted 7 lines
Quoted 3 lines
Today we tried to turn off IPv4 in the Linux kernel at compile time. But it seems that as soon as we turn off
CONFIG_INET,CONFIG_IPV6is automatically turned off as well.Even if you don't want global nor even link-scope IPv4, way too many programs assume that at least 127.0.0.1 (ie, lo) is working. They can't be reconfigured to use ::1 without patching and rebuilding.
I think we have to distinguish here between 2 kinds of programs:
- stuff that listen()s
- stuff that connect()s
Afaics, the latter does not need any lo connectivity, neither v4 nor v6. It will use whatever IP address the kernel chooses for outgoing connections.
For the former, I agree that there might be software that actually fails without having 127.0.0.1. However, if they bind to 0.0.0.0, the software will actually not work in IPv6 only network anyway.
The big problem here is:
if I cannot turn off IPv4, I cannot test what needs to be fixed.
Quoted 4 lines
[...]
That's an extra moving part where there was none before. Complexity is bad. Having the IPv4 stack built just for the lo interface simplifies things.
I tend to disagree with this statement: turning off IPv4 first off all reduces complexity. You can even fully get rid of ARP. Yes, there will be the need for some changes / updates, but all of this can only be spotted once IPv4 is turned off.
Best,
Nico
--
Your Swiss, Open Source and IPv6 Virtual Machine. Now on www.datacenterlight.ch.