Using Route Maps to Refine Static Translation Rules
Problem
You want to use route maps to give finer control over your static NAT translation rules.
Solution
One of the best uses of this feature appears when you have two Internet Provider connections and you want to use distinct NAT rules for each:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface
Router(config-if)#
FastEthernet0/0
ip address
Router(config-if)#
172.16.1.5 255.255.255.252
ip nat outside
Router(config-if)#exit
Router(config)#interface
Router(config-if)#
FastEthernet0/1
ip address
Router(config-if)#
172.16.2.5 255.255.255.252
ip nat outside
Router(config-if)#exit
Router(config)#interface
Router(config-if)#
FastEthernet0/2
ip address
Router(config-if)#
192.168.1.1 255.255.255.0
ip nat inside
Router(config-if)#exit
Router(config)#ip nat inside source route-map
ISP-1
interface
FastEthernet0/0
overload
Router(config)#ip nat inside source route-map
ISP-2
interface
FastEthernet0/1
overload
Router(config)#route-map
ISP-1
permit
Router(config-route-map)#
10
match interface
Router(config-route-map)#
FastEthernet0/0
exit
Router(config)#route-map
ISP-2
permit
Router(config-route-map)#
10
match interface
Router(config-route-map)#
FastEthernet0/1
exit
Router(config)#end
Router#
Discussion
This example shows a relatively common situation in which a network has two Internet connections for redundancy. Note that we don’t show the redundancy mechanism here, but it could be handled by BGP, ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.