Hasty Briefsbeta

Bilingual

Grokking NAT and packet mangling in Linux

a year ago
  • #IPv4
  • #Networking
  • #NAT
  • All devices on a Wi-Fi network share the same public IPv4 address provided by the ISP.
  • IPv4 addresses are limited to ~4 billion unique addresses, leading to potential shortages.
  • IPv6 offers a vastly larger address space (2^128 addresses) but requires global adoption.
  • Network Address Translation (NAT) was introduced as a short-term solution to IPv4 limitations.
  • NAT allows multiple devices on a private network to share a single public IP address.
  • Port Address Translation (PAT) extends NAT by using different ports to identify devices.
  • Different types of NAT (e.g., Full Cone, Restricted Cone, Port-Restricted Cone, Symmetric) have varying restrictions.
  • NAT modifies packet headers, including IP addresses, ports, and checksums, to route traffic correctly.
  • Docker and other technologies rely on NAT for container networking.
  • NAT is not a perfect solution and has limitations, but IPv6 adoption is slow.