08-10-2017 03:10 PM - edited 03-05-2019 08:59 AM
I have two sites, connected to client- A with 1G cable using ebgp. I am advertising 1.1.1.0/24 from both site to client-A. Site-1 has 1.1.1.1 and site-2 has 1.1.1.2 server. How can I choose shortest path to reach 1.1.1.1 or 1.1.1.2 ? (10.1.2.0/24 natted to 1.1.1.1 ,10.1.1.0/24 natted to 1.1.1.2 )
(this is not real scenario but would like to know how can i do policy based routing for particular addresses?)
Solved! Go to Solution.
08-10-2017 04:24 PM
- For below configuration to work you must have /32 routes installed in the RIB for both 1.1.1.1/32 and 1.1.1.2/32
ip prefix-list net1 permit 1.1.1.1/32
ip prefix-list net1 permit 1.1.1.2/32
!
route-map net1-aspath permit 10
match ip address prefix-list net1
set as-path prepend 10 10 10
route-map net1-aspath permit 20
!
router bgp 10
neighbor 192.168.1.1 route-map net1-aspath out
net 1.1.1.1 mask 255.255.255.255
net 1.1.1.2 mask 255.255.255.255
08-10-2017 04:10 PM
First you have to determine preferred path and then you can use local preference or weight to influence outbound traffic and as path for the inbound traffic, so you don't run into asymmetric routing issue.
Shorter path may not always be the best, you may have less hops/as path on 1 side, but the other side may provide better bandwidth/ faster link with more hops.
08-10-2017 04:10 PM
this is inbound traffic (lets say telnet from client-A to server inside, sorry i dint provide this info before).
local-pref and wight will work for outbound traffic. also, I am advertising 1.1.1.0/24, how can i set as path (prepend) for specific 1.1.1.1/32 and 1.1.1.2/32 ? (natting with internal server ips)
08-10-2017 04:24 PM
- For below configuration to work you must have /32 routes installed in the RIB for both 1.1.1.1/32 and 1.1.1.2/32
ip prefix-list net1 permit 1.1.1.1/32
ip prefix-list net1 permit 1.1.1.2/32
!
route-map net1-aspath permit 10
match ip address prefix-list net1
set as-path prepend 10 10 10
route-map net1-aspath permit 20
!
router bgp 10
neighbor 192.168.1.1 route-map net1-aspath out
net 1.1.1.1 mask 255.255.255.255
net 1.1.1.2 mask 255.255.255.255
08-10-2017 04:37 PM
I am advertising 1.1.1.0/24. Cant advertise any other route. Otherwise this would work.
This is exactly my question is...if I am advertising /24, is there any way to do policy routing for specific routes?
Tnetwork design:
client-A
/ \
/ \
Site-A ---Site-B
08-10-2017 04:45 PM
That's fine, you can advertise /32 routes with a longer as path without affecting /24 in your scenario. You just need to make sure that your router has /32 routes in the RIB. If you are using static routing then you just need to create 2 static routes for the /32 addresses.
08-10-2017 06:24 PM
And yes policy routing can also be used but that would be independent of BGP. You will either have to use policy routing at the remote site as well so it takes the same path unless you are using as prepending for inbound traffic.
08-10-2017 07:28 PM
Hi
In order to advertise a prefix through BGP you have to advertise that with the same subnet mask like it is included into the RIB or routing table. Otherwise you need to include it manually like Cofee@0400 mentioned, using static routes so it will match with the entry into the routing table.
:-)
08-10-2017 07:35 PM
That's the thing, I cant advertise any other route then /24. I don't think so it is possible without advertising /32. Thank you.
08-10-2017 04:17 PM
Hello
With multiple ebgp peering from one rtr then utilizing weight path attribute would b3 applicable.
example:
access-list 21 permit 1.1.1.1
route-map server1 permit 10
match ip address 21
set weight 50000<---------------------------server1
route-map server1 permit 99
set weight 30000<---------------------------all other traffic
access-list 23 permit 1.1.1.2
route-map server2 permit 10
match ip address 23
set weight 50000<---------------------------server2
route-map server2 permit 99
set weight 30000 <---------------------------all other traffic
router bgp xx
neighbor x.x.x.1 remote-as 21
neighbor x.x.x.1 description site 1
neighbor x.x.x.1 route-map server1 in
neighbor x.x.x.2 remote-as 23
neighbor x.x.x.2 description site2
neighbor x.x.x..2 route-map server2 in
res
Paul
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