Stateful NAT Failover
Problem
You want to use NAT in a high availability configuration, allowing a second router to take over NAT functionality if the first fails.
Solution
Stateful NAT allows you to combine NAT functionality with HSRP using two routers in a high availability configuration:
Router-A#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router-A(config)#access-list
11
permit any
Router-A(config)#ip nat pool
NATPOOL 172.17.100.100 172.17.100.150
netmask
Router-A(config)#
255.255.255.0
ip nat inside source list
11
pool
NATPOOL
mapping-id
Router-A(config)#
1
interface
Router-A(config-if)#
FastEthernet0/0
ip address
Router-A(config-if)#
192.168.1.3 255.255.255.0
ip nat inside
Router-A(config-if)#standby
1
ip
Router-A(config-if)#
192.168.1.1
standby
1
preempt
Router-A(config-if)#standby
1
name
Router-A(config-if)#
SNATGROUP
exit
Router-A(config)#interface
Router-A(config-if)#
Serial0/0
ip address
Router-A(config-if)#
172.17.55.2 255.255.255.252
ip nat outside
Router-A(config-if)#exit
Router-A(config)#ip nat Stateful id
Router-A(config-ipnat-snat)#
1
redundancy
Router(config-ipnat-snat-red)#
SNATGROUP
mapping-id
Router(config-ipnat-snat-red)#
1
exit
Router-A(config)#end
Router-A#
The second router’s configuration is nearly identical:
Router-B#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router-B(config)#access-list
11
permit any
Router-B(config)#ip nat pool
NATPOOL 172.17.100.100 172.17.100.150
netmask
Router-B(config)# ...
255.255.255.0
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.