this post was submitted on 14 Dec 2025
260 points (98.9% liked)

Today I Learned

26210 readers
784 users here now

What did you learn today? Share it with us!

We learn something new every day. This is a community dedicated to informing each other and helping to spread knowledge.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must begin with TIL. Linking to a source of info is optional, but highly recommended as it helps to spark discussion.

** Posts must be about an actual fact that you have learned, but it doesn't matter if you learned it today. See Rule 6 for all exceptions.**



Rule 2- Your post subject cannot be illegal or NSFW material.

Your post subject cannot be illegal or NSFW material. You will be warned first, banned second.



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That's it.



Rule 5- No baiting or sealioning or promoting an agenda.

Posts and comments which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding non-TIL posts.

Provided it is about the community itself, you may post non-TIL posts using the [META] tag on your post title.



Rule 7- You can't harass or disturb other members.

If you vocally harass or discriminate against any individual member, you will be removed.

Likewise, if you are a member, sympathiser or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people, and you were provably vocal about your hate, then you will be banned on sight.

For further explanation, clarification and feedback about this rule, you may follow this link.



Rule 8- All comments should try to stay relevant to their parent content.



Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- Majority of bots aren't allowed to participate here.

Unless included in our Whitelist for Bots, your bot will not be allowed to participate in this community. To have your bot whitelisted, please contact the moderators for a short review.



Partnered Communities

You can view our partnered communities list by following this link. To partner with our community and be included, you are free to message the moderators or comment on a pinned post.

Community Moderation

For inquiry on becoming a moderator of this community, you may comment on the pinned post of the time, or simply shoot a message to the current moderators.

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] 3abas@lemmy.world 39 points 1 day ago (4 children)

NAT isn’t “security” in the cryptographic sense, but saying “no NAT has no downside to security” ignores what NAT + private addressing is used for: a hard boundary that prevents a whole class of accidental exposure.

Easy examples:

Home network analogy: Your laptop has a private IP (192.168.x.x). People on the internet can’t just connect to it unless you explicitly port-forward. If your router’s firewall rule is messy or you temporarily enable a service, that laptop still isn’t automatically internet-reachable. With public IPs on every device, a single bad rule can put that laptop directly on the internet.

Someone enables RDP/SSH “just to test something"? Behind NAT, it’s usually still not reachable inbound unless you publish it. With public addressing everywhere, one mis-scoped firewall rule (or host firewall disabled) can instantly make it reachable from anywhere.

With NAT, “what’s internet-facing?” is basically “what did we intentionally publish on the edge” (load balancer, reverse proxy, VPN gateway). With public IPs on every endpoint, “what’s internet-facing?” becomes “prove the firewall posture for thousands of hosts and ports,” which is harder and riskier at scale.

You’re right that IPv6 removes the address shortage reason for NAT. But IPv6 does not mean “everything must be publicly reachable.” The IPv6 equivalent of “internal-only” is using ULA (fc00::/7) for internal addressing, and/or using globally routable IPv6 but keeping a default-deny inbound firewall and publishing only through controlled ingress (reverse proxy, load balancer, VPN/Zero Trust).

So the point isn’t “NAT = security.” The point is: NAT + private addressing is a very effective exposure control and mistake-buffer. You can replicate the security model without NAT (especially in IPv6), but you do it with addressing design + strict firewalling + controlled ingres, not by claiming there’s no downside.

You don't want every device on your network publicly addressable, it's going to cause you some problems.

[–] possiblylinux127@lemmy.zip 6 points 1 day ago (3 children)

That's not how that works

NAT is not a firewall. If you don't have a Firewall in place bad things will happen.

For IPv6 you just set your Firewall to deny all and then add exceptions as needed. That is the default pretty much everywhere.

[–] 3abas@lemmy.world 8 points 1 day ago (2 children)

I never suggested NAT is a firewall.

