Live data from Hacker News

How does Linux NAT a ping?

devnonsense.com

11–20 of 108 posts

Re: How does Linux NAT a ping?

#11

NAT is such a trashy abstraction. IPv4 needs to die.

I have a few devices on my home internet, on a handful of 192.168 subnets

The other week I moved my ISP. The AS my house belonged to obviously changed to the new ISP, and I got a new v4 IP

All I had to do was update my Wan router to forward trafffic from the new Ip.

Instead with ipv6 I would have to change every node on my network, update my internal DNS.

Now in theory I could have my own /48 which I take with me. That relies on my new ISP being willing to advertise it (which my current one does) but it’s not particularly common.

However a week ago my phone line was cut. I got a 5g mifi out and moved my wan connectivity through that until the cable was fixed. Again a nice simple masquerade on that interface and all was good (well not that good - very poor signal where I live)

But the elephant in the room is of course all that ipv6 stuff aside, I still need to run a dual stack (or use trashy nat abstractions). It increases my work for no benefit.

But taking about work, how about there?

I have a fleet of vehicles on internal 172.16/12 subnets, they plug together and route to each other, and route from where they are via a variety of vpn connectivity (hoping that at least one method will work, as there’s rarely a signal in the basements these park)

If I moved them to ipv6 then again I’m back to having to move my /48s. Except these vehicles get internet from various sporting venues - most of which struggle to turn off MITM/443 or unblock UDP, that’s just not going to work in a world where they turn up at 10am Saturday morning and need to be working 2 hours later.

What business benefit is there for me to double the workload and double the risk by moving to dual stack?

Re: How does Linux NAT a ping?

#12
post #9

Earlier quoted context omitted.

You need NAT (or something else that is worse in some respects, like port forwarding) in any situation in which your subnet is given only one address upstream, even if it is an IPv6 address.

If your ISP doesn't do PD with v6, their implementation sucks. Even my crappy 6rd setup from CenturyLink gives me iirc an entire /48.

Many ISPs suck. That’s not controversial.

We have to deal with the world we live in, not the world we’d like.

Re: How does Linux NAT a ping?

#13
post #9

Earlier quoted context omitted.

If your ISP doesn't do PD with v6, their implementation sucks. Even my crappy 6rd setup from CenturyLink gives me iirc an entire /48.

Many ISPs suck. That’s not controversial. We have to deal with the world we live in, not the world we’d like.

That's why variable length SLAAC has been proposed

https://datatracker.ietf.org/doc/draft-mishra-6man-variable-...

Re: How does Linux NAT a ping?

#14
post #7

It's refreshing to see a "how does" which actually drills down through layers of abstraction all the way to the source code. Nicely explained and very informative!

I came here to write this. Routing and networking is still confusing for me and all the writing about it is usually very "abstract" to me. A hands-on example like this one is really appreciated. Nice work, OP. I'll try to do it myself and follow along.

EDIT: one of the only other posts about this stuff that has made much sense to me is this one from Tailscale. It contains lots of "worked out examples" that really make it clear how everything fits together.

https://tailscale.com/blog/how-nat-traversal-works/

Re: How does Linux NAT a ping?

#15
post #9

Earlier quoted context omitted.

If your ISP doesn't do PD with v6, their implementation sucks. Even my crappy 6rd setup from CenturyLink gives me iirc an entire /48.

Many ISPs suck. That’s not controversial. We have to deal with the world we live in, not the world we’d like.

> Many ISPs suck. That’s not controversial.

> We have to deal with the world we live in, not the world we’d like.

No we don't. Some choose to just put up with shittiness, others enact change.

Re: How does Linux NAT a ping?

#16
post #7

It's refreshing to see a "how does" which actually drills down through layers of abstraction all the way to the source code. Nicely explained and very informative!

I came here to write this. Routing and networking is still confusing for me and all the writing about it is usually very "abstract" to me. A hands-on example like this one is really appreciated. Nice work, OP. I'll try to do it myself and follow along. EDIT: one of the only other posts about this stuff that has made much sense to me is this one from Tailscale. It contains lots of "worked out examples" that really mak…

IME if you're digging into the finer points of netfilter, you eventually run up against the limits of published documentation and have to dig into the source code to figure some things out.

Re: How does Linux NAT a ping?

#17

NAT is such a trashy abstraction. IPv4 needs to die.

Is there a better way to not unnecessarily leak addressing metadata to adversarial remote nodes and middle boxes?

IPv6 with assigning end users a whole /64 and end-devices continually churning through privacy addresses is a start. But even then some form of NAT is still required to nimbly use source prefixes from different horizon providers - eg to avoid spilling your geographic location or opening yourself up to low-effort legal shakedowns.

An example: on my local network I've got an everyday web browsing VM and a torrent VM. They each have static 192.168.x.x addresses, both so I can ssh in for administration and also to control their view of network services. They each see a completely different Internet horizon through the router - the web browsing goes out from a rotating datacenter IP, and the torrent one goes out from a consumer VPN. Each of those outgoing horizons uses NAT - any of my hosts using that rotating data center IP appears the same, and any of my host using the consumer VPN appears the same as every other customer using that same VPN node.

What is the no-NAT equivalent of this? Make that rotating data center IP and VPN external IP into subnet allocations, somehow feed that addressing information back to the hosts that are using it, and dual-home each VM with two routable addresses? For equivalent mixing on the consumer VPN there would also need to be some ARP-like protocol that let me continually rotate the address.

Re: How does Linux NAT a ping?

#18

NAT is such a trashy abstraction. IPv4 needs to die.

I have a few devices on my home internet, on a handful of 192.168 subnets The other week I moved my ISP. The AS my house belonged to obviously changed to the new ISP, and I got a new v4 IP All I had to do was update my Wan router to forward trafffic from the new Ip. Instead with ipv6 I would have to change every node on my network, update my internal DNS. Now in theory I could have my own /48 which I take with me. Th…

I do believe there is some kind of 1:1 NAT with IPv6 these days, which is way better than 1:Many of IPv4. There are so many potentially useful applications that are DOA because of v4 NAT being everywhere.

Re: How does Linux NAT a ping?

#20
post #15

Earlier quoted context omitted.

Many ISPs suck. That’s not controversial. We have to deal with the world we live in, not the world we’d like.

> Many ISPs suck. That’s not controversial. > We have to deal with the world we live in, not the world we’d like. No we don't. Some choose to just put up with shittiness, others enact change.

OP here.

Your "ISP" is a sysadmin at work who gives you one address to your cube.

You otherwise like the work and the team, and the compensation is fine.

Now what?

Post reply on HN