PAT for a branch LAN, and static NAT that publishes its web server
Task
Make a branch LAN of private hosts reach a web server on the ISP side through one public address with PAT, and publish the branch's own web server to the outside with a static NAT entry. On the way, find the most common NAT fault, a LAN interface that was never marked inside, from the two NAT show commands. You finish able to read the translation table and name the inside local, inside global, outside local and outside global address in each row.
Topology
Devices
| Device | Model | Role |
|---|---|---|
| R1 | ISR4331 | branch edge router doing NAT |
| ISP1 | ISR4331 | ISP router, the outside |
| S1 | 2960-24TT | branch access switch, no configuration needed |
| PC1 | PC-PT | branch staff PC |
| PC2 | PC-PT | branch staff PC |
| SRV1 | Server-PT | branch web server, published with static NAT |
| SRV2 | Server-PT | web server on the ISP side |
Links
| From | To |
|---|---|
| R1 G0/0/0 | S1 G0/1 |
| PC1 Fa0 | S1 Fa0/1 |
| PC2 Fa0 | S1 Fa0/2 |
| SRV1 Fa0 | S1 Fa0/3 |
| R1 G0/0/1 | ISP1 G0/0/0 |
| ISP1 G0/0/1 | SRV2 Fa0 |
Addressing
| Device | Interface | Address | Default gateway |
|---|---|---|---|
| R1 | G0/0/0 (inside) | 192.168.19.1/24 | none |
| R1 | G0/0/1 (outside) | 203.0.113.5/29 | 203.0.113.6 |
| R1 | static NAT for SRV1 | 203.0.113.20 (inside global) | none |
| ISP1 | G0/0/0 | 203.0.113.6/29 | none |
| ISP1 | G0/0/1 | 198.51.100.1/24 | none |
| PC1 | NIC | 192.168.19.10/24 | 192.168.19.1 |
| PC2 | NIC | 192.168.19.11/24 | 192.168.19.1 |
| SRV1 | NIC | 192.168.19.50/24 | 192.168.19.1 |
| SRV2 | NIC | 198.51.100.80/24 | 198.51.100.1 |
Steps
- Place the devices and cable them as the Topology lists. Use the automatic connection type (the lightning-bolt cable) for every link, so Packet Tracer picks straight-through or cross-over for you. Give PC1, PC2, SRV1 and SRV2 their addresses and gateways in Desktop > IP Configuration. On SRV1, open Services > HTTP, edit index.html so that its text reads
SRV1 branch web server, and save it: both servers serve the same default page otherwise, and you need to tell them apart. - Configure ISP1. It knows its two connected networks and one static route for the public block 203.0.113.16/28 that it has assigned to the branch. It has no route to 192.168.19.0/24, and it never will: an ISP does not route private space.
Router> enable
Router# configure terminal
Router(config)# hostname ISP1
ISP1(config)# interface GigabitEthernet0/0/0
ISP1(config-if)# ip address 203.0.113.6 255.255.255.248
ISP1(config-if)# no shutdown
ISP1(config-if)# interface GigabitEthernet0/0/1
ISP1(config-if)# ip address 198.51.100.1 255.255.255.0
ISP1(config-if)# no shutdown
ISP1(config-if)# exit
ISP1(config)# ip route 203.0.113.16 255.255.255.240 203.0.113.5
- Configure R1's addresses and a default route towards the ISP:
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# interface GigabitEthernet0/0/0
R1(config-if)# ip address 192.168.19.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# interface GigabitEthernet0/0/1
R1(config-if)# ip address 203.0.113.5 255.255.255.248
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.6
From PC1 run C:\> ping 198.51.100.80. Expect Request timed out. four times: the request reaches SRV2, but the reply is addressed to 192.168.19.10, and ISP1 has no route to it. This is the problem NAT solves. 4. Configure PAT, but deliberately mark only the outside interface. The ACL names the inside hosts to translate (a wildcard, not a mask), and overload makes R1 share G0/0/1's own address between them:
R1(config)# access-list 1 permit 192.168.19.0 0.0.0.255
R1(config)# ip nat inside source list 1 interface GigabitEthernet0/0/1 overload
R1(config)# interface GigabitEthernet0/0/1
R1(config-if)# ip nat outside
R1(config-if)# end
Ping 198.51.100.80 from PC1 again. It still times out. 5. Find the fault with the lesson's first troubleshooting check. R1# show ip nat translations lists no entries at all, and R1# show ip nat statistics lists GigabitEthernet0/0/1 as an outside interface and nothing as an inside interface. NAT only translates packets that arrive on an inside interface, so fix it:
R1# configure terminal
R1(config)# interface GigabitEthernet0/0/0
R1(config-if)# ip nat inside
R1(config-if)# end
Ping 198.51.100.80 from PC1 once more: the replies now arrive. The first may time out while ARP resolves. 6. Generate some sessions to read. On PC1 and on PC2, open Desktop > Web Browser and browse to http://198.51.100.80. Then, within a minute:
R1# show ip nat translations
Both inside local addresses, 192.168.19.10 and 192.168.19.11, map to the same inside global address, 203.0.113.5, told apart only by port: that is PAT. The outside local and outside global columns are identical, 198.51.100.80:80, because nobody rewrites the server's address. 7. Publish SRV1 with a static entry: inside local first, inside global second. 203.0.113.20 is in the /28 that ISP1 routes to R1:
R1# configure terminal
R1(config)# ip nat inside source static 192.168.19.50 203.0.113.20
R1(config)# end
On SRV2, open Desktop > Web Browser and browse to http://203.0.113.20: the page reads SRV1 branch web server. An outside host opened that session, which only works because a static entry exists all the time. 8. Clear the dynamic entries and look again:
R1# clear ip nat translation *
R1# show ip nat translations
The PAT rows are gone, and the static row stays, with dashes in the outside columns when no session is using it. Static entries never time out and are never cleared this way.
Verify
Browse from PC1 to http://198.51.100.80 once more, then run:
R1# show ip nat translations
Expected output: a tcp row with inside global 203.0.113.5 and inside local 192.168.19.10, outside local and outside global both 198.51.100.80:80, and the static row with inside global 203.0.113.20 and inside local 192.168.19.50.
R1# show ip nat statistics
Expected output: GigabitEthernet0/0/1 listed as the outside interface, GigabitEthernet0/0/0 listed as the inside interface, and a hits counter above 0.
On SRV2's Command Prompt:
C:\> ping 203.0.113.20
Expected output: four lines reading Reply from 203.0.113.20.
Save your work
On R1 and ISP1 run copy running-config startup-config, then save the topology as ccna-lab19-nat-pat.pkt (File > Save As).
This is an independent study companion for the Cisco CCNA 200-301 v2.0 exam and is not produced by or endorsed by Cisco. Cisco, CCNA and IOS are trademarks of Cisco Systems, Inc.
This is an independent study companion for Cisco CCNA 200-301 and is not produced by or endorsed by CompTIA.