Introduction to NAT
Network Address Translation (NAT) is a fundamental concept in networking that allows private devices to share a single public IP address. While the basic explanation is that it lets private devices use a single public IP, NAT offers much more complexity. This guide will explore the intricacies of NAT, including connection tracking, upstream filtering, and reflection rules.
NAT in Action
To better understand NAT, Gregory Gibson set up a Windows 11 Virtual Machine (VM) behind an OpenWRT router and sent its traffic through VMware NAT. The internet saw a public IPv4 address, but the test revealed four more addresses and a working port forward that vanished upstream. The lab exposed two more addresses between the private and public addresses, giving a total of four IPv4 addresses along the route.
Address Translation and Filtering
Before this exploration, Gregory thought of NAT in terms of two addresses: private IP addresses that belonged to devices within his network and a public IP address that websites could see. The Windows VM sent each internet connection to its default gateway, which in this case was OpenWRT's 192. Here, NAT applied a form of source NAT called masquerading, which replaced a packet's private source address with the outgoing interface's current address. As traffic crossed the router, its source was changed from 192. In the virtual environment, VMware translated the traffic before sending it to the next router, but this wasn't the final NAT boundary. The ISP's upstream Carrier-Grade NAT added multiple subscriber connections to share public IPv4 addresses, resulting in a single public IP address for multiple connections.
NAT and Firewall Separation
Modern consumer routers often combine NAT and firewall features under a single menu labeled "," which can lead to confusion. OpenWRT, an open-source router operating system, separates NAT and firewall features, providing deeper control over routing, firewall rules, DHCP, DNS, traffic shaping, and package-based features. In this setup, the WAN zone had masquerading enabled by default, while the input and forward policies were set to reject. This separation allows for more granular control over NAT and firewall settings.
Conclusion
Understanding NAT is crucial for managing network traffic and security. By exploring the nuances of NAT, including connection tracking, upstream filtering, and reflection rules, this guide provides a comprehensive understanding of the technology. Separating NAT and firewall features in OpenWRT offers deeper control and a clearer understanding of the underlying processes.

Comments