03-13-2021 12:19 AM
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
03-13-2021 12:46 AM
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"
03-13-2021 12:50 AM
Thanks for your reply,
Here we need to configure NAT, would configuring the NAT cause any issues in load balancing ?
Does Router understand sessions ?
03-13-2021 01:02 AM
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
02-09-2025 09:17 AM
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
03-13-2021 01:47 AM
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?
03-14-2021 08:39 AM
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.
03-14-2021 04:33 PM
for me divide the one LAN subnet to two and route each one through one ISP.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide