3.Cisco ASA PAT Configuration
In previous lessons I explained how to configure Dynamic NAT or Dynamic NAT with a DMZ on your Cisco ASA Firewall. In this lesson you will learn how to configure PAT. Here’s the topology I will use:

We have an INSIDE and OUTSIDE interface and we will use PAT to translate traffic from our hosts on the INSIDE that want to reach the OUTSIDE. R1 and R2 are only used to generate traffic. This is the basic ASA configuration that I will use:
ASA1(config)# interface e0/0
ASA1(config-if)# nameif INSIDE
ASA1(config-if)# ip address 192.168.1.254 255.255.255.0
ASA1(config-if)# no shutdownASA1(config)# interface e0/1
ASA1(config-if)# nameif OUTSIDE
ASA1(config-if)# ip address 192.168.2.254 255.255.255.0
ASA1(config-if)# no shutdownNow let’s configure PAT…
1.PAT Configuration
Configuring PAT is quite straight forward, the example below is for ASA 8.3 or higher. We will configure a network object for this:
ASA1(config)# object network INSIDE
ASA1(config-network-object)# subnet 192.168.1.0 255.255.255.0
ASA1(config-network-object)# nat (INSIDE,OUTSIDE) dynamic 192.168.2.253This tells our firewall to translate traffic from the 192.168.1.0 /24 subnet headed towards the OUTSIDE to IP address 192.168.2.253. If you configure the IP address like this then it has to be an IP address that is not in use on the interface. For example, when I try to use 192.168.2.254 (that’s the IP address on the OUTSIDE interface) then I will get an error:
ASA1(config-network-object)# nat (INSIDE,OUTSIDE) dynamic 192.168.2.254
ERROR: Address 192.168.2.254 overlaps with OUTSIDE interface address.
ERROR: NAT Policy is not downloadedOf course there’s another way to use the IP address on the OUTSIDE interface but I just wanted to show you what happens when you try to configure the IP address like this. Let’s first try if PAT works…I’ll generate some traffic from R1:
R1#telnet 192.168.2.2
Trying 192.168.2.2 ... OpenLet’s see if this traffic was translated or not:
ASA1# show xlate
1 in use, 3 most used
Flags: D - DNS, e - extended, I - identity, i - dynamic, r - portmap,
s - static, T - twice, N - net-to-net
TCP PAT from INSIDE:192.168.1.1/49065 to OUTSIDE:192.168.2.253/49065 flags ri idle 0:00:18 timeout 0:00:30Excellent…it has been translated from 192.168.1.1 to 192.168.2.253, just as we configured. Now let me show you how you can use the IP address on your OUTSIDE interface for PAT:
ASA1(config)# object network INSIDE_TO_OUTSIDE
ASA1(config-network-object)# nat (INSIDE,OUTSIDE) dynamic interfaceInstead of specifying the IP address you need to use the keyword “interface”. It’s a good idea to do this when you get a dynamic IP address from your ISP. Let’s see if this works…
R1#telnet 192.168.2.2
Trying 192.168.2.2 ... OpenASA1# show xlate
1 in use, 3 most used
Flags: D - DNS, e - extended, I - identity, i - dynamic, r - portmap,
s - static, T - twice, N - net-to-net
TCP PAT from INSIDE:192.168.1.1/26187 to OUTSIDE:192.168.2.254/26187 flags ri idle 0:00:07 timeout 0:00:30There we go, traffic from R1 has been translated to 192.168.2.254.
I hope this example has been useful, if you have any questions feel free to leave a comment!
Comments
Post a Comment