Live data from Hacker News

Enabling IPv6 support for IPv4-only apps on Linux

blog.apnic.net

51–60 of 199 posts

Re: Enabling IPv6 support for IPv4-only apps on Linux

#51
I made a Terrible decision of a project at Netflix. The idea was that you could swap out an IPv4 (AF_INET/SOCK_STREAM) socket with an AF_INET6 one.

Turns out actually doing this with the Linux kernel is exceptionally difficult. You can swap out the underlying sk, but doing it safely is damn near impossible because the two data structures aren’t really built like that.

One day, I’d love if someone added the ability to swap Unix sockets for TCP sockets at runtime to the kernel — for other reasons.

Re: Enabling IPv6 support for IPv4-only apps on Linux

#52
post #38

Does anyone have a good write up of taking ones home network and going 100% ipv6 including dealing with iot devices that can't? I am thinking of doing it but I have a huge mix of devices from linux to windows and servers.

There's absolutely _no_ good reason to do that if you're only facing the internet with a single IP on your router as a NAT gateway, except to make your life hell. Only thing that may be worth doing is parting ways with the one internet-facing IPv4 and relying solely on IPv6 there, but that's mostly up to your ISP and their own infrastructure. Even if you were to 100% NAT your IPv4 LAN to IPv6 WAN, and your ISP still…

Why wouldn't you be able to disable IPv4 in the router ?

Also, isn't trying to run both IPv4 and IPv6 inherently a security issue coming from the complexity of dealing with two overlapping networks with very different logic ?

Re: Enabling IPv6 support for IPv4-only apps on Linux

#53
Would be interesting to know which applications actually have problems with v6 - the example with directly using a v4 IP is more a user error, not an application issue.

I pretty much stopped submitting patches enabling v6 functionality to various projects back in 2005 as everything I cared about was working at that point. (Side note, I was just trying to search a few of those - but seems that period pretty much doesn't exist in search engine caches anymore. I knew the state of preserving internet history is bad, but I didn't expect it to be _that_ bad)

Re: Enabling IPv6 support for IPv4-only apps on Linux

#54

The main advantage of Linux over other systems is that its available from source and thus can be patched and recompiled easily. Here we see someone using LD_PRELOAD to patch the behavior of a binary, because they rely on distributions pre-compiled packages without means to change the source code themselves. This sort of negates that advantage, right?

This method could apply to other tools with the same IPv4/IPv6 behaviour, without further modification. Changing the behaviour in the utility directly would only fix it for that one utility meaning that to fix another you need to do the same work again. It is perhaps also safer than modifying such a core component as SSH: if you introduce a bug the trick can be easily disabled until fixed, if you accidentally break SSH you might cause yourself significantly more hassle.

> This sort of negates that advantage

LD_PRELOAD trickery doesn't negate the advantage of having full source access, patching SSH would also have been a perfectly valid option, but is perhaps a better tool for this particular job.

For another use of the trick see https://github.com/mariusae/trickle (the project looks stale, though that may be because it is properly done and there have been no security/other bugs to fix in recent history) which slips its own functions in the call chain to apply user controlled (rather than firewall/routing level) throughput shaping to utilities that don't offer it out of the box.

Re: Enabling IPv6 support for IPv4-only apps on Linux

#55

Super cool! I tried doing a pure IPv6 network a little over a decade ago; Maybe I’ll try it again. Though, my cheap IoT devices likely still need IPv4… but perhaps not internet connectivity. It might be fun to explore just how much IPv4 continues to be ingrained into cheap Things (eg: Arduino WiFI?) There always seems to be a long tail of small places where IPv4 pops straight back into the equation.

Small places? When I disabled IPv4 a few weeks ago, I couldn't use: HN, GitHub, Reddit, Discord, Duckduckgo.

[dead]

Re: Enabling IPv6 support for IPv4-only apps on Linux

#56
post #53

Would be interesting to know which applications actually have problems with v6 - the example with directly using a v4 IP is more a user error, not an application issue. I pretty much stopped submitting patches enabling v6 functionality to various projects back in 2005 as everything I cared about was working at that point. (Side note, I was just trying to search a few of those - but seems that period pretty much doesn…

There seem to be hard cuts in search returns at 5 and 10 years, it's been really difficult to find anything from before 2012 without incredibly specific searches. Lots and lots of link rot too so it's hard to say how much of that is google/bing/etc.

Re: Enabling IPv6 support for IPv4-only apps on Linux

#57
post #41

Earlier quoted context omitted.

As a general rule, if you're deploying IPv6 subnets sized as anything other than /64, you're doing it wrong

The only reason for that "rule" is SLAAC.

Actually it's primarily due to NDP and EUI-64. Eliminating ARP is a very good thing for reasons of scalability, reliability and security.

Re: Enabling IPv6 support for IPv4-only apps on Linux

#59

Earlier quoted context omitted.

Maintaining your own patchset for your personal use is usually not a good use of your time and expertise. Every time someone runs a linter over upstream, you're going to have to remake that patch. Sure, it's only 20 mins... But that multiplied by every bit of software you patch and every release, and you quickly realise that a huge chunk of your life was wasted doing what is effectively busywork. Instead, contribute…

The "upstream or nothing" attitude is an attempt to erase any difference between free software and "visible source". Offering changes back to upstream is always encouraged, but whether or not it is accepted is largely irrelevant to the patch author.

I just don't think it's a good use of OP's time - effectively developing and maintaining software for 1 user.

One main benefit of software/computers/the internet is that work done by one person can benefit millions - thats what sets us apart from cavemen who had to do everything for themselves, and got a worse quality of life as a result.

Re: Enabling IPv6 support for IPv4-only apps on Linux

#60
post #38

Earlier quoted context omitted.

There's absolutely _no_ good reason to do that if you're only facing the internet with a single IP on your router as a NAT gateway, except to make your life hell. Only thing that may be worth doing is parting ways with the one internet-facing IPv4 and relying solely on IPv6 there, but that's mostly up to your ISP and their own infrastructure. Even if you were to 100% NAT your IPv4 LAN to IPv6 WAN, and your ISP still…

Why wouldn't you be able to disable IPv4 in the router ? Also, isn't trying to run both IPv4 and IPv6 inherently a security issue coming from the complexity of dealing with two overlapping networks with very different logic ?

Then how would you reach the IPv4-only internet (i.e. a large part of the Internet)?
Post reply on HN