03-17-2010
03:30 AM
- last edited on
08-24-2022
11:53 PM
by
Translator
Hi, imagine I have edge RouterA-->CorporateRouter1 and RouterB->CorporateRouter2 running BGP.
RouterA and RouterB AS = 100.
CorporateRouter1 and CorporateRouter2 AS = 200.
I prefer that inbound traffic from CorporateRouters flows via RouterA and use RouterB as backup.
So I successfully configured MED like shown below.
Question:
Instead of using MED, would it be more robust if I use AS-PATH instead? The question that I have is, what happens if someday people decide to allow more prefixes or delete some prefixes from the list of allowed networks. It seems to me that AS-PATH would be a cleaner way to configure this inbound route path selection for that reason since it does not rely on network range specification. Please let me know your thoughts on this.
RouterA
router bgp 100
neig <corporaterouter1> route-map SETMED out
(...)
route-map SETMED permit 10
match ip address prefix-list PFX
!
route-map SETMED permit 100
!
ip prefix-list PFX seq 5 permit 10.1.0.0/16
ip prefix-list PFX seq 10 permit 10.22.0.0/23
!
Solved! Go to Solution.
03-17-2010 03:34 AM
Marlon
When you say AS-PATH do you mean AS-PATH prepending ie adding multiple instances of your AS to the AS-PATH ?
If so the key difference between MED and path prepending is that MED is only relevant to the neighboring AS ie. it does not go beyond that. Path prepending does. So if you wanted to influence routing beyond your neighboring AS path prepending would be the one to use.
Jon
03-17-2010
04:36 AM
- last edited on
08-25-2022
12:02 AM
by
Translator
Hello Marlon,
but if the prefixes are locally generated the as path access-list should match the empty AS path string.
This would allow you to avoid to advertise to ISP y what you have learned from ISP x and in addition to set a MED
ip as-path access-list 11 permit ^$
! matching the empty AS path
route-map SETMED permit 10
match as-path 11
set metric
Hope to help
Giuseppe
03-17-2010 03:34 AM
Marlon
When you say AS-PATH do you mean AS-PATH prepending ie adding multiple instances of your AS to the AS-PATH ?
If so the key difference between MED and path prepending is that MED is only relevant to the neighboring AS ie. it does not go beyond that. Path prepending does. So if you wanted to influence routing beyond your neighboring AS path prepending would be the one to use.
Jon
03-17-2010 04:19 AM
Yes, as-path prepending.
In my case I do not see a need to influence beyound peers.
03-17-2010 04:21 AM
Then MED will work fine and i can't see a reason to change it. Yes you need to remember to update with any new subnets but if you are summarising address ranges chances are a new subnet you add will still be part of the summarised range so you will not need any modifications.
Jon
03-17-2010
04:27 AM
- last edited on
08-25-2022
12:02 AM
by
Translator
Actually, now I see that my concern is not about MED, but in reality which 'match' I am using to determine which route to take.
So I could use MED and do:
route-map SETMED permit 10
match as-path...
So my question is, is it a better approach match the 'as-path' instead of filtering based on prefix-lists? Since the prefix-list I imagine could be something changing down the road. My rationale is that as-path seems to be a parameter that should rarely change.
03-17-2010
04:36 AM
- last edited on
08-25-2022
12:02 AM
by
Translator
Hello Marlon,
but if the prefixes are locally generated the as path access-list should match the empty AS path string.
This would allow you to avoid to advertise to ISP y what you have learned from ISP x and in addition to set a MED
ip as-path access-list 11 permit ^$
! matching the empty AS path
route-map SETMED permit 10
match as-path 11
set metric
Hope to help
Giuseppe
03-17-2010 05:00 AM
Eh, eh. It seems this one did it.
Thanks al!!
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