cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
626
Views
0
Helpful
6
Replies

Question about BGP and OSPF redistribution with AS Path-List

whistleblower14
Level 1
Level 1

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?

6 Replies 6

Yes you can use as list.

Since you have two as number you can filter as to advertise to other as.

Hi,
I´ve attached a network diagram - how the setup should look like, from the perspective of R2!

whistleblower14_0-1694957478666.jpeg

 

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

 

M02@rt37
VIP
VIP

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.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

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?

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

 

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


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Review Cisco Networking for a $25 gift card