6.8.1 Packet Tracer - Configure NAT for IPv4 (Answers)

Packet Tracer Packet Tracer Labs Original source

6.8.1 Packet Tracer - Configure NAT for IPv4 Answers

Topology

6.8.1 Packet Tracer - Configure NAT for IPv4 topology

Addressing Table

Device Interface IP Address
R1 S0/0/0 10.1.1.1/30
F0/0 192.168.10.1/24
R2 S0/0/0 10.1.1.2/30
S0/0/1 10.2.2.1/30
S0/1/0 209.165.200.225/27
F0/0 192.168.20.1/24
R3 S0/0/1 10.2.2.2/30
F0/0 192.168.30.1/24
PC1 NIC 192.168.10.10/24
PC2 NIC 192.168.30.10/24
local.pka NIC 192.168.20.254/24
Outside PC NIC 209.165.201.14/28
cisco.pka NIC 209.165.201.30/28

Objectives

Background / Scenario

In this lab, you will configure a router with dynamic NAT with PAT. This will translate addresses from the three internal LANs to a single outside address. In addition, you will configure static NAT to translate an internal server address to an outside address.

Instructions

In this activity you will only configure router R2.

Verify NAT

Browse to cisco.pka (209.165.201.30) from PC1 and PC2, and to 209.165.202.130 from Outside PC. Then verify NAT on R2.

Copy

R2# show ip nat translations

Pro  Inside global     Inside local       Outside local      Outside global

---  209.165.202.130   192.168.20.254     ---                ---

tcp 209.165.202.129:1024192.168.30.10:1025 209.165.201.30:80  209.165.201.30:80

tcp 209.165.202.129:1025192.168.10.10:1025 209.165.201.30:80  209.165.201.30:80

tcp 209.165.202.130:80 192.168.20.254:80  209.165.201.14:1025209.165.201.14:1025

Copy

R2# show ip nat statistics

Total translations: 4 (1 static, 3 dynamic, 3 extended)

Outside Interfaces: Serial0/1/0

Inside Interfaces: FastEthernet0/0 , Serial0/0/0 , Serial0/0/1

Hits: 22  Misses: 3

Expired translations: 0

Dynamic mappings:

-- Inside Source

access-list R2NAT pool R2POOL refCount 2

 pool R2POOL: netmask 255.255.255.252

       start 209.165.202.129 end 209.165.202.129

       type generic, total addresses 1 , allocated 1 (100%), misses 0

Device Configs - Final

ROUTER R2

Copy

! ==============================================================

!--- 6.8.1 Packet Tracer - Configure NAT for IPv4

!--- ANSWER SCRIPT FOR ROUTER R2

!--- Usage: open the R2 CLI tab and paste this whole file at the R2> prompt. Every line beginning with "!" is a comment; IOS ignores it, so pasting a comment by accident is harmless.

! ==============================================================



enable

configure terminal



! --------------------------------------------------------------

!--- Instructions: configure dynamic NAT with PAT and static NAT on R2.

! --------------------------------------------------------------



!--- Named ACL R2NAT permits LAN1, LAN2 and LAN3, in this order.

ip access-list standard R2NAT

 permit 192.168.10.0 0.0.0.255

 permit 192.168.20.0 0.0.0.255

 permit 192.168.30.0 0.0.0.255

 exit



!--- NAT pool R2POOL with the first address of 209.165.202.128/30.

ip nat pool R2POOL 209.165.202.129 209.165.202.129 netmask 255.255.255.252



!--- NAT with ACL R2NAT and pool R2POOL; overload lets all hosts share the one address (PAT).

ip nat inside source list R2NAT pool R2POOL overload



!--- Static NAT: local.pka 192.168.20.254 to the second address 209.165.202.130.

ip nat inside source static 192.168.20.254 209.165.202.130



!--- Interfaces that participate in NAT: F0/0, S0/0/0 and S0/0/1 inside; S0/1/0 outside.

interface fastethernet 0/0

 ip nat inside

 exit

interface serial 0/0/0

 ip nat inside

 exit

interface serial 0/0/1

 ip nat inside

 exit

interface serial 0/1/0

 ip nat outside

 exit



end



! --------------------------------------------------------------

!--- Save the configuration to NVRAM. (Press Enter when prompted for the destination filename.)

! --------------------------------------------------------------

copy running-config startup-config





! ==============================================================

!--- Verification:

!---   browse to cisco.pka (209.165.201.30) from PC1 and PC2   -> web page opens

!---   browse to 209.165.202.130 from Outside PC              -> local.pka web page opens

!---   show ip nat translations  -> static 209.165.202.130 = 192.168.20.254; PAT entries use 209.165.202.129

! ==============================================================

Download Packet Tracer (.pka) file:

Icon

6.8.1 Packet Tracer - Configure NAT for IPv4.pka 1.04 MB 8311 downloads

...

Download

Previous Lab
6.6.7 Packet Tracer – Configure PAT

Next Lab
7.6.1 Packet Tracer – WAN Concepts

← All Packet Tracer articles Home