08-16-2021 04:03 AM
Hi,
i have a router which is connected to two isp. ISP1 and ISP2. we are running bgp with both of them. for inbound traffic we are receiving the traffic almost as expected but for outbound traffic all the traffic is following ISP1 always. and we do not wanted like that and need to send traffic to ISP1 and some to ISP2 (both ISP are sending default route through BGP). after doing many changes we did not get desired results so i went with other solution.
! Step 1
! Define SLA to track the default route and set default route according to availability.
! SLA for ISP1 as default Gateway
ip sla 15
icmp-echo 172.16.180.161
! ISP1 Side IP
frequency 5
ip sla schedule 15 life forever start-time now
!!!!!! Track for SLA 15 to check the status of next hop ISP1
track 15 ip sla 15 reachability
delay down 120 up 1
! Default route for all traffic is ISP1 with default metrics. and Track the availability of ISP1.
ip route 0.0.0.0 0.0.0.0 172.16.180.161 track 15
! Default route for all traffic to ISP2 with metric 15 set lower then 20 (EBGP)
! ISP2 side 172.17.4.137
ip route 0.0.0.0 0.0.0.0 172.17.4.137 15
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! For Load balancing create route-map and call the ACL for preferred path.
! ACL to match the subnet we need to prefer to ISP1.
!
access-list 80 permit 192.12.176.0 0.0.0.255
access-list 81 permit 192.12.177.0 0.0.0.255
! ACL to match the subnet we need to prefer to ISP2.
access-list 82 permit 192.12.178.0 0.0.0.255
access-list 83 permit 192.12.179.0 0.0.0.255
!!!!! IP SLA for main ISP1 and backup ISP2
ip sla 16
icmp-echo 172.16.180.161
frequency 5
ip sla schedule 16 life forever start-time now
!!!!!! Track for IP SLA 16 for making the next hop for preferred subnet to ISP1
track 16 ip sla 16 reachability
delay down 120 up 1
!!!!! IP SLA for main ISP1 and backup ISP2
ip sla 17
icmp-echo 172.17.4.137
frequency 5
ip sla schedule 17 life forever start-time now
!!!!!! Track for IP SLA 16 for making the next hop for preferred subnet to ISP1
track 17 ip sla 17 reachability
delay down 120 up 1
!!!! Route map to set ISP1 as main and ISP2 as backup for subnet 80 and 81
route-map MAIN_ISP1_BACK_ISP2 permit 10
match ip address 80 81
set ip next-hop verify-availability 172.16.180.161 16 track 16
!!!! Route map to set ISP2 as main and ISP1 as backup for subnet 82 and 83
route-map MAIN_ISP2_BACK_ISP1 permit 10
match ip address 82 83
set ip next-hop verify-availability 172.17.4.137 17 track 17
int Loopback 100
ip address 192.12.176.1 255.255.255.255
ip policy route-map MAIN_ISP1_BACK_ISP2
int Loopback 101
ip address 192.12.177.1 255.255.255.255
ip policy route-map MAIN_ISP1_BACK_ISP2
Int Loopback 200
ip address 192.12.178.1 255.255.255.255
ip policy route-map MAIN_ISP2_BACK_ISP1
int Loopback 201
ip address 192.12.179.1 255.255.255.255
ip policy route-map MAIN_ISP2_BACK_ISP1
After doing this still the traceroute source as any of these loopback is following ISP1 which we do not want.
so kindly let me know where i am making mistake
Thanks
08-17-2021 02:27 PM
HI @Richard Burts ,
So i will try tomorrow as per your suggestion, to advertise first two most specific subnets plus complete /22 subnet to isp1 and other two specific subnet plus /22 summary route to isp2. it should solve my inbound traffic issue.
For outbound if i try maximum path will it solve both things or not? Kindly advice
And for PBR i replied above that " ip local policy route-map " command is not working at my router. i have shared the version as well kindly check.
===============================================================
Cisco IOS XE Software, Version 03.13.01.S - Extended Support Release
Cisco IOS Software, ASR1000 Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 15.4(3)S1, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2014 by Cisco Systems, Inc.
08-17-2021 03:11 PM
If you make the changes that I suggest about advertising into BGP it should achieve your objective for inbound traffic from Internet to you. It should have 2 subnets come to you over ISP 1 while the other 2 subnets come to you over ISP 2. And if either ISP is not working then all traffic should use the ISP that is still working.
For outbound if you try maximum paths it will not achieve your objective. maximum paths will allow BGP to use both default routes. But nothing there will tell the first 2 subnets to use ISP 1 or tell the other 2 subnets to use ISP 2. To achieve that objective you need PBR.
This is what you posted in an earlier response
"ip local-policy route-map"
(config-if)#ip local-policy route-map ISP_FES
^
% Invalid input detected at '^' marker.
Clearly there is a dash between local and policy. local-policy is not a valid command. local policy should be a valid command.
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