09-16-2023 03:03 AM - edited 09-16-2023 03:05 AM
Hi all,
I´d like to ask a question
When dealing with an AS Path-List in BGP, will that list also affect the redistribution of other protocols in BGP?
For example, I´ve a router using eBGP Peering and OSPF with redistribution and now I want to implement a new eBGP Peer and only send the BGP learned IP-Prefixes to this Peer and no OSPF learned routes! Could this be accomplished with an AS Path List?
I´ll also need to deny the advertisment of the IP Prefixes learned from this new eBGP Peer to the OSPF... maybe this could be handled with a route-map matching the AS Number from the Peer?
09-16-2023 03:29 AM
Yes you can use as list.
Since you have two as number you can filter as to advertise to other as.
09-17-2023 06:32 AM
Hi,
I´ve attached a network diagram - how the setup should look like, from the perspective of R2!
current config on R2:
router ospf 1
network R3 area 0
redistribute bgp 65011 subnets
!
!
router bgp 65011
address-family ipv4
neighbor R1 remote-as 65010
neighbor R4 remote-as 65012 --> planned!
redistribute ospf 1
default-information originate
09-16-2023 03:37 AM
Hello @whistleblower14,
AS Path-List in BGP can be used to control the routes that are advertised or received based on the AS path attribute.
Using AS path filters, you can control which routes are advertised to specific AS numbers in BGP.
09-17-2023 12:31 AM
so when I redistribute the OSPF into BGP, than e.g. an entry in the AS Path-list like “deny ^$“ can be used to prevent the announcement of the ospf learned routes?
09-18-2023 02:29 AM
Hello @whistleblower14 ,
you cannot use an AS path access list to filter OSPF routes in redistribution because OSPF routes are missing an AS path attribute so they are locally redsitributed with an empty AS path string . When advertising to an eBGP neighbor the local AS is added to the AS path attribute.
If you deny routes with an empty AS path you are denying not only OSPF redistributed prefixes but also all locally injected prefixes with the network command ( if any) if this acceptable for you you can use this method.
Hope to help
Giuseppe
09-17-2023 05:59 PM
Hello
Yes you should be able to do this with as-path filtering to advertise prefixes that originate from a specific asn to another bgp peer or when redistributing into an IGP
example
ip as-path access-list 1 permit _1111$
route-map ASN1111 permit 10
match as-path 1
BGP
router bgp xx
neighbour x.x.x.x filter-list 1 out
OSPF
router ospf 1
redistribute bgp 1 subnets route-map ASN1111
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