Today in our newest take on “older technology is better”: why NAT rules!

115 points

Fire bad, change scary

permalink
report
reply
29 points

Apes together weak

permalink
report
parent
reply
1 point

Tree pretty

permalink
report
parent
reply
91 points

I felt dirty! and broke so much shit when i had to implement NAT on networks in the mid 90’s. Nowdays with ipv6 and getting rid of NAT is much more liberating. The difference is staggering!

  • you do not need NAT any longer, firewall is the security, just like on ipv4, just less obscurity.
  • you do not need dns views, to workaround NAT any more
  • you do not need hairpin NAT to workaround NAT any more
  • you do not need to renumber to resize a network. they are always /64, and the answer to how many hosts can it fit is: ALL of them!
  • many ALG’s will be unnecessary since there is not NAT.
  • vpn’s are easier, since it can be the same address both inside and outside the vpn, the firewall (or host even) enforces the encryption.
  • vpn’s are MUCH easier since you will have less rfc1918 collisions due to some other network using the rfc1918 of the vpn’s network
  • vpn’s are MUCH MUCH easier since you will have less rfc1918 collisions due to you using the rfc1918 of the vpn partner network, to 1:1 nat a previous vpn network you collided with some months ago… ARGH!!!
  • vpn are generally less required, heck i swear 95% of the time the VPN are just to workaround the NAT problem and the data is pointlessly double or triple encrypted.
  • you can make more granular firewall rules (eg the spesific host, or network of the source address, instead of the whole enterprise’s public ip) this is real tangible improved security, where any random machine in a network you do not control. do not automatically have openings into your own network.
  • firewall objects can if it is suited easily use and depend on FQDN DNS objects when allowing traffic. reducing the need of coordinating firewall object ip address changes between 15 companies.
  • firewall rules are easier, more readable, and much more predictable how they will work. All the hairpin nat, public to private nat, private to public nat for a thing that need a different public ip, 1:1 nat for a separate zone, NAT to a vpn or 50 (where 10 of them are 1:1 nat due to collisions, making you require 4 dns views of the same ip space!! ) very quickly gets messy and unreadable. this is probably the largest security benefit. just to reduce the complexity.
  • much easier to get people to use dns, since nobody wants to remember ipv6 addresses :D
  • nibbles in the ipv6 address can have meanings you assign to them, making the networks and structure both easy to remember and logically structured.
  • aggregating routes becomes very easy if you design your network that way.
  • firewall policies can become easier if you design your network that way.
  • your routing tables is leaner and easier, and of a better consistency. We have 1 large public ipv6 prefix, but 25ish ipv4 prefixes of all kinds of various sizes.
  • no need to spend $$ to buy even more ipv4 prefixes.
  • no need to have spent hundreds of $$ on a new ipv4 prefix only to be unable to use them for over a year because you need to sanitize the addresses from all the reputation filters. and constantly hound geo ip database providers to update the new country of the prefix. (i am bitter, can you tell…)
  • did i mention no need to renumber since you need to grow the /24 to /23 due to to many hosts in a network ?
  • did i mention no need to renumber 2 /24’s to /25’s to make space for that larger /23.
  • you do not even need any ipv4 addresses any more, use a public NAT64 service, for outgoing. and for incoming just use one of the many free public ipv4 to ipv6 proxies for your services online. for a homelab i really like http://v4-frontend.netiter.com/ (go support them) But most large business l networks use cloudflare, or akamai
  • since you do not need your ipv4 address space any more, you can ~~sell them for a profit $$$ ~~ return them to the RIR and give some address space to one of the thousands of companies struggling because they do not have any IPv4 : https://www.ripe.net/manage-ips-and-asns/ipv4/ipv4-waiting-list/
  • much lower latency on ipv6, since you do not go across a cloud based ipv4 to ipv6 proxy in order to reach the service ;)

Now the greatest and best effect of ipv6 is none of the above. It is that with ipv6 we have a slim hope of reclaiming some of what made the Internet GREAT in the first place. When we all stood on equal footing. Anyone could host their own service. Now we are all vassals of the large companies that have made the common person into a CGNAT4444 using consumer mindlessly lapping up what the large company providers sees fit to provide us. with no way to even try to be a real and true part of the Internet. Fight the companies that want to make you a eyeball in their statistic, Set up your own IPv6 service on the Internet today !

permalink
report
reply
20 points

I felt dirty!

“Senpai, route me like one of your French ISPs”

permalink
report
parent
reply
14 points

Sir this is a Wendy’s

JK that’s a lot of good info

permalink
report
parent
reply
3 points

