Guide
Subnetting and Address Translation
Subnetting divides address space into prefixes with deliberate boundaries. Translation changes addresses or ports while forwarding traffic. VLANs separate Layer 2 broadcast domains; IP subnets and firewall policies define different boundaries. These mechanisms can work together, but they do not provide the same isolation guarantees.
Meaning and purpose
Subnetting divides address space into prefixes with deliberate boundaries. Translation changes addresses or ports while forwarding traffic. VLANs separate Layer 2 broadcast domains; IP subnets and firewall policies define different boundaries. These mechanisms can work together, but they do not provide the same isolation guarantees.
How it works in context
SNAT changes a packet’s source and DNAT changes its destination. PAT multiplexes connections using ports. The translator maintains state so replies can return to the original endpoint. CGNAT adds sharing inside a provider network. A forwarded port also needs a listening application, a route and an allowing firewall rule.
Technical terms in this section
CIDR blocks
CIDR blocks describe aligned address ranges through a network address and prefix length.
Prefix lengths
A prefix length controls address-range size and specificity in destination matching.
Network segmentation
Segmentation separates network groups and enforces controlled communication between them.
VLANs
VLANs divide Layer 2 broadcast domains across a shared switching infrastructure.
VLSM
VLSM allocates differently sized subnets within an address plan using variable prefix lengths.
NAT
NAT rewrites network addresses and maintains mappings needed for return traffic.
PAT
PAT multiplexes internal flows onto shared external addresses by translating transport ports.
SNAT
SNAT changes packet source addresses, often at an internal network’s egress boundary.
DNAT
DNAT changes a packet’s destination to direct traffic toward another endpoint.
CGNAT
Carrier-grade NAT shares public addresses across subscribers; attribution can require timestamps and ports.
NAT traversal
NAT traversal uses mapping discovery, coordinated connectivity or relays to connect translated endpoints.
Port forwarding
Port forwarding directs incoming destination traffic to a configured service behind translation or routing.
Hairpin NAT
Hairpin NAT lets an internal client reach an internal service through its external mapping.
IPv4 subnet calculators
IPv4 calculators derive prefix boundaries; host-use rules vary for conventional, point-to-point and host prefixes.
IPv6 subnet calculators
IPv6 calculators derive 128-bit prefix ranges without applying IPv4 broadcast-address assumptions.
Operational checks and security
Check both directions and identify where translation happens. Overlapping private networks and asymmetric routing can break stateful translation. NAT is not a substitute for an explicit security policy, and a public source address alone may not identify a subscriber behind CGNAT.
Read-only example
These commands inspect the surrounding system or protocol. They do not automatically change its configuration or establish every property of this term. Replace example targets only with destinations you are authorized to inspect.
ip route show
# Review translation rules read-only on a system you administer
sudo nft list ruleset
Sources and further reading
These explanations are educational. Implementations, policies and standards evolve; check the current specification and software version before changing a system.