Wednesday, May 23, 2012

Configuring NAT - NAT with route-maps

Fourth post in this NAT series is the 'NAT with route-maps'. In my opinion, using route-map to manipulate NAT is a fairly advanced topic. Therefore make sure to do plenty of labs and read up on docs to understand the concepts. With that being said, let's get started.

Topology we will be using.


1) Objective is to get R5 (192.168.1.5) to be NAT'd with R2 fast2/0 IP address (2.2.2.2).
2) Objective is to get R4 (192.168.1.4) to be NAT'd with R2 fast1/1 IP address (1.1.1.1).

Let's get started by configuring the interfaces.

R4 and R5 interface configurations.
R3 and R6 interface configuration and route back to the 1.1.1.0/30  and 2.2.2.0/30  networks. 

R2 fast1/0 and fast1/1 interface configurations.

R2 fast2/0 interface configurations.

  • Configure R2 fast1/0 and make sure to have 'ip nat inside' as this is the interface facing the inside hosts. 
  • Configure R2 fast1/1 and fast2/0 and make sure to have 'ip nat outside' as this is the interface facing the outside hosts (usually the internet).



  1. Create 2 access lists to match R4 and R5 IP address. 
  2. Create a route-map to match R4 IP address.
  3. Create a route-map to match R5 IP address. 
  4. Create the NAT statements with route-maps and assign the appropriate outside NAT interfaces. 
Let's do a ping from R4 and R5 and verify that our NAT is working as it should.


From R4 we are pinging R3 and R6. Notice that no matter what the inside global is 1.1.1.2 (R2 fast1/1). Reason being in our NAT statement we specified that anything sourcing from R4 (192.168.1.4) should be NAT'd to 1.1.1.2. 

Now from R5. 

From R5 we are pinging R3 and R6. Notice that no matter what the inside global is always 2.2.2.2 (R2 fast2/0). Reason being in our NAT statement we specified that anything sourcing from R5 (192.168.1.5) should be NAT'd to 2.2.2.2. 

All is working as it should. NAT with route-maps can be used in numerous instances such as manipulating NAT's only for certain destinations, VPN setups and many more. 

Many more articles to come so stay tuned. If you like what you read please comment/like/+1/join this site --->