Field notes. Opinion marked as opinion. Short version: NAT is an addressing trick that happens to block some unsolicited traffic. If your security design leans on it, fix the design.
What NAT is for
IPv4 has about 4.3 billion addresses. Not enough for every device on earth. The workaround: private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, defined in RFC 1918) that anyone can use inside their own network but that are not routed on the public internet. Your office has 400 laptops on private addresses. One device at the edge, the router or firewall, rewrites outgoing packets so they carry a single public address, and remembers who asked for what so replies go back to the right laptop. That is NAT. The most common form, many-to-one with port rewriting, is often called PAT or masquerading.
Notice the design goal: save addresses. Security was never in the requirements.
Why it looks like protection
A packet arriving from the internet at your public address, with no matching entry in the translation table, has nowhere to go. The router drops it. So a stranger cannot simply open a connection to laptop number 217. Side effect, useful, real.
Also useful: outsiders see one address, not your internal layout. Mild obscurity. It slows casual mapping of your network.
Where the belief breaks
- Outbound connections are untouched. NAT lets any internal host start a conversation outwards. Malware on a laptop phones home through NAT without friction. NAT has no opinion about where traffic goes or what it contains.
- Port forwards punch holes. To host a service you map a public port to an internal machine. That mapping is an open door. Whatever vulnerabilities that server has are now reachable. Many compromised cameras and test servers got there because someone added “temporary” forwarding.
- The attacker is often already inside. A phishing click gives someone a foothold on an internal machine. NAT does nothing for traffic between internal hosts.
- Some applications make NAT open things automatically. UPnP lets software on a LAN ask the router to create forwards. Convenient for games, unwelcome in offices. Disable it on corporate edges.
- Replies can be abused. Stateful translation depends on tracking connections. Certain protocols and helper features (application-layer gateways) have had flaws over the years. Complexity is attack surface.
My view: the “NAT protects us” assumption is dangerous mainly because it stops people asking the next question, which is “what actually controls what flows?”
The firewall is a separate job
A firewall is a policy engine. It states which source may reach which destination on which service, in which direction, and it logs the decision. NAT is a rewriting engine. They usually live in the same box, which is why people blur them. But you can have either without the other.
| Question | NAT | Firewall |
|---|---|---|
| Primary purpose | Share and conserve addresses | Allow or deny traffic by policy |
| Controls outbound destinations | No | Yes, if rules say so |
| Creates logs of denied attempts | Not normally | Yes |
| Needed if every device has a public address | No | Still yes |
What about IPv6
IPv6 has enough addresses that every device can have a globally routable one, so address-sharing NAT is generally unnecessary. This alarms some people: “everything is exposed!” It is not, provided a stateful firewall sits at the edge with a default rule that blocks unsolicited inbound connections. Same protection people credited to NAT, delivered by the thing that was always responsible. Home routers that support IPv6 typically ship with that kind of default; check, do not assume, on business equipment.
Translation features for IPv6 exist but serve other purposes, such as connecting IPv6-only networks to IPv4 services.
Practical checklist
- List every port forward on the edge device. Ask the owner of each one why it exists. Remove what nobody can justify.
- Switch off UPnP on business networks.
- Write explicit allow rules for outbound traffic where feasible; default allow-all outbound is how command-and-control channels survive.
- Use one public address in logs wisely: when many users share it, investigations need the NAT translation logs with timestamps to say which internal host made a connection. Keep them for the period your policy or regulation requires.
- Segment internally. NAT at the boundary says nothing about movement inside.
One more point on item 4. Carrier-grade NAT, used by many Indian mobile and broadband providers, puts thousands of customers behind one public IP. If a service blocks or flags an address, innocent users share the consequences, and attributing activity to one person needs the provider’s records with port and time details. This is one reason investigators ask for precise timestamps.
Keep NAT for what it does well. Let the firewall do the deciding.
Leave a Reply