Octet

Which protocols have trouble with NAT, and why?

Show the answer

Say this first

Protocols that carry addresses or ports inside the payload, and protocols with no ports at all. FTP puts addresses in its PORT and PASV commands. SIP and SDP carry the RTP media address. IPsec AH protects the IP header, so any rewrite breaks it, and ESP has no ports for PAT to use. NAT devices patch some of this with application layer gateways (ALGs), IPsec uses NAT traversal over UDP 4500, and VoIP usually relies on STUN, TURN and ICE or a session border controller.

Go deeper

ProtocolProblemUsual fix
FTP activeclient sends PORT with its private address, server connects back to itFTP ALG, or passive mode
FTP passive, server behind NATthe PASV reply carries the server's private addressALG, or tell the server its public address
SIPSDP carries the private RTP address and portSBC, STUN, TURN, ICE; ALGs often make it worse
IPsec AHintegrity check covers the IP addressescannot be NATed, use ESP
IPsec ESPno ports, PAT cannot tell flows apartNAT-T, ESP wrapped in UDP 4500
PPTPGRE with no portsALG, though PPTP itself is obsolete
Inbound peer to peerno mapping existsport forwarding, UPnP or PCP, hole punching

ALGs on IOS

IOS NAT inspects and rewrites FTP, SIP and other protocols by default. Voice providers often ask you to turn the SIP ALG off because it mangles messages their SBC already handles:

Cisco IOS
no ip nat service sip udp port 5060
no ip nat service sip tcp port 5060

Timers

Quiet UDP flows lose their mapping when the NAT UDP timer expires (300 seconds on IOS, often less on consumer routers). Keepalives from the endpoints keep mappings alive.

Traps

  • Saying IPsec cannot work through NAT. ESP with NAT-T works; only AH cannot.
How did you do?Book 3.3 Internet (IP)Book 8.5 Example Systems