Your firewall is typically the device doing the NAT (or directly on the router if you're a home user and don't have a dedicated hardware firewall). Your firewall/router sits on the edge, exposed with a public IP.

If you desire to expose your laptop, for example, you setup an ingress rule that translates to the laptops local address, and your firewall/router translates all traffic matching the rule and sends it to the laptop.

I'm not sure which part you're not clear on.

[–] hamid@crazypeople.online -4 points 1 day ago (1 children)
[–] 3abas@lemmy.world 1 points 22 hours ago (1 children)

The comment I responded to:

If you have enough IPs then not using NAT makes everything less complicated without any downside to security. If you think otherwise then IPv6 is going to cause you some problems.

From my reading, it's asserting that you don't have to worry about private addressing, which is simply not true.

And from a net admin perspective, the complexity of NATing ipv4 public to private and exposing ULAs (whether you use NAT66 or NPTv6) is comparable.

If they just meant you don't have to worry about the underlying complexity of translating, that's both technically correct and unhelpful. You already don't have to worry about that.

It's this part that makes it clear to me they meant you don't have to worry about private addressing at all: "If you think otherwise then IPv6 is going to cause you some problems."

And I've explained it a few different ways in this thread already, so I don't want to repeat myself, but they are technically correct in that you absolutely could give every device a public IP, and it would be a headache to manage just like OP's example, where they give every device an ipv4 address without NATing...

[–] hamid@crazypeople.online 1 points 17 hours ago

No that image was for the last part of your comment "I’m not sure which part you’re not clear on."

You're right lol this image is for the person your wrote that too sorry.

[–] possiblylinux127@lemmy.zip -5 points 1 day ago* (last edited 1 day ago) (2 children)

From a network component perspective NAT is not a Firewall. It might run on the same device but it is entirely different function

A stateful Firewall is what provides the security. That has nothing to do with NAT. You can port forward a service or you can create a firewall exception. They both do exactly the same thing.

[–] 3abas@lemmy.world 4 points 22 hours ago

I never suggested NAT is a firewall.

[–] AA5B@lemmy.world 1 points 12 hours ago

Sure but the point was that nat allows you to choose private addresses that are by default not routed: the NAT becomes the only way internet traffic can reach your devices

[–] derek@infosec.pub 4 points 1 day ago

What's not how what works? What about the other poster's comment is inaccurate?

[–] timbuck2themoon@sh.itjust.works -1 points 1 day ago (1 children)

Yep.

Too many people learned ipv4 and not actual networking.

[–] 3abas@lemmy.world 4 points 1 day ago (3 children)

Please explain what I got wrong. I'm not perfect, and I might have made a mistake in my explanation, but I don't think I got the networking wrong...

With NAT: Inbound to laptop/printer from Internet is blocked by default because there is no globally routable path to them. Devices are only exposed if you intentionally publish: firewall rule + port-forward.

INTERNET
   |
[Edge Firewall + Public IP]
   |
[NAT]
   |
[Private LAN: 10.0.0.0/24]
   |- laptop 10.0.0.10
   |- printer 10.0.0.20
   |- tablet 10.0.0.30

Without NAT on ipv4, (every device has a pubic IP): inbound to your laptop/printer is blocked by policy.

INTERNET
   |
[Edge Firewall]
   |
[Public LAN: 203.0.113.0/24]
   |- laptop 203.0.113.10
   |- printer 203.0.113.20
   |- whatever 203.0.113.30

Same security if configured properly, NAT just makes it so you don't even have to worry about a whole class of exposure, because there isn't a path to block.

Must be a nightmare to manage the scenario in OP.

[–] heyitsmikey128@lemmy.world 1 points 1 day ago (1 children)

I feel like you're forgetting about subnetting and default gateways. You can't just route to an internal host if there isn't a route. That route, if designed correctly, will be behind a firewall that has things subnetter to default deny all for anything "internal" that shouldn't be publicly routable.

[–] 3abas@lemmy.world 3 points 23 hours ago* (last edited 23 hours ago)

