Watch on Instagram

Network Bytes · Episode 100 · CCNA 4.1

"Static NAT"

Normal NAT, or PAT, lets many devices share one public address but blocks connections that start outside. Static NAT permanently maps one private address to one public address, both ways, so the internet can reach a server, configured on Cisco with ip nat inside source static.

Posted · About a 1 minute watch, 4 minute read · Take the quiz

Why normal NAT keeps strangers out

Most networks use PAT (Port Address Translation, also called NAT overload): many inside devices share one public address, and the router tells their conversations apart by port number. When a laptop starts a connection, the router writes a translation entry, so the reply finds its way back in. But when a stranger on the internet tries to start a connection, there is no entry, and the router has no idea which inside device it is for. That's great for laptops, and a problem for a web server that the world needs to reach.

The office phone system

Think of an office phone system. Everyone shares the main number for outgoing calls, and incoming calls to it can't ring a desk directly. But one desk gets a direct line: its own number that always rings that desk. Static NAT is the direct line for your server.

One private address ↔ one public address, permanently

With static NAT, you tell the router that an inside local address (the server's private address, for example 192.168.1.10) always maps to one inside global address (a public address, for example 203.0.113.10). The entry is permanent, so it exists before any traffic flows:

  • Outbound: traffic from 192.168.1.10 leaves as 203.0.113.10.
  • Inbound: a connection from the internet to 203.0.113.10 is translated to 192.168.1.10 and reaches the server.

That public address belongs to the server alone; it is not shared with the PAT devices.

Configuring it on a Cisco router

`` R1(config)# ip nat inside source static 192.168.1.10 203.0.113.10 R1(config)# interface g0/0 R1(config-if)# ip nat inside R1(config)# interface g0/1 R1(config-if)# ip nat outside ``

The private address comes first, then the public one. NAT only works once you mark which interface faces your network (ip nat inside) and which faces the internet (ip nat outside). Check it with show ip nat translations: a static entry is listed even when no traffic is flowing.

Pair it with a firewall

Static NAT translates; it doesn't filter. Every port on that public address now leads to the server, so let a firewall or an ACL decide which traffic gets in, for example allow HTTPS on port 443 and drop everything else.

Try it yourself

In Cisco Packet Tracer, build a router with one inside network holding a PC and a server, and one outside network holding a "web client" PC. Configure ip nat inside source static for the server only, mark the inside and outside interfaces, and try to open the server's web page from the outside PC using its public address. Then try to reach the inside PC from outside: it fails, because it has no static entry. Run show ip nat translations before and after.

Good to know

  • CCNA 4.1 covers configuring and verifying inside source NAT using static and pools (EP50 covers NAT and PAT).
  • Static NAT is a permanent one-to-one mapping between an inside local and an inside global address. Because the entry always exists, connections can start from either side, which is why it is used for servers that must be reachable from the internet.
  • Cisco IOS: ip nat inside source static <inside-local> <inside-global>, plus ip nat inside and ip nat outside on the interfaces.
  • Static PAT (port forwarding, for example ip nat inside source static tcp ... 80 ... 80) can share one public address among several servers by port, and dynamic NAT with a pool is the other CCNA case (both left out of the short).
  • Static NAT on its own does not filter traffic, so a firewall or ACL should limit what reaches the server (EP76 covers firewalls).
  • The example addresses are private (RFC 1918) and documentation (RFC 5737, 203.0.113.0/24) addresses.
  • "Office phone direct line" is the analogy.

For CCNA learners

CCNA exam topic 4.1 covers configuring and verifying inside source NAT. Know that static NAT is a permanent one-to-one, two-way mapping, the order of addresses in ip nat inside source static, why ip nat inside and ip nat outside are needed, and how it differs from PAT.

Answer to the comment question

3. With plain one-to-one static NAT, each of the two servers needs its own public address (2), and all fifty laptops share one more address with PAT (1), so 2 + 1 = 3 public addresses in total.

Test your knowledge

Quick quiz: "Static NAT"

4 multiple-choice questions. Pick one answer for each, then check how you did.

1Why can't an outside host start a connection to a laptop behind normal PAT?
2What does static NAT create?
3In ip nat inside source static 192.168.1.10 203.0.113.10, what is 192.168.1.10?
4Why should you still use a firewall in front of a server with static NAT?

Sources

Video transcript

If NAT hides your network, how does the internet reach your web server?

Normal NAT, or PAT, lets many devices share one public address. Replies get in, but strangers can't start a connection.

Think of an office phone system: everyone shares the main number, but one desk gets a direct line.

That's static NAT: one private address mapped to one public address, permanently. It works both ways, so outsiders can reach that server.

On a Cisco router: ip nat inside source static, the private address, then the public one.

Use it for servers, and let a firewall decide which traffic gets in.

Two servers get static NAT, and fifty laptops share one more address with PAT. How many public addresses in total? Comment your answer below!

That's your byte.

More from Network Bytes

All Network Bytes lessons