Address translation
NAT mapping and filtering
Whether a NAT keeps one public port per inside port (friendly to peer-to-peer) or picks one per destination.
RFC 4787 describes NATs by two behaviours. Mapping: endpoint-independent (the same public port whatever
the destination, what hole punching needs) or endpoint-dependent, the "symmetric NAT" of carriers and some corporate
firewalls. Filtering: who may send in on a mapping, anyone or only those the inside has sent to. Linux MASQUERADE
maps endpoint-independently and keeps the inside port when it is free; --random-fully makes it symmetric. In a
lab file, routing.natMapping picks one.
Read next
- NAT A router rewriting addresses as packets pass, usually to hide many private devices behind one address.
- UDP hole punching Two peers behind NAT sending to each other at once, so each router takes the other's packets for replies.
- STUN A server that tells a device behind NAT the public address and port its packets arrive from.
- Static NAT, dynamic NAT and PAT One address for one device (static), addresses from a pool as devices go out (dynamic), or one address shared by port (PAT).
- NAT traversal Getting traffic through NAT: wrapping protocols in UDP, whose ports NAT can map, and punching holes between peers.