i got like a third through it before scrolling to the bottom to see how long it was. omg! should be the canonical example of the opposite of a shitpost ha

permalink
report
parent
reply
2 points

Its as long as an ipv6 address

permalink
report
parent
reply
11 points

If all that is true, then why do I still hate ipv6 so much.

permalink
report
parent
reply
15 points

I assume the normal fear of unknown things. It is hard to hate ipv6 once you have equivalent competence in ipv4 and ipv6.

permalink
report
parent
reply
5 points

🧓

permalink
report
parent
reply
5 points

I’d bet it’s this little bugger " : "

It is for me.

permalink
report
parent
reply
1 point

The : is ok. I dont struggle with the shortening part. I struggle the “everything else” part.

permalink
report
parent
reply
1 point
*

What is localhost now again…

Edit, remember you could use 127.0.0.1, but then it was changed to like 127.0.0.1…something…ff

So guess I was wrong :-) thanks for the info!

permalink
report
parent
reply
0 points

For me is because it’s so fucking slow. As soon as I disable ipv6 on every device it has better speeds.

IPv6 is trash.

permalink
report
parent
reply
10 points

Tell that to your ISP which has fucked their IPv6 deployment up. In my experience IPv6 is actually faster since it bypasses the IPv4 CGNAT.

On busy days my IPv4 connection can get as slow as 15KB/s, now that’s trash.

permalink
report
parent
reply
6 points

Lol that’s ridiculous. There’s nothing about ipv6 that’d make it any slower

permalink
report
parent
reply
2 points

Google’s data shows that IPv6 is usually faster. Their metrics show an average of 10ms less latency over IPv6 in the USA and Canada: https://www.google.com/intl/en/ipv6/statistics.html#tab=per-country-ipv6-adoption

permalink
report
parent
reply
4 points

Imagine actually having ipv6 available through your ISP.

…and ever if my ISP actually provided one, getting a static one costs money so there’s no difference in the end.

permalink
report
parent
reply
3 points

I guess I am lucky. 3 out of 3 isp’s available from in my region provide IPv6 with a dhcp-pd assigned stable address by default. (Norway)

permalink
report
parent
reply
2 points

Yeah, here in Russia the ISPs and IT infrastructure guys seem to be treating IPv6 like it has cooties. I can’t find an article (and it’d be in russian anyway) but as far back as 2022, if you get IPv6 you can expect a variety of issues with it, ranging from “you need to reboot your router every once in a while” to “you technically have v6 but good luck actually browsing v6 internet”.

And of course, why would they give you a stable IP when they can charge for it :T. At least it’s only a third the price of a stable IPv4.

My current ISP technically provides v6 according to their site - but my connection doesn’t have it, and since there’s nothing about it in the years-old contract, I’d need to redo that if I want to complain.

permalink
report
parent
reply
2 points

I just get that included. Like the Norwegian guy, but in Switzerland from Init7

permalink
report
parent
reply
4 points

This is one of the best comments I’ve ever read on Lemmy. Thanks for writing it. I fully agree with all your points!

permalink
report
parent
reply
2 points

Thank you! :) I also notice i compleatly forgot the port exhaustion issue we see with larger networks behind roo few ipv4 NAT addresses…

permalink
report
parent
reply
2 points

But IPv4 addresses are easier to remember!

/s

I could see a point of having home networks stay on IPv4 and NAT with an external v6 address.

That would keep the current security model for home networks where we can assume general tech litteracy is low.

permalink
report
parent
reply
4 points

That is not how it works. You can have a home network on ipv6. And it can reach all of ipv4 via nat ( just like ipv4 do today). A net with only ipv4 can not reach any ipv6 without a proxy that terminst the v4 connection and make a new v6 connection. since ipv6 is backwards compatible. But ipv4 is naturally not forwards compatible.

Also it is the default deny of the stateful firewall that always coexist with NAT, since NAT depends on that state, that is the security in a NAT router.
That default deny is not in any way dependant on the NAT part.

permalink
report
parent
reply
2 points

Interesting, I thought NAT could handle it…

permalink
report
parent
reply
-3 points

Con: you are now even more dependent on DNS, increasing the blast radius even more if when it breaks.

permalink
report
parent
reply
6 points

But DNS rarely break. The meme about it beeing DNS’s fault is more often then not just a symptom of the complexity of IPv4 NAT problem.

If i should guesstimate i think atleast 95% of the dns issues i have ever seen, are just confusion of what dns views they are in. confusion of inside and outside nat records. And forgetting to configure the inside when doing the outside or vice verca. DNS is very robust and stable when you can get rid of that complexity.

