02Chapter 2: Ports, sockets, and identifying a connectionThis chapter assumes you know IPv4 addresses and subnet masks, what a default gateway does, and the basics of TCP and UDP. It covers how a host tells connections apart. NAT depends on this, because a NAT device rewrites exactly these identifying fields.2 min read
03Chapter 3: What NAT changes in a packetThis chapter assumes you know IPv4 addresses and subnet masks, what a default gateway does, and how TCP and UDP use port numbers. It builds on the idea that private addresses cannot be routed on the internet.2 min read
04Chapter 4: How the NAT device remembers connectionsThis chapter assumes you know IPv4 addressing, what a default gateway does, and how TCP and UDP use port numbers. It also assumes you can run commands in a Linux shell.3 min read
05Chapter 5: Many hosts, one public address: source NAT and PATThis chapter assumes you know IPv4 subnets, what a default gateway does, and how TCP and UDP use port numbers. It also assumes you can run commands in a Linux shell. Earlier chapters covered the 5-tuple and the translation table. This chapter shows how they combine to let many private hosts share on3 min read
06Chapter 6: Static one-to-one NATThis chapter assumes you know IPv4 addressing and subnet masks, what a default gateway does, and how TCP and UDP ports work. It also assumes you have read how NAT rewrites packets and how the translation table works. Static NAT is the simplest NAT mode.2 min read
07Chapter 7: Port forwarding: reaching a private service from outsideThis chapter assumes you know IPv4 addressing, what a default gateway does, how TCP ports work, and how source NAT and the translation table work from earlier chapters. You should also be comfortable in a Linux shell.2 min read
08Chapter 8: Hands-on: masquerading and port forwarding on LinuxThis chapter assumes you know IPv4 subnets, what a default gateway does, how TCP and UDP ports work, and how to run commands in a Linux shell. It also assumes you have read the earlier chapters on source NAT, PAT, and port forwarding. Here you configure them on a Linux gateway.2 min read
10Chapter 10: Troubleshooting port forwardingThis chapter assumes you know IPv4 addressing, what a default gateway does, TCP and UDP ports, and basic Linux shell use. It also assumes you have read the earlier chapters on the translation table, DNAT, and hairpin NAT. A port forward fails in one of a few predictable places. The fastest fix is to3 min read
11Chapter 11: Why some protocols break behind NATThis chapter assumes you know how NAT rewrites addresses and ports, how the translation table (connection tracking) works, and the basics of TCP, UDP, and IP headers. It explains why a few protocols fail through NAT, and how NAT helpers and protocol design work around that.3 min read
12Chapter 12: NAT mapping and filtering behaviorsThis chapter assumes you know how a NAT device keeps a translation table and how PAT rewrites source addresses and ports. Here we look at two separate decisions a NAT makes: how it picks an external address and port for an outbound flow (mapping), and which inbound packets it lets through that mappi3 min read
13Chapter 13: Getting through NAT: UPnP, STUN, hole punching, and relaysThis chapter assumes you know how a NAT device keeps a translation table, the difference between source NAT and port forwarding, and the basics of UDP and TCP ports. Here you will see how two hosts that both sit behind NAT can still reach each other.3 min read
14Chapter 14: Carrier-grade NAT and why port forwarding may not workThis chapter assumes you know private IPv4 ranges, how source NAT and port address translation (PAT) work, and how a port forward is configured on a home router. Here you will see why a correct port forward can still fail when your internet provider adds a second layer of NAT.3 min read
15Chapter 15: NAT and IPv6This chapter assumes you know how source NAT, port address translation (PAT), and port forwarding work. It also assumes you know what carrier-grade NAT (CGNAT) is and can read basic iptables rules.3 min read