Objective
Configure Port Address Translation (PAT) to allow multiple internal devices to share a single public IP address.
Lab Topology
| Device | Interface | IP Address | Subnet Mask | Description |
|---|---|---|---|---|
| R1 | GigabitEthernet0/0 |
192.168.1.1 |
255.255.255.0 |
Inside Local (LAN Gateway) |
| R1 | GigabitEthernet0/1 |
203.0.113.2 |
255.255.255.252 |
Outside Global (WAN Link) |
| PC1 | NIC |
192.168.1.10 |
255.255.255.0 |
Inside Host |
| Remote Server | NIC |
8.8.8.8 |
255.0.0.0 |
External Destination Test Address |
Task 1 - Basic Configuration
Apply hostname and disable DNS lookup.
Router> enable Router# configure terminal Router(config)# hostname R1 R1(config)# no ip domain-lookup
Task 2 - Define Interfaces and IP Addressing
Configure interface IP addresses and identify inside and outside interfaces.
R1(config)# interface gigabitEthernet 0/0 R1(config-if)# ip address 192.168.1.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# ip nat inside R1(config-if)# exit R1(config)# interface gigabitEthernet 0/1 R1(config-if)# ip address 203.0.113.2 255.255.255.252 R1(config-if)# no shutdown R1(config-if)# ip nat outside R1(config-if)# exit
Task 3 - Create Access List
Define which internal addresses are allowed to be translated.
R1(config)# access-list 1 permit 192.168.1.0 0.0.0.255
Task 4 - Configure NAT Overload
Map the list to the outside interface using overload.
R1(config)# ip nat inside source list 1 interface gigabitEthernet 0/1 overload
Task 5 - Verification
Generate traffic from an inside host and check the translation table.
R1# show ip nat translations Pro Inside global Inside local Outside local Outside global icmp 203.0.113.2:1024 192.168.1.10:1 8.8.8.8:1 8.8.8.8:1