Cisco backup - NAT failover with DUAL ISP on a router

From Ever changing code
Revision as of 15:01, 23 August 2014 by Pio2pio (talk | contribs) (→‎References)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

This is an generic example of how to configure NAT when there are multiple ISP's for internet connectivity and we want proper Failover i.e when Primary ISP goes down then Secondary takes over with correct NAT happening using the secondary ISP's public ip address

Design

              ------------- ISP1 -------------
             |                                |
             |                                |
LAN -- WAN router                          Internet
             |                                |
             |                                |
              ------------- ISP2 -------------

Configuration

interface FastEthernet0/0
Description Primary link ISP1
ip address 12.x.x.x 255.255.255.240
ip nat outside

interface FastEthernet1/0
Description Secondary link ISP2
ip address 76.x.x.x. 255.255.255.0
ip nat outside

interface FastEthernet1/1
Description Inside LAN segment
ip address 172.168.60.1 255.255.255.0
ip nat inside

access-list 100 permit ip 172.168.60.0 0.0.0.255 any

route-map isp1 permit 10
match ip address 100
match interface FastEthernet0/0

route-map isp2 permit 10
match ip address 100
match interface FastEthernet1/0

ip nat inside source route-map isp1 interface FastEthernet0/0 overload
ip nat inside source route-map isp2 interface FastEthernet1/0 overload

ip route 0.0.0.0 0.0.0.0 12.y.y.y        ! -----> Primary Default route pointing towards Next hop ip of ISP1
ip route 0.0.0.0 0.0.0.0 76.y.y.y 10     ! -----> Backup Default route with higher AD (10) pointing towards Next hop ip of ISP2

The above example shows how we can perform Failover for PAT (Port Address Translation) for the traffic going out to Internet. By using route-maps and "match interface" option, we can achieve failover for Static NAT translation as well which is generally configured when services are hosted out to the internet like webserver or exchange server hosted inside accessible from Internet

route-map isp1static permit 10
match interface FastEthernet0/0

route-map isp2static permit 10
match interface FastEthernet1/0

ip nat inside source static 172.168.60.2 12.x.x.x route-map isp1static
ip nat inside source static 172.168.60.2 76.x.x.x route-map isp2static 

References