cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6815
Views
5
Helpful
7
Replies

Cisco Router Dual ISP load balancing

kumarmh91282
Level 1
Level 1

Hi All,

 

Need your guidance and suggestion on the following requirement

 

One Cisco Router with Two Different ISPs (ISP assigned /32 IP addresses and would use Static route)

One Single subnet  LAN

 

Would like to configure Cisco Router for Load Balancing the ISPs  ( Active + Active) with Failover.

 

Thanks in advance for your Guidance and Suggestions.

 

Regards

Kumar 

7 Replies 7

Hello,

 

if you configure two static default routes, load balancing will be automatic. However, you need to confgure something to remove a static route when the respective ISP is down. What you could do is configure two IP SLAs, in conjunction with a couple of EEM scripts.

 

The config would look like below (IP addresses are arbitrary, obviously):

 

track 1 ip sla 1 reachability
track 2 ip sla 2 reachability
!
interface GigabitEthernet0/0
description Link to ISP 1
ip address 1.1.1.1 255.255.255.252
!
interface GigabitEthernet0/1
description Link to ISP 2
ip address 2.2.2.1 255.255.255.252
!
ip sla 1
icmp-echo 8.8.8.8 source-ip 1.1.1.1
frequency 5
!
ip sla schedule 1 start-time now life forever
!
ip sla 2
icmp-echo 8.8.8.8 source-ip 2.2.2.1
frequency 5
!
ip sla schedule 2 start-time now life forever
!
ip route 0.0.0.0 0.0.0.0 1.1.1.2
ip route 0.0.0.0 0.0.0.0 2.2.2.2
!
event manager applet ISP_1_DOWN
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 1.1.1.2"
action 4.0 cli command "end"
!
event manager applet ISP_1_UP
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "ip route 0.0.0.0 0.0.0.0 1.1.1.2"
action 4.0 cli command "end"
!
event manager applet ISP_2_DOWN
event track 2 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 2.2.2.2"
action 4.0 cli command "end"
!
event manager applet ISP_2_UP
event track 2 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "ip route 0.0.0.0 0.0.0.0 2.2.2.2"
action 4.0 cli command "end"

Thanks for your reply,

 

Here we need to configure NAT, would configuring the NAT cause any issues in load balancing  ?

 

Does Router understand sessions ?

Hello,

 

with NAT, the config would look like below:

 

track 1 ip sla 1 reachability
track 2 ip sla 2 reachability
!
interface GigabitEthernet0/0
description Link to ISP 1
ip address 1.1.1.1 255.255.255.252
ip nat outside
!
interface GigabitEthernet0/1
description Link to ISP 2
ip address 2.2.2.1 255.255.255.252
ip nat outside
!
interface Vlan 1
ip address 192.168.1.1 255.255.255.0
ip nat inside
!
ip sla 1
icmp-echo 8.8.8.8 source-ip 1.1.1.1
frequency 5
!
ip sla schedule 1 start-time now life forever
!
ip sla 2
icmp-echo 8.8.8.8 source-ip 2.2.2.1
frequency 5
!
ip sla schedule 2 start-time now life forever
!
ip route 0.0.0.0 0.0.0.0 1.1.1.2
ip route 0.0.0.0 0.0.0.0 2.2.2.2
!
event manager applet ISP_1_DOWN
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 1.1.1.2"
action 4.0 cli command "end"
action 5.0 cli command "clear ip nat translation *"
!
event manager applet ISP_1_UP
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "ip route 0.0.0.0 0.0.0.0 1.1.1.2"
action 4.0 cli command "end"
!
event manager applet ISP_2_DOWN
event track 2 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 2.2.2.2"
action 4.0 cli command "end"
action 5.0 cli command "clear ip nat translation *"
!
event manager applet ISP_2_UP
event track 2 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "ip route 0.0.0.0 0.0.0.0 2.2.2.2"
action 4.0 cli command "end"
!
ip nat inside source route-map RM_ISP_1_NAT interface GigabitEthernet0/0 overload
ip nat inside source route-map RM_ISP_2_NAT interface GigabitEthernet0/1 overload
!
access-list 101 permit ip 192.168.1.0 0.0.0.255 any
!
route-map RM_ISP_1_NAT permit 10
match ip address 101
match interface GigabitEthernet0/0
!
route-map RM_ISP_2_NAT permit 10
match ip address 101
match interface GigabitEthernet0/1

Hi have similar configuration but find not only doesn't load balance it. It doesn't fail over unless I put an EEM script to remove the first ip nat inside source route-map xxxx interface g1 overload.

I am using 17.3

 

Hello Kumar

May i ask how you are actually connecting to your isps at the moment are you using dynamic routing such as an ospf or bgp

What routes are you receiving?

 

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Joseph W. Doherty
Hall of Fame
Hall of Fame

You might also want to investigate PfR (or whatever it's current replacement is, if any), as it can dynamically load balance and also deal with one of the paths failing.

for me divide the one LAN subnet to two and route each one through one ISP.