this post was submitted on 19 Jun 2024
315 points (85.6% liked)

Programmer Humor

19817 readers
112 users here now

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

founded 2 years ago
MODERATORS
 

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

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 116 points 6 months ago (2 children)
[–] [email protected] 29 points 6 months ago

Apes together weak

load more comments (1 replies)
[–] [email protected] 93 points 6 months ago (20 children)

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 !

[–] [email protected] 21 points 6 months ago

I felt dirty!

"Senpai, route me like one of your French ISPs"

[–] [email protected] 14 points 6 months ago (2 children)

Sir this is a Wendy's

JK that's a lot of good info

load more comments (2 replies)
[–] [email protected] 11 points 6 months ago (14 children)

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

[–] [email protected] 15 points 6 months ago

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

load more comments (13 replies)
load more comments (17 replies)
[–] [email protected] 84 points 6 months ago (1 children)

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.

[–] [email protected] 30 points 6 months ago (5 children)

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

[–] [email protected] 22 points 6 months ago

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.

[–] [email protected] 18 points 6 months ago (9 children)

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.

load more comments (9 replies)
[–] [email protected] 7 points 6 months ago

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

load more comments (2 replies)
[–] [email protected] 60 points 6 months ago (1 children)
[–] [email protected] 19 points 6 months ago (12 children)

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.

[–] [email protected] 9 points 6 months ago (2 children)
[–] [email protected] 7 points 6 months ago

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

load more comments (1 replies)
load more comments (11 replies)
[–] [email protected] 59 points 6 months ago (4 children)

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

[–] [email protected] 16 points 6 months ago

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

load more comments (3 replies)
[–] [email protected] 54 points 6 months ago (1 children)

Honestly we should just use 4 bit ip addresses, it’s too hard for me to remember ipv4 addresses anyways. Carrier grade NAT will take care of the rest.

[–] [email protected] 35 points 6 months ago (1 children)

Why compromise? Use 1-bit IP addresses.

[–] [email protected] 21 points 6 months ago* (last edited 6 months ago)

Finally, a use for my 1-bit bloom filter!

[–] [email protected] 43 points 6 months ago (3 children)
[–] [email protected] 70 points 6 months ago

I haven't read anything this cursed in a while

[–] [email protected] 27 points 6 months ago* (last edited 6 months ago) (3 children)

Yes, but why would you want to? We have enough addresses for the foreseeable future.

[–] [email protected] 26 points 6 months ago (16 children)

So you don’t need to change your network if your isp changes.

[–] [email protected] 8 points 6 months ago

You shouldn’t have to?? Maybe you might need to change the mask in your firewall settings if the ipv6 allocation block size changes but that should be it.

Everything else should just work as normal.

load more comments (15 replies)
[–] [email protected] 15 points 6 months ago* (last edited 6 months ago) (1 children)

1:1 stateless NAT is useful for static IPs. Since all your addresses are otherwise global, if you need to switch providers or give up your /64, then you'll need to re-address your static addresses. Instead, you can give your machines static private IPs, and just translate the prefix when going through NAT. It's a lot less horrible than IPv4 NAT since there's no connection tracking needed.

This is something I probably should have done setting up my home Kubernetes cluster. My current IPv6 prefix is from Hurricane Electric, and if my ISP ever gives me a real IPv6 prefix, I will have to delete the entire cluster and recreate it with the new prefix.

[–] [email protected] 7 points 6 months ago (17 children)

It should only be needed if your ISP is brain-dead and only gives you a /64 instead of what they should be doing and also giving you a /56 or /48 with prefix delegation (I.e it should be getting both a 64 for the wan interface, and a delegation for routing)

You router should be using that prefix and sticking just a /64 on the lan interface which it advertises appropriately (and you can route the others as you please)

Internal ipv6 should be using site-local ipv6, and if they have internet access they would have both addresses.

load more comments (17 replies)
load more comments (1 replies)
[–] [email protected] 10 points 6 months ago

Only if you're a masochist.

[–] [email protected] 35 points 6 months ago (2 children)

Ha I can remember the ipv6 of cloudflare DNS just fine! It's uh..... something : something : something :: 1111

[–] [email protected] 13 points 6 months ago* (last edited 6 months ago) (9 children)

2606:4700:4700::1111

Hmm, maybe Google is easier:
2001:4860:4860::8888

Quad9 is 2620:fe::fe or 2620:fe::9

I don't understand why they can't get better addresses than that. Like surely 1::1 would be valid?

Edit: So IANA only control addresses 2001:: and up and there are quite a few IETF reservations within that. I don't know why they picked such a high number to start at. Everything else seems IETF reserved with a little space allocated for special purposes (link-local, multicast, etc.).

load more comments (9 replies)
load more comments (1 replies)
[–] [email protected] 29 points 6 months ago

Typing addresses in ipv4 is ingrained into my brain, but zero NATing with ipv6 is magical.

[–] [email protected] 29 points 6 months ago (11 children)

Ipv6 is not 6 bytes? 8 segments of 2 bytes for a sum of 16 bytes?

Or am I stupid right now?

load more comments (11 replies)
[–] [email protected] 24 points 6 months ago (1 children)

Mystery of the universe, would IPv5 have hit the sweet spot and taken off?

[–] [email protected] 9 points 6 months ago

I'm still on IPv3, haven't updated yet.

[–] [email protected] 20 points 6 months ago* (last edited 6 months ago)

6 ≠ 16
v ≠ o

[–] [email protected] 16 points 6 months ago* (last edited 6 months ago) (4 children)

IPv6 = second system effect. It's way too complicated for what was needed and this complexity hinders its adoption. We don't need 100 ip addresses for every atom on the earth's surface and we never will.

They should have just added an octet to IPv4 and be done with it.

[–] [email protected] 24 points 6 months ago* (last edited 6 months ago) (7 children)

Every time there's a "just add an extra octet" argument, I feel some people are completely clueless about how hardware works.

Most hardware comes with 32-bit or 64-bit registers. (Recall that IPv6 came out just a year before the Nintendo 64.) By adding only an extra octet, thus having 40 bits for addressing, you are wasting 24 bits of a 64-bit register. Or wasting 24 bits of a 32-bit register pair. Either way, this is inefficient.

And there's also the fact that the modern internet is actually reaching the upper limits of a hypothetical 64-bit IPv5: https://lemmy.world/comment/10727792. Do we want to spend yet another two decades just to transition to a newer protocol?

load more comments (7 replies)
[–] [email protected] 10 points 6 months ago

it's not about using all 100 IP addresses for every atom

it's about having large enough ranges to allocate them in ways that make sense instead of arbitrarily allocating them by availability

load more comments (2 replies)
[–] [email protected] 14 points 6 months ago (4 children)

Ok, now I'm fully proposing a new standard, called IPv16! (Keeping with the tradition to jump over numbers.)

Also, it will be fully backwards compatible for a change! That solves the largest complaint from the holdouts!

load more comments (4 replies)
[–] [email protected] 9 points 6 months ago (8 children)

Slightly related to the issue of remembering addresses, I think the main issue is with the fact that local nameservers are pretty much non-existent if you're not running OpenWrt or OpnSense. Which is shameful because the local nameserver is an amazing quality of life tool.

Also the fact that officially there are no local TLDs except for ".arpa" while browsers won't resolve one word domains without adding http://

And don't get me started on TLS certificates in local networks... (although dns01 saves the day)

load more comments (8 replies)
[–] [email protected] 7 points 6 months ago (2 children)

Well... I still like IPv6 better than ATM and those darn virtual circuit identifiers.

load more comments (2 replies)
load more comments
view more: next ›