8 ms·
An Opinion in Defence of NATs
- lend000 9y agoImagine our current issues with poorly secured devices connected to the internet (with default creds, for example), and then compare that with all of the embedded devices secured behind a NAT. It's an important security layer.
- burnte 9y agoI completely agree. Without the external ability to directly contact nodes on the inside, an attacker has to either compromise the network hardware, or somehow deliver a software payload inside the network. It's not a silver bullet, but it does have a strong role protection.
- yorwba 9y agoYou don't need a NAT for that, it's a job for a firewall. You could have each poorly secured device with their own IP, but still not reachable from the outside.
- kikoreis 9y agoExcept NAT is dead simple, and requires basically zero configuration of the CPE from the end-user perspective. Yeah, it complicates (though seldom completely breaks) a host of important applications, but it's hard to think you could replace it with a firewall with an off the shelf configuration and have it work any better.
- ktRolster 9y agoIt's not dead simple, it just seems that way because the router already comes configured for it. If you had a router already configured with a default firewall, that would seem dead simple, too.
- Johnny555 9y agoAnd NAT is required for networks that are behind too few IPv4 IP's. With IPv6, users can put their devices out on the wild-west open internet without needing any kind of NAT or firewall for protection. The large number of open access points in the wild points out the danger here -- most consumers know nothing about network security and will set up their home network with dozens of IoT devices all on the public internet behind their ISP's non-firewalling router because they can, and everything works.
- mmagin 9y agoIt is unlikely that ISPs are going to provide CPE that doesn't firewall incoming connections by default, even if it issues devices on the LAN real public IPv6 addresses.
- Johnny555 9y agoAbout as unlikely as ISP's providing Wifi routers that default to open with no WPA password as used to be common? They'll do whatever makes support easiest until they are forced to do otherwise by regulation or bad press.
- mmagin 9y agoThe first (2010-vintage Apple Airport Extreme) and second (2017-vintage TP-Link something something) I'd done IPv6 with behaved this way by default if you enabled IPv6. I don't see why Comcast or AT&T would likely do worse. Sure they could, but this is not the likely scenario.
- Johnny555 9y agoThen I imagine you don't have much experience with Comcast or AT&T if you don't see why they'd do worse than Apple.
- alethiophile 9y agoThe default configuration for many firewalls (software, at least) approximates "allow all outgoing connections but no incoming". Assuming all your connections pass through the same box (which they usually will, for a home network), there's no reason why it shouldn't have such a firewall even if it's otherwise a router that doesn't do NAT. Denying the ISPs trivial inspection into the structure of home networks, OTOH, is a major benefit and maybe a concrete downside to adopting IPv6 locally.
- lend000 9y agoIt is the firewall. How many typical consumers have a dedicated firewall?
- slrz 9y agoAll those consumer gateway boxen that do NAT can also do firewalling. The ones supporting IPv6 even tend to present the same (or similar) UI for "create firewall allow rule" and "create static port/host mapping".
- lend000 9y agoI agree -- but they don't. Let's imagine that the Internet started with IPv6 and NAT never became the standard. How many legacy routers would there be floating around with no built-in firewall? How would that affect the security landscape? Everyone seems to misunderstand that I am not advocating for what should be/should have been, but instead providing the benefits of how things played out given the reality of the world.
- mnarayan01 9y agoThis view always seems to get crucified in these discussions. While it is certainly true that a NAT is neither necessary nor sufficient for the kind of protection provided by a properly configured firewall, it's way better than the realistic alternative in 90+% of the cases: "Literally nothing". Just think how many actual businesses got nailed by e.g. Mongo's former default of listening on all interfaces.
- slrz 9y agoMost IPv6-capable home gateway boxen seem to do the right thing automatically here.
- occultist_throw 9y agoThen I would encourage you to try this tool (0) and then respond with your updated opinions. Abstract: pwnat, pronounced "poe-nat", is a tool that allows any number of clients behind NATs to communicate with a server behind a separate NAT with *no* port forwarding *no* DMZ setup, and *no* 3rd party involvement. The server does not need to know anything about the clients trying to connect. (0) https://samy.pl/pwnat/ https://samy.pl/pwnat/
- alethiophile 9y agoThat is an awesome tool, but it requires a cooperating server inside your NAT; for security-breaching purposes, if you've got code execution on a machine inside the firewall, you've already won (against the firewall, anyway).
- occultist_throw 9y agoWell, indeed. But Im thinking that it could be done with a webapp and Websockets. In other words, get sent to a domain that initiates the knock sequence. Other machine in waiting responds, and NAT traversal takes over, to any machines inside NAT. The only real question is how much code is actually required to start this.
- alethiophile 9y agoWeb code is only allowed to send TCP packets (websockets go on port 80 by default, just like HTTP). It also doesn't allow crafting special packets. pwnat's method relies on being able to send ICMP and UDP, which the browser won't.
- occultist_throw 9y agoI didn't thank you for your response. I looked further in, and was mistaken - I thought that it allowed a bit more as in TCP and UDP. I was wrong. So yes, it looks like some sort of further in-depth hackery would be required, or planting some sort of SBC in the building on the network. It's quite a bit more infeasible than I had initially thought.
- yorwba 9y agoI guess what I don't like about NATs is the mandatory enforcement in consumer networks because ISPs still only hand out one IP. There's something wrong with the internet when two devices that want to talk to each other need to trick the NAT with a hole-punching server before they can communicate.
- SadWebDeveloper 9y ago> There's something wrong with the internet... When you need an 3rd-party provider to "get in" the internet. FTFY.
- alethiophile 9y agoHow would it ever work any other way? Someone needs to run the trunk lines, and you will always need to talk to these people to get yourself connected.
- wmf 9y agoThis is fixed in IPv6 although you still have to punch the hole due to the firewall.
- Avernar 9y agoBut you can open a large range of ports to multiple devices. For a game console you can allow UDP 1024-65535 without issue. And if you have multiple devices that use the same port you can open that port on each one. No need for an external server to look up what port the device can be reached on.
- jschwartzi 9y agoWell, this starts to break down when you consider that NAT means that an individual subscriber may only be able to open one connection at any one time.
- shimon 9y agoHow does NAT create this limitation? Maybe I'm confused by your use of "connection" here but a device behind NAT can handle multiple connections just fine, and the common techniques for poking through NAT are not limited to a single connection either.
- gerdesj 9y agoTry running two web servers behind a single IP address. For example you want to run your own email system with webmail and Nextcloud for file synchronisation. You want to secure them both with TLS. You have a single static IPv4 address (if you are lucky, otherwise you have to use a dynamic DNS service. So you have two things that both want to use 443/tcp on the same "external" IP address. Options: * Put one of them on a non standard port eg 8443 - rubbish but works (unless the app assumes and enforces 443 - some do) * Put in a proxy, eg HA Proxy - cool! it can be used to fix up TLS crapness and get you that A+ score on the SSL labs test but it can be tricky to set up * Get more IPv4 address space - RLY (for most of the world)? * IPv6 - generally statically assigned and you have billions of globally routable addresses to play with NAT creates a limitation inbound - in general outbound is fine unless you want to use SIP n RTP or FTP, in which case you may have to become a network engineer unless your router's ALGs work out of the box, if it has them, if they work correctly, if they don't actually break things. NAT adds a lot of complexity but it has become the norm.
- djrogers 9y agoFTA: "More address bits? Well perhaps not all that much. The space created by NATs operates from within a 96-bit vector of address and port components, and the usable space may well approach the equivalent of a 50-bit conventional address architecture. On the other hand, the IPv6 address architecture has stripped off some 64 bits for an interface identifier and conventionally uses a further 16 bits as a site identifier. The resulting space is of the order of 52 bits. It’s not clear that the two pools of address tokens are all that much different in size." Well, if you want to ignore the fact that IPv6 can utilize the same port combinations as IPv4, then your math works. If you actually compare apples to apples though, it's fundamentally flawed. That said, I happen to be a fan of NAT - just not for the reasons outlined here.
- sp332 9y agoIPv6 doesn't officially support NAT, so it's a stretch to include the port numbers as host identifiers the way IPv4 NAT can.
- SwellJoe 9y ago"the way IPv4 NAT must in order to be remotely usable on the modern internet" FTFY
- sp332 9y agoSure, but that's not really an excuse to use it for IPv6.
- gerdesj 9y agoNot sure what you are on about. IPv6 has Unique Local Addressing (RFC 42193) and Network Prefix Translation (RFC 6296). Care to guess what those do when combined? Now given that the smallest subnet in IPv6 is /64 then you are unlikely to need to bother with port mapping as well. I will grant you that putting 65000 odd IPs on a system may not be the most efficient way of doing things. Anyway at least you get a choice in the matter. Many problems with, for example, VoIP are fixed with symmetric NAT which falls out of this scheme right away. My problem with IPv6 is how you get "tied" to your initial ISP in an intimate way due to getting all your IP addressing from them. SLAAC does go a long way to fix this but it is a little like ISP assigned email addresses stopping people from moving away. Also, consider what happens when you have multiple internet connections perhaps for redundancy/backup. You actually need NPT to get that to work in any meaningful way unless you pay for private address space and take a deep dive into BGP etc.
- SadWebDeveloper 9y agoImagine the day everyone has an IPv6 and NAT has disappear from the map... that day will be like hacking in the 90's, like MS03-026 days or even worst, it will definitely be a disaster waiting to happen for the network engineers and CISO's worldwide.
- solotronics 9y agonot sure if thats true, its hard to find things on IPv6 currently. Is there any practical way to scan IPv6 ranges? its so large you cant really NMAP scan around
- SadWebDeveloper 9y agohttps://news.ycombinator.com/item?id=8804629 https://news.ycombinator.com/item?id=8804629 There is no tool yet available but with IPv6 numbers going up it just matter of time before it become a necessity.
- gerdesj 9y agoIPv6 is not IPv4 (FFS.) Read up on multicast. Do you actually have any experience of IPv6?
- SadWebDeveloper 9y agoDo you actually have any experience scanning for devices on the internet? or have a proper argument rather than "learn multicast"?... so many salty net-engies on the internet, IPv6 will bring an era of chaos with every "IOT device" not being well configured and allow external access or don't have a firewall built-in.
- bb88 9y agoIsn't the entire point of having 264 address space is to make it hard to scan? Basically you're looking for a needle in a haystack.
- nikanj 9y agoMore than once, I've fixed connectivity problems by disabling IPv6. Never have I ever fixed connectivity problems by enabling IPv6. I wonder if this will ever change.
- solotronics 9y agoroutinely as a network engineer if a network device is offline on IPv4 we can access via IPv6 before trying out of band
- gerdesj 9y agoI'm with you mate. However, disabling something that you don't understand and is enabled by default on a system for which it probably wont work fully anyway isn't too bad an approach. That said, I will be using IPv6 to route around the sheer naffness of 192.168.0|1 at customer sites. Quite a few businesses have a networking legacy, shall we say. I currently use OpenVPN and a 1:1 NAT (see https://doc.pfsense.org/index.php/OpenVPN_NAT_subnets_with_same_IP_range https://doc.pfsense.org/index.php/OpenVPN_NAT_subnets_with_s...) With IPv6 and a little DNS work I can make routing work again - smashing!
- squozzer 9y agoI think what makes NATs a bit heterodox to internet ethos is that they insert an element of hierarchy to a concept that was originally preached as egalitarian. So do routers, but the extent of their manipulation is merely to ensure a packet reaches its desired destination. NATs act more aggressively.
- rconti 9y agoBut isn't a centrally-dictated RFC on IPv6 returning us to the dare-I-say-hierarchical days of IP address allocation also a problem? As TFA points out, CIDR+NAT has decoupled true endpoints from hierarchy, and its adoption was ad-hoc and cooperative ('egalitarian') rather than dictated.
- wmf 9y agoWait, so having fewer IPs than devices is freedom and having more IPs than devices is a form of oppression? I'm so confused.
- topspin 9y agofreedom vs oppression....... That is the sort of mentality that has always toxified this whole matter. This is an engineering issue. NAT wasn't created to enslave anyone. The author isn't arguing in favor of NAT. Only that NAT is much more than an address scarcity kludge and is actually an expression of real requirements that neither IPv4 and IPv6 can address well sans NAT. The concept of a fixed, routable, global address number is possibly naive considering mobile hosts, privacy, multi-homing, security and other issues. Maximum liberty may be to decouple routing from any particular routing number scheme. It's impossible to discuss any of this rationally; the anti-NAT camp has its dogma and can't be engaged. Two decades of this myopia headed into three...
- silotis 9y ago> the applications that they value, appear to operate perfectly well in a NATed environment The key word here is "appear". There are two main factors which maintain this appearance: 1. Any technology which does not play well with NAT is guaranteed to be DOA with respect to the consumer market, so few resources get spent on them. This is a classic chicken and egg problem. 2. A tremendous ongoing effort by network device and application developers to implement whatever kludges are necessary to keep their products working with NAT. Both of these costs are largely hidden from consumers, so of course there is little outcry about them. That doesn't mean the world wouldn't be much better off if NAT went away.
- drzaiusapelord 9y agoOr worse, NAT unfriendly technologies end up adopted but bring in technical issues constantly. Look at how many SIP or VOIP forum questions end up with hard to diagnose issues eventually being found out to be NAT issues. Or the firewall rules to get 'simple' FTP to work in a NAT environment, even with passive mode. Or just how much time is wasted in general wrestling NAT.
- gerdesj 9y agoWelcome to my world mate. However, I happily have recipes that will make all of those things work - IPv4 and IPv6. However, as you say - a lot of time was lost making things work that should not be too tricky.
- starsinspace 9y agoThe advent of NAT in home routers killed so many useful applications. Things like sending a file to someone in a peer-to-peer fashion, without middlemen, used to just work in the 90s. Then came NAT, and everything broke. I wonder if the centralized internet we have today - where information sharing between people usually involves large server farms run by big corporations - would have happened without NAT. Maybe, without NAT, people would have just stuck with the old way of doing things. Why involve a third party when you can just connect directly? NAT made it easy for the centralized services to take over. When NAT came, all the good p2p apps of the 90s and early 00s either ceased working completely, or at least became unreliable (applications were then trying all kinds of tricks for NAT traversal, but it was often slow or failed). The generally overly complex configuration for port-forwarding on routers didn't help either - if you ever tried to walk someone through setting it up back then via chat or telephone, you'll know what I mean... With a clean slate like that, with the vacuum that was created, the centralized services could just walk in. Simply because they worked. Together with all the user tracking and surveillance that came with it.
- pc2g4d 9y agoSo NAT is virtuous because it (in effect) expands the address space and makes address assignment (partly) dynamic (because the above-32-bit address components are assigned at connection time). But I think the article is ignorant of the real problems that NAT traversal cause in many situations. Yes, we have a system that largely works. But that in itself doesn't prove the current system is equivalent to the IPv6 alternative. In fact, there are good reasons to believe an IPv6 world will make the Internet significantly more dynamic and peer-to-peer friendly.
- gerdesj 9y agoTry putting in multiple internet connections each with its own IPv6 space! I have five at work but cannot really afford PI addressing (say £3000 per year) and certainly would not be able to get the four FTTC (VDSL) ISPs to route it. I also have a 100Mb leased line with yet another /56 prefix. That's five of the bloody things. Each PC/server/printer/whatever now has at least five globally unique IPv6 addresses. Now most of those devices also want to do various versions of each prefix - an algorithmic ally derived on based on MAC address, a randomish one (for privacy) etc. Add in link local and perhaps a few DHCPv6 addresses for good measure and it rapidly gets quite complicated. Now how does that lot get to and from the internet? For a PC to get to a web server it has to use the correct "local" address to get to the other end via the relevant ISP connection. However the PC can't know which internet connections are working without some form of routing protocol telling it what is going on upstream. So all my PCs, servers, printers and even IP cameras need to be routers rather than simply having a default gateway! As you can probably guess, that is not what I will actually do when I flick the IPv6 switch for real at work (home has been dual stack with one link for several years now). My current plan is ULA (a bit like IPv4 RFC 1918 - 192.168., 172.16. 10.) with Network Prefix Translation. That way my DNS servers, AD DCs (I think of those merely as KDCs but apparently they do other jobs) and other handy things wont renumber themselves every time a link goes down. The real joy of all this is I'll also get to manage two lots of firewall rules per VLAN. Can you imagine how busy a DNS server would get in the event of a flapping internet connection if it had to do dynamic DNS updates? Don't get hung up over NAT, the world of fully tooled up IPv6 is going to be far more "interesting", especially when you are not a big institution with a huge budget but want a bit more connectivity than one ISP connection provides.