I had an argument with someone on IRC about Network Address Translation. I was under the impression that NAT provided a layer of security to internal networks. I understand that's not the primary purpose of NAT, nevertheless, I can't really see how I could be wrong about that. Anyway, I got laughed at and mocked over it but never really got a straight answer as to how or why I was wrong. So does NAT really provide security? Or not?
NAT is often misunderstood because in todays "office routers" there is as good as in every case a combination of NAT/PAT and a firewall which isn't the same. Also when you say NAT most people really mean NAT/PAT which is a combination of Network Address Translation and Port Address Translation.
This means that the router which is providing NAT/PAT functionality is able to map a specific port on the external network to a specific host on a specific port in the internal network. This can provide some extra security by lowering the attack surface of the servers that otherwise could be scanned and attacked directly. Of cause the forewarded services can be attacked anyway...