Skip to content
עברית

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.

Zaltzman.net · Your choice

Privacy preferences

Choose whether to link returning visits and remember display settings. Public content remains available without optional cookies.

Essential cookies

Always on

Secure forms, login sessions and your privacy choice.

What is included?

Session and CSRF protection, your privacy choice for up to 180 days, and Cloudflare security services. These do not authorise optional visitor analytics.

Analytics & returning visits

Store page history, visit times, IP and approximate location under one browser identifier, including return visits after an IP change.

How is this information used?

Authorised administrators use the history to understand usage and improve the site. No targeted ads, keystroke recording or fingerprinting. Turning this off deletes the history linked to your current identifier from the active database.

Remember display preferences

Save text size, contrast and other accessibility choices locally for your next visit.

Download my browser history

Turning analytics off deletes the current history and stops new collection.

Website operator: The Zaltzman Family
[email protected]

Zaltzman.net · Display settings

Accessibility tools

Adjust reading and navigation to suit you. Analytics consent is not required.

Text size
100%