11-04-2022 09:57 AM - edited 11-04-2022 10:02 AM
We have BGP multi-home with three ISPs and two routers, and I'm looking for validation on influencing outbound traffic.
Router01 peers with ISP01, and ISP01 provides us with a /24 IP block (eg. 1.1.1.0/24).
Router02 peers with ISP02, and ISP02 provides us with a /24 IP block (eg. 2.2.2.0/24). Router02 also peers with ISP03, and ISP03 provides us with a /24 IP block (eg. 3.3.3.0/24).
We would like to influence the 1.1.1.0/24 IP block to egress over the ISP01 connection, and the 2.2.2.0/24 and 3.3.3.0/24 IP blocks to egress over the ISP02 connection. To do that, our thought is to create route-maps on each router and set a local-preference for each IP block.
On the Router01, create the following route-maps to influence traffic to exit over the ISP01 connection:
ip prefix-list ISP01 seq 5 permit 1.1.1.0/24
ip prefix-list ISP02 seq 5 permit 2.2.2.0/24ip prefix-list ISP03 seq 5 permit 3.3.3.0/24ip prefix-list DEFAULT seq 100 permit 0.0.0.0/0!route-map ISP01-LP-IN permit 5description PERMIT ISP01 IP BLOCK & SET LOCALPREFmatch ip address prefix-list ISP01set local-preference 200!route-map ISP01-LP-IN permit 10description PERMIT DEFAULT ROUTE ON ISP01match ip address prefix-list DEFAULT!router bgp XXXXXXaddress-family ipv4
neighbor A.A.A.A route-map ISP01-LP-IN in
ip prefix-list ISP01 seq 5 permit 1.1.1.0/24
ip prefix-list ISP02 seq 5 permit 2.2.2.0/24ip prefix-list ISP03 seq 5 permit 3.3.3.0/24
ip prefix-list PERMIT-DEFAULT seq 10 permit 0.0.0.0/0!route-map ISP02-LP-IN permit 5description PERMIT ISP02 IP BLOCK & SET LOCALPREFmatch ip address prefix-list ISP02set local-preference 200!route-map ISP02-LP-IN permit 10description PERMIT ISP03 IP BLOCK & SET LOCALPREFmatch ip address prefix-list ISP03set local-preference 150!route-map ISP02-LP-IN permit 15description PERMIT DEFAULT ROUTE ON ISP02match ip address prefix-list DEFAULT!route-map ISP03-LP-IN permit 5description PERMIT DEFAULT ROUTE ON ISP03match ip address prefix-list DEFAULT!router bgp XXXXXXaddress-family ipv4
neighbor B.B.B.B route-map ISP02-LP-IN inneighbor C.C.C.C route-map ISP03-LP-IN in
Would this accomplish the goal of steering the traffic toward the connection we would like it to egress on?
11-04-2022 07:09 PM
I do not believe that this approach will accomplish what you want. The man issue is that setting local preference works on prefixes that the ISP advertises to you. But ISP01 does not advertise 1.1.1 to you. So local preference will not help you.
If you think about it the prefixes that the ISP advertises to you will be the destination addresses on traffic that you forward to the ISP. And you want to influence the traffic based on the source address (is it 1.1.1 or 2.2.2 or 3.3.3). To influence traffic based on source address you should use Policy Based Routing.
11-05-2022 02:36 AM
Hello Router01 peers with ISP01, and ISP01 provides us with a /24 IP block (eg. 1.1.1.0/24).
We would like to influence the 1.1.1.0/24 IP block to egress over the ISP01 connection
can you confirm if you mean this is your local subnet or it is what the isp is advertising to you?
11-05-2022 10:12 AM
Paul makes a good point. I certainly interpreted the original post to mean that 1.1.1.0 was an address block assigned to them by the ISP. But it certainly could be that this is a prefix advertised to them by the ISP. And in that case manipulating Local Preference would be a way to achieve their objective. So we need clarification from the original poster.
11-07-2022 07:42 AM - edited 11-07-2022 07:48 AM
In this scenario, the 1.1.1.0/24 block is not a local subnet, it is the address block assigned to us by ISP01 (and 2.2.2.0/24 is assigned to use by ISP02, and 3.3.3.0/24 is the block assigned to use by ISP03...none are local subnets).
I guess I am perhaps I am confusing assigned and advertised routers. Each of our ISPs has assigned us a /24 (and a /29, which is what the BGP neighbors are using)...and we have worked with each ISP to allow traffic from those /24s on each ISP's network. From our Internet routers, we are then advertising each of those /24s to each ISP.
11-07-2022 09:03 AM
It is still not clear to me how you are using the words assigned and advertised. Are you using them interchangeably or are you using them to mean 2 different things?
If an ISP is advertising 1.1.1 to you then the place to look for a solution is in manipulating local preference in BGP. If an ISP has given you 1.1.1 to use then the place to look for a solution is in PBR. Which is it?
11-05-2022 02:52 AM - edited 11-07-2022 07:47 AM
I see same issue couple weeks ago,
the solution was using VRF
we make specific LAN and ISP with same VRF that make sure that specific LAN using only one ISP
and for failover we use VRF target import/export for that purpose.
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