I’m not forgetting subnetting/default gateways... that’s exactly what I’m describing.

If you assign public addresses to internal hosts, then by definition your ISP routes that public prefix to your edge, and your edge routes it to the internal subnets. At that point, reachability exists (there is a route); whether traffic gets through is entirely a question of firewall correctness. One bad zone assignment or an overly-broad “temporary” allow can make a host directly reachable.

With typical IPv4 NAT/PAT, the default posture is different: those internal addresses are not globally routable, and there is no inbound mapping/state unless you intentionally publish something (port-forward/reverse-proxy/VPN). So a lot of “oops” mistakes fail closed. NAT isn’t a security control in theory, but it is a very real operational guardrail against accidental internet exposure.

And on IPv6: the architecture isn’t “give everything a public IP and call it done.” IPv6 can use global addresses with a default-deny stateful firewall, but the IETF also standardized ULA (fc00::/7) specifically for local communications not expected to be routable on the public Internet.

IPv4 NAT was largely driven by address exhaustion, but the reason people keep defending “internal is not directly addressable” is the exposure boundary and change-control safety margin it provides, not a belief that NAT magically replaces a firewall.

[–] timbuck2themoon@sh.itjust.works 0 points 21 hours ago

Point being there is still a firewall in place with a default deny. Nothing fundamentally has changed.

I actually appreciate your diagram because it makes it easy to see. The firewall will not route packets you haven't expressly opened in both scenarios.

[–] possiblylinux127@lemmy.zip -1 points 1 day ago (1 children)

That's not a situation that is going to arise since devices should block all incoming by default. You could need to explicitly poke holes in the Firewall.

[–] 3abas@lemmy.world 2 points 23 hours ago (2 children)

Again, it's a free way to eliminate an attack surface.

It's a situation that can easily arise... you temporarily disable firewall on device to test something, you install a program that exposed a port and don't realize it, whatever the case, without a public IP that device isn't reachable from anywhere except the upstream firewall, which requires explicit NAT/port forwarding rules to allow access. Your devices are isolated by default and must be explicitly routed by policy.

Without NAT/ULA (private ipv6 addresses), your devices are routable by default and must be isolated by explicit policy.

The point is, you don't need NAT (that's exclusively ipv4), but you do need private addressing. That's the point I was responding to.

[–] The_Decryptor@aussie.zone 1 points 21 hours ago

Without NAT/ULA (private ipv6 addresses), your devices are routable by default and must be isolated by explicit policy.

Yes, that's where the basic firewall configuration comes in.

I'm running native v6 at home, with no private addressing (Since it was never implemented right in OSs unfortunately), each system has it's own public IP address, and even an entirely unsecured device is protected since there's still a firewall between my network and the internet.

[–] possiblylinux127@lemmy.zip 1 points 16 hours ago

What's stopping you from accidentally port forwarding?

For that matter, sometimes ISPs route private addresses even though they aren't suppose to.

[–] Brkdncr@lemmy.world 2 points 1 day ago

Lots of text here but a firewall with inbound deny default rule is considerably easier to manage than port and ip address translation. It’s also possible to get unexpected inbound traffic with NAT. It’s how Tailscale works for example. Sounds like a security failure to me.

[–] AA5B@lemmy.world 1 points 12 hours ago

Just wait until the day ipv6 is finally adopted readily and we’ll have this same argument about whether IPv6 addresses are a security feature when a /64 is too big a range to scan

[–] Archer@lemmy.world 1 points 1 day ago

hard boundary that prevents a whole class of accidental exposure.

Yeah, that’s a firewall. I fucking hate hearing about how NAT is more “secure” than public IPs. It's not. It’s not a fucking security feature and should not be treated as one or relied upon implicitly or in any way at all. This is the kind of shit that slows down IPv6 adoption because it’s “less secure”

JFC if you’re relying on NAT for security then you’re doing it wrong. Period.