[Day 11] 3. Static NAT
In Static NAT, there is a one-to-one mapping between a private IP address (inside local) and a public IP address (inside global). This mapping is manually configured and stays constant. It is typically used when you want a specific internal device (e.g., a web server) to always be reachable via a fixed public IP.
Key Terms:
- Inside Local IP Address: The private IP address of the internal device inside the local network (e.g., ).
172.16.10.2 - Inside Global IP Address: The public IP address used to represent the internal device to the outside world (e.g., ).
202.208.220.2 - Outside Global IP Address: The public IP address of external devices or hosts on the internet.
How Static NAT Works?
-
Define Interfaces:
- The inside interface is the internal network facing interface (connected to your local network).
- The outside interface is the external network facing interface (connected to the internet or external network).
A(config)#int g0/0A(config-if)#ip nat inside- In this command, is the internal (inside) interface connected to the private network.
g0/0
A(config)#int g0/1A(config-if)#ip nat outside- In this command, is the external (outside) interface connected to the public network (internet).
g0/1
-
Static NAT Mapping:
- You statically map each private IP address to a corresponding public IP address using the command.
ip nat inside source static
A(config)#ip nat inside source static 172.16.10.2 202.208.220.2A(config)#ip nat inside source static 172.16.10.3 202.208.220.3A(config)#ip nat inside source static 172.16.10.4 202.208.220.4- In these commands:
- ,
172.16.10.2, and172.16.10.3are inside local IP addresses (private IPs).172.16.10.4 - ,
202.208.220.2, and202.208.220.3are inside global IP addresses (public IPs).202.208.220.4
- You statically map each private IP address to a corresponding public IP address using the
These static mappings allow external devices to access the internal private devices through fixed public IPs. For example, traffic to
202.208.220.2172.16.10.2NAT Table
The router will maintain a NAT table that records these mappings. For static NAT, it will look like this:
|Inside Local|Inside Global| |---|---| |172.16.10.2|202.208.220.2| |172.16.10.3|202.208.220.3| |172.16.10.4|202.208.220.4|
This table allows the router to translate incoming traffic destined for a public IP (Inside Global) to the correct private IP (Inside Local), and vice versa for outgoing traffic.
Something Extra
- Static NAT does make a machine more visible and accessible to the outside world, which can increase exposure to attacks. However, this doesn't automatically make it "easy to hack" without considering the security measures in place.
- Static NAT does make a machine globally reachable, which is useful for certain types of servers.
- Remember that and
ip nat insidecommands are mandatory to use.ip nat outside
Read Next
[Day 11] 4. Dynamic NAT
In **Dynamic NAT**, there is a **many-to-many mapping** between private IP addresses and a pool of public IP addresses. Unlike static NAT, where a spe...
[Day 11] 5. Dynamic NAT with Overload
**Definition:** Dynamic NAT with overload, also known as **Port Address Translation (PAT)**, allows multiple internal IP addresses to share a single...