That beeing said, there are people that insist on obscurity beeing security (sigh) and want to keep doing dns views when using IPv6. But even then things are much easier when the result would be the same in either view.

permalink
report
parent
reply
2 points

That beeing said, there are people that insist on obscurity beeing security (sigh) and want to keep doing dns views when using IPv6. But even then things are much easier when the result would be the same in either view.

OMG!!

This guys a bee! Everybody run!!!

permalink
report
parent
reply
1 point

I broke DNS plenty of times in my homelab independent from NAT. In the last few months:

  • didn’t turn off DNS server in a wifi router set up as bridged access point
  • dnsmasq failing to start because I removed an interface
  • dnsmasq failing to start because the kernel/udev didn’t rename an interface on time
  • dnsmasq failing to start because hostapd error didn’t set proper interface settings
  • forgot to remove static DNS entries in /etc/hosts used for testing
  • forgot to remove DNS entries from /etc/resolve.conf after visiting a friend and working on his setup

Yes, most of them is my dumb ass making mistakes, but in the end it’s something that constantly breaks and it helps knowing the IP addresses of my servers and routers.

Aditionally, obscurity is a security helper. The problem is relying only on obscurity. But if I have proper firewall rules in place and strong usernames and passwords I still prefer if you don’t even know the IP addresses of my servers on top of that (in case I break some of the other security layers).

permalink
report
parent
reply
83 points

I think it’s worth taking the time to learn IPv6 property. If you have a good understanding of IPv4 it shouldn’t take you more than an afternoon.

Eliminating NAT and just using firewall rules (ie what NAT does behind your back) is incredibly freeing.

I don’t get people complaining about typing out IPs. I like to give all of my clients full FQDNs but you don’t have to. Just using mDNS would be enough to avoid typing a bunch of numbers.

permalink
report
reply
30 points

Maybe I have Stockholm Syndrome, but I like NAT. It’s like, due to the flaws of IPv4 we basically accidentally get subnets segmented off, no listening ports, have to explicitly configure port forwarding to be able to listen for connections, which kinda implies you know what you’re doing (ssshh don’t talk about UPnP). Accidental security of a default deny policy even without any firewalls configured. Haha. I’m still getting into this stuff though, please feel free to enlighten me

permalink
report
parent
reply
22 points

I don’t think you have Stockholm syndrome. You just like what you already understand well. It’s a normal part of the human condition.

All those features of nat also work with IPV6 with no nat in the exact same way. When I want to open up a port I just make a new firewall rule. Plus you get the advantages of being able to address the ach host behind the firewall. It’s a huge win with no losses.

permalink
report
parent
reply
18 points

Anything connected to an untrusted network should have a firewall, doesn’t matter if it’s IPv4 or IPv6.

There’s functionally no difference between NAT on IPv4 or directly allowing ports on IPv6, they both are deny by default and require explicit forwarding. Subnetting is also still a thing on IPv6.

If anything, IPv6 is more secure because it’s impossible to do a full network scan. My ISP assigned 4,722,366,482,869,645,213,696 addresses just to me. Good luck finding the used ones.

With IPv4 if you spin up a new service on a common port it usually gets detected within 24h nowadays.

permalink
report
parent
reply
5 points
*

I wouldn’t rely on the size of the address space to provide security. It’s possible to find hosts through methods other than brute force scanning. I remember seeing a talk from a conference (CCC? DEF CON? I can’t remember) where they were able to find hosts in government IPv6 address space (might have been DOD?) through stuff like certificate transparency logs and other DNS side channels.

Man, I need to go find that talk now…

Edit: I don’t think this is the one I saw previously but is in a similar vein: https://www.youtube.com/watch?v=AayifEqLbhI

permalink
report
parent
reply
5 points
*

Could a hypothetical attacker not just get you to visit a webpage, or an image embedded in another, or even a speculatively loaded URL by your browser. Then from the v6 address of the connection, directly attack that address hoping for a misconfiguration of your router (which is probable, as most of them are in the dumbest ways)

Vs v4, where the attacker just sees either your routers IP address (and then has to hope the router has a vulnerability or a port forward) or increasingly gets the IP address of the CGNAT block which might have another 1000 routers behind it.

Unless you’re aggressively rotating through your v6 address space, you’ve now given advertisers and data brokers a pretty accurate unique identifier of you. A much more prevalent “attack” vector.

permalink
report
parent
reply
3 points

Ahh, woah, I never thought about the huge address space would affect network scans and such.

