Skip to content
uencoder

SNAT

SNAT (Source NAT) rewrites a packet's source address, typically changing the internal source IP to a public IP on outbound traffic.

Purpose

It rewrites the internal source address of outbound traffic to a public one so that replies can find their way back.

Mechanism

As an outbound packet crosses the SNAT device, its source IP/port is rewritten to public values and the mapping is recorded. Inbound replies restore the internal destination per the mapping. Linux implements this with iptables SNAT --to-source.

Use cases

  • Egress NAT for internal networks
  • Load balancer source addressing
  • Cloud networks

Related tools

References