$linuxjunkies
>

NAT loopback

also: hairpinning, NAT reflection, loopback NAT

NAT loopback is the ability for a device on a local network to access another device on the same network using the network's external (public) IP address and port forwarding rules, rather than its internal IP address.

NAT loopback, also called hairpinning or NAT reflection, solves a common problem: when you set up port forwarding on your router to access a service from the internet, devices inside your local network cannot reach that same service using the router's external IP address. Without NAT loopback, the router simply rejects the traffic.

For example, if your web server runs on 192.168.1.10:8080 internally, and you port-forward the router's external IP 203.0.113.5:8080 to reach it, a computer on your LAN would need to use the internal address. With NAT loopback enabled, it can use 203.0.113.5:8080 instead—the router intelligently redirects the traffic back to the internal address.

This feature must be explicitly enabled on most routers and Linux NAT implementations. On Linux systems using iptables or nftables, loopback is configured through masquerading rules that handle both outbound and inbound reflection of traffic.

Related terms