Just like the Cisco IOS routers we can configure NAT / PAT on our Cisco ASA firewall. In this lesson I will explain how to configure dynamic NAT. If you are unsure of how NAT/PAT exactly works then I recommend to read my Introduction to NAT/PAT first.
Having said that, let’s take a look at dynamic NAT on the ASA. We will use this topology:
In the middle we have our ASA, its E0/0 interface belongs to the inside and the e0/1 interface belongs to the outside. I’m using routers so that I have something to connect to. Let’s start with the interface first.
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 shutdown
ASA1(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 shutdown
Now we can focus on configuring dynamic NAT…
Dynamic NAT Configuration
The following example is for ASA 8.3 and later. First we will configure a network object that defines the pool with public IP addresses that we want to use for translation:
ASA1(config)# object network PUBLIC_POOL
ASA1(config-network-object)# range 192.168.2.100 192.168.2.200
As an example I’ll use the 192.168.2.100 – 200 range from the 192.168.2.0 /24 subnet that we use on the outside interface. The next step is to configure a network object for the hosts that we want to translate:
ASA1(config)# object network INTERNAL
ASA1(config-network-object)# subnet 192.168.1.0 255.255.255.0
ASA1(config-network-object)# nat (INSIDE,OUTSIDE) dynamic PUBLIC_POOL
The network object called “INTERNAL” specifies the subnet that we want to translate (the entire 192.168.1.0 /24) subnet and also has the NAT rule. When traffic from the inside goes to the outside, we will translate it to the public pool that we created earlier.
When all hosts on the 192.168.1.0 /24 subnet try to access the outside network we will run out of IP addresses in the public pool, if you want you can enable NAT fallback. This means that when the public pool runs out of IP addresses, we will use the IP address on the outside interface (192.168.2.254) for translation. Here’s how to do it:
Hello,
I do not understand the difference of the object nat and the regular nat, can you explain that to me?
Hi Alfredo,
The ASA (since 8.3) has different NAT “sections”:
The ASA will first process NAT rules in section 1, then 2 and finally 3.
Here’s an example of manual NAT:
The NAT rule has been configured globally, this section 1 rule is preferred over 2 and 3.
Here’s an example for A
... Continue reading in our forumHi
Can someone help cant figure out why my internal ip address wont get nat’ed
... Continue reading in our forumHi Sunil,
These are the pre < 8.3 commands to configure NAT.
Let’s break down these commands:
global
means we configure a global address pool.(outside)
means we define the pool on this interface (outside).1
is the ID of our pool.interface
means that we use PAT with the IP address on the interface.Same as above but for the guestwifi interface.
(outside)
this is the interface where the NAT network exists. The outside interface in this case.1
Hello Harshi
You can use the
clear xlate
command to clear all NAT entries in the NAT table.In order to have the ASA firewall perform NAT, you will require the use of a Layer 3 inside inter
... Continue reading in our forum