6 ms·
> NAT destroys the end-to-end principle Yes, and that precisely why I use it in my home network, and will continue to use is with IPv6. I explicitly don't want
by JohnFen 7y ago
> NAT destroys the end-to-end principle
Yes, and that precisely why I use it in my home network, and will continue to use is with IPv6. I explicitly don't want any IP addresses in my green zone to be directly accessibly from my red zone.
- Dagger2 7y agoThen you're doing something very wrong. You can't rely on NAT to stop connections, because that's not a thing NAT does. You need to be using a firewall. NAT is just an extra, useless, complicated and unnecessary thing to be adding to the top of that; one that makes it hard to understand how your network is even working, and which makes it harder rather than easier to secure.
- umanwizard 7y agoCan you explain how an outside person (other than my ISP) can make an outside connection to my laptop despite being behind a NAT? Assuming for concreteness that my laptop's internal (NATted) address is 192.168.1.123 and my router's public address is 123.45.67.89. What sequence of commands would you type to open a TCP connection to my laptop?
- takeda 7y agoNAT is implemented on a firewall, the blocking of incoming connections is a side effect and isn't even intentional (that's why UPnP exists). Since you already have a firewall you can just add a single rule that block incoming connections and that's all you actually need.
- ATsch 7y agoYou are right that it would be hard to open a TCP connection with you on a specific target port on a 1:N NAT without UPnP. If you could, IPv4 exhaustion would not be an issue. However, NAT is just a mapping from an internal IP to an external Port number. With pure NAT, once you have created a connection to the outside, anyone can send packets to that external port, and have them delivered to your device. Of course, this mapping is inherently lossy. You are mapping the port space of one device onto N devices. This does mean external IPs can only send your devices packets on ports they have previously used as source ports, but you are still not safe. You might own devices that, for example, have vulnerabilities in their networking stack. Not that rare. You also might not want to disclose the number of devices active in a network, allow them to be fingerprinted by their response, or similar. Some UDP client applications might also not check the IP addresses of incoming packets. UDP server applications also commonly use the same socket for connections to other hosts as it listens on. So, to elaborate on that last example, you might run, say, a video surveillance server. It might listen for RTP on UDP port 12345. It then uses that same socket to send a UDP packet to licensecheck.example.com. That packet will have a source port of 12345. NAT will then map internal_ip:12345 to external_ip:xyz. Anyone can now view your cameras on external_ip:xyz. So either way, you'll want a stateful firewall. Deny incoming, allow outgoing. That's what firewalls are there for, and that's what gives you your security, NAT or no NAT.
- Dagger2 7y agoIf you have routing to the IP, then it's just a matter of: $ telnet <ip> <port> If you don't have routing, then you'll need to arrange it somehow. With the example addresses you gave, you could do it by being on your immediate upstream network and then running: $ ip route add 192.168.1.123/24 via 123.45.67.89 $ telnet 192.168.1.123 <port>
- JohnFen 7y ago> You need to be using a firewall. Indeed, I never said otherwise. What I'm saying is that I want to disallow all incoming connections to any machine that isn't in my yellow zone, and selectively forward some traffic to servers in my green zone. I can absolutely use router and firewall rules to accomplish that. But when I do, I've essentially implemented a NAT.
- msbarnett 7y agoThen you want a firewall whether or not you’re NATing. NAT is not a security measure. It offers you no blocking of incoming traffic. It has no inherent security value.
- umanwizard 7y agoHow does NAT not block incoming traffic? I'm genuinely confused. Let's assume my laptop is behind a typical home network NAT with public address 123.45.67.89 and internal address 192.168.1.123 . What sequence of commands do you type to send traffic to my laptop?
- crankylinuxuser 7y ago> How does NAT not block incoming traffic? https://samy.pl/pwnat/ https://samy.pl/pwnat/ NAT != firewall
- umanwizard 7y agoThis seems to require both ends to be running the pwnat software. Again, assuming I am not running any special software, what sequence of commands would you type to send a packet to 192.168.1.123 natted behind 123.45.67.89 ?
- crankylinuxuser 7y agoIt's indeed true, if in your contrived case, you have a VM doing nothing inside a NAT behind a public IP, you couldn't access it. https://tools.ietf.org/html/rfc2663 https://tools.ietf.org/html/rfc2663 might bee a good start to see where flaws are and how it works. And it's also a great way to see how a destination machine that you're talking with can puncture through your NAT, cause you did already. And Pwnat didn't strike you as "interesting" in that it could join 2 internal networks as if they were the same collision domain, but not really?
- deleted 7y ago
- paulddraper 7y agoI recommend a firewall in that case. NAT itself would only be security-through-obscurity.
- vpzom 7y agoIs that actually true? How would outside traffic get through a NAT?
- paulddraper 7y agoOutside traffic gets through a NAT all the time. Including HN, moments before reading this page. It's true that outside networks usually cannot send a TCP SYN to your local network without IP spoofing or other hackery. But a firewall is sufficient; there is no need for network address translation.
- zajio1am 7y agoNAT is not a barrier for traffic, so question 'how traffic get through a NAT' does not make sense. Router by default forwards packets. NAT just means that in some cases it also translates src/dst addresses of packets. If you have a router with NAT and without (stateful) firewall or RPF, and such router receives a packet on wan port with dst address from your private LAN range, then such packet is just passed to your LAN (as NAT does not apply here). Obviously, such packet is unroutable on general Internet, but could be send by our ISP or by other customers of your ISP if they are on the same network (e.g. wifi AP) as your wan port. There are also more sophisticated ways, like abusing automatic decapsulation of packets (if enabled). Fortunately, in most cases a router with NAT also has enabled stateful firewall, so this is moot.
- umanwizard 7y ago> Obviously, such packet is unroutable on general Internet You buried the lede here. This makes a huge difference. I am much more willing to trust my ISP (a major company who would be quickly found out if they were trying to hack random people) than the entire set of people on the global internet.
- tenebrisalietum 7y ago> I explicitly don't want any IP addresses in my green zone to be directly accessibly from my red zone. This is exactly what the job of a firewall is. NAT is a hack due to IP address exhaustion. Any security is a side effect. Nothing that says "NAT" on the tin is obligated to protect you. NAT on your own network if you really drink that kool-aid is fine. I'm more concerned about CGNAT. If ISPs implement NAT (called CGNAT), it means you can't accept incoming connections without your ISP approving/supporting it. I don't want to have to beg my ISP to open ports for me and question/approve why I'm doing it.
- JohnFen 7y ago> This is exactly what the job of a firewall is. Well, I agree (if you include the router in that). I never asserted otherwise. In fact, this is how I've implemented my NAT.