Translates

How to say it in other languages, and what words mean

Spanish

NAT Overload PAT Setup on Cisco Routers

· 5 min read · Spanish

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Network Address Translation (NAT) Overload, also known as Port Address Translation (PAT), lets many internal devices share a single public IP address by mapping each connection to a unique TCP/UDP port. This is the standard way home and small office routers provide internet access to multiple devices. On Cisco IOS routers, you configure it in a few steps using an access list and a NAT statement. This guide walks you through the exact commands, common pitfalls, and troubleshooting tips.

What You'll Need

  • A Cisco router running IOS (any modern version works).
  • Console or SSH access with privileged EXEC mode (enable).
  • At least one public IP address on the outside interface (usually a serial or Ethernet WAN port).
  • Internal network addressing (e.g., 192.168.1.0/24) already configured.
  • Basic understanding of Cisco IOS command-line interface (CLI).

Step-by-Step

  1. Access global configuration mode. Type enable and enter your password, then configure terminal.
  2. Identify inside and outside interfaces. Decide which interface connects to your internal LAN (inside) and which to the internet (outside). Typically, GigabitEthernet0/0 is inside, and GigabitEthernet0/1 or Serial0/0/0 is outside.
  3. Define an access list that matches your internal network. This list tells the router which source addresses to translate. For a standard 192.168.1.0/24 network, use:
    access-list 1 permit 192.168.1.0 0.0.0.255
    You can use a named access list or a numbered one; standard lists (1-99) are typical.
  4. Mark the inside interface. Enter interface configuration mode for your LAN interface, e.g., interface GigabitEthernet0/0, then issue:
    ip nat inside
    Exit with exit.
  5. Mark the outside interface. Enter configuration mode for your WAN interface, e.g., interface GigabitEthernet0/1, and issue:
    ip nat outside
    Exit back to global config.
  6. Create the NAT overload statement. In global configuration mode, enter:
    ip nat inside source list 1 interface GigabitEthernet0/1 overload
    Replace GigabitEthernet0/1 with your actual outside interface name. The keyword overload enables PAT, allowing many internal IPs to share the single public IP of that interface.
  7. Verify your configuration. Exit to privileged mode with end, then run show ip nat translations to see active mappings. Also test from an internal host by pinging an external IP.
  8. Save the configuration. Use write memory or copy running-config startup-config to make it persistent across reboots.

Common Mistakes

  • Forgetting to mark both interfaces. If you only set ip nat inside or ip nat outside, NAT will not work at all.
  • Using the wrong access list. The ACL must permit the source IPs you want to translate. If it permits everything (e.g., permit any), it may translate traffic you didn't intend, but often it's too restrictive and blocks translation.
  • Mixing up inside and outside. The inside interface is your LAN; the outside is the WAN. Swapping them breaks connectivity.
  • Omitting the overload keyword. Without it, you get dynamic NAT, which only works for as many public IPs as you have—usually one, so only one internal device works.
  • Applying NAT to a subinterface incorrectly. If you use subinterfaces, ensure the ip nat inside/outside is on the subinterface, not the parent.
  • Not considering the outside interface's IP address. If the outside interface has a dynamic IP (DHCP), the NAT statement still works as long as the interface name is correct.

Tips

  • Use a named access list for clarity. For example, ip access-list standard INSIDE_NET then permit 192.168.1.0 0.0.0.255. This makes the config more readable.
  • Test with a single host first. If you have a test device, verify it can reach the internet before rolling out to all users.
  • Monitor translations. Use show ip nat statistics to see hit counts and ensure traffic is being translated.
  • Consider using a NAT pool if you have multiple public IPs. You can create a pool and use overload with it, but a single interface IP is simpler.
  • Document your ACL numbers. If you use numbered ACLs, remember that 1-99 are standard; avoid conflicts with other ACLs.

Troubleshooting

  • No internet access from internal hosts. Check show ip nat translations—if empty, your traffic isn't hitting the NAT. Verify the ACL matches your source IPs and that inside/outside is set correctly.
  • Only one device works. This indicates you forgot the overload keyword. Add it to the NAT statement.
  • Ping from the router works, but not from hosts. This usually means the router's own traffic isn't NATed, but host traffic is. Check that the inside interface is correctly defined and that the ACL includes the host subnet.
  • Translations appear but no return traffic. Ensure the outside interface has a route back to the internal network (or a default route). Also check that the router's firewall or access lists aren't blocking return packets.
  • Intermittent failures. This can happen when the outside interface's IP changes (DHCP). Use ip nat inside source list 1 interface GigabitEthernet0/1 overload—this automatically uses the current IP. If you used a static IP, update the NAT statement.
  • Use debug commands cautiously. debug ip nat shows translation events in real time. It can be heavy on the CPU, so use it only for short periods and then disable with undebug all.

Frequently Asked Questions

What is the difference between NAT and PAT?

NAT maps one IP to another (one-to-one). PAT, or NAT Overload, maps many internal IPs to a single public IP by using unique port numbers. PAT is what you need for typical internet sharing.

Can I use a NAT pool with overload?

Yes. Instead of interface, you can define a pool of public IPs and use ip nat inside source list 1 pool MYPOOL overload. This is useful if you have multiple public IPs and need more connections.

Do I need to configure anything for return traffic?

No. The router automatically tracks the translation table and translates return packets from the outside to the correct internal host. You only need to ensure the outside interface has a route to the internet.

Will PAT work with VPN traffic?

It depends. Some VPN protocols (like IPsec) do not work well with PAT because they use fixed ports and protocols. You may need to configure additional settings or use NAT traversal (NAT-T) on the VPN endpoints.

How many internal hosts can share one public IP?

In theory, up to about 65,000 simultaneous connections per IP (since port numbers are 16-bit). In practice, the number is lower due to memory and CPU limits, but it's usually more than enough for a small office.

What if my outside interface has a dynamic IP from DHCP?

That's fine. The interface keyword in the NAT statement uses the current IP of that interface. If the IP changes, the router automatically uses the new one.