With NAT on IPv4 I set up port forwarding at my router. Where would I set up the IPv6 equivalent?

I guess assumptions I have at the moment are that my router is a designated appliance for networking concerns and doing all the config there makes sense, and secondly any client device to be possibly misconfigured. Or worse, it was properly configured by me but then the OS vendor pushed an update and now it’s misconfigured again.

permalink
report
parent
reply
1 point
*

Good luck finding the used ones.

That and the IPv6 address on client systems will periodically rotate (privacy extensions), so the IPs used today won’t necessarily be the ones used tomorrow.

(you can disable that of course, and it’s usually disabled by default on server-focused OSes)

permalink
report
parent
reply
7 points

Instead of nat and port forwards that rewrite, your firewall is set to only forward specific traffic, exactly how’d you’d configure outbound forwarding on a nat network (but opposite directions)

Open forwarding is a router, not a firewall

permalink
report
parent
reply
3 points

Every time I see a defense of IPv4 and NAT, I think back to the days of trying to get myself and my roommate to play C&C: Generals together online, with a 2v2 game, with one of us hosting. Getting just the right combination of port forwarding working was more effort than us playing C&C: Red Alert on dial up when we both lived at home.

With IPv6, the answer is to open incoming traffic on the port(s) to the host machine (or just both since the other guy is might host next time). With IPv4, we have to have a conversation about port forwarding and possibly hairpin routes on top of that. This isn’t a gate for people “who know what they’re doing”, it’s just a bunch of extra bullshit to deal with.

permalink
report
parent
reply
2 points

accidentally get subnets segmented off, no listening ports, have to explicitly configure port forwarding to be able to listen for connections

You can intentionally get that behaviour by using a firewall.

permalink
report
parent
reply
59 points

Bro used <> instead of !=

permalink
report
reply
19 points

What languages use this? I don’t like it!

On the other hand it goes well with >= and <=. If >= means “either > or =” then <> means “either < or >”, it checks out.

But I still don’t like it.

permalink
report
parent
reply
9 points

BASIC. At least VB.

permalink
report
parent
reply
7 points

I think Excel formulas also use this, but it’s been a long time so I might be misremembering.

permalink
report
parent
reply
3 points

Can confirm also BASICA, GWBASIC, QBASIC, and QuickBASIC

permalink
report
parent
reply
7 points

SQL

permalink
report
parent
reply
1 point
*

Depends on the dialect. I mostly use Presto and MySQL at work, and both allow !=.

Presto also lets you use NOT for booleans - instead of WHERE foo = false, you can do WHERE NOT foo.

permalink
report
parent
reply
7 points

SQL uses it but yeah, not programming language :p.

I was on mobile so I didn’t have a .XCompose available to type .

permalink
report
parent
reply
5 points

If you want to be able to write practically anything on mobile, including ≠, ≈, ‰, ℝ etc., have a look at Unexpected keyboard. No spellcheck or autocomplete, though.

permalink
report
parent
reply
3 points

I was on mobile so I didn’t have a .XCompose available to type.

I feel the opposite. On mobile I have much easier access to special characters. I just need to hold down characters to get more variants.

permalink
report
parent
reply
2 points

SQL is definitely a programming language. Most dialects are Turing-complete in some way. Some allow custom functions and stored procedures.

permalink
report
parent
reply
3 points
*

Damn I never understood it but now it makes sense thanks to you

Yea it’s ugly 😭

permalink
report
parent
reply
2 points
*

F# definitely and maybe Haskell and OCaml as well? Elixir and Erlang use it as a binary concatenation operator.

permalink
report
parent
reply
3 points

Yes for OCaml. Haskell’s inequality is defined as /= (for ≠). <> is usually the Monoid mappend operator (i.e. generalized binary concatenation).

permalink
report
parent
reply
2 points

logo does

permalink
report
parent
reply
58 points

The problem is we’re projected to run out of unique IPv4 addresses by 2003.

permalink
report
reply
14 points

And we are facing the effects of it as we’re speaking. CGNAT and protocols like TURN were not invented without a reason.

permalink
report
parent
reply
4 points

Not a big deal. We’re projected to run out of years by 2000 and then the world will end.

permalink
report
parent
reply
4 points

And it took a lot of hard work by a lot of people to adopt new date standards to avoid that problem. Now it’s time to adopt new IP standards, and it’s going to take a lot of hard work by a lot of people.

permalink
report
parent
reply
4 points

Oh god that brings back memories. Reallying dumb ones of people but memories none the less

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 9.5K

    Monthly active users

  • 824

    Posts

  • 31K

    Comments