06-23-2014 06:24 AM - edited 03-04-2019 11:12 PM
In a test/training scenario
How do I specify if i only want to receive 3 routes from an AS in BGP with the IP A.B.C.D/24 E.F.G.H/27 and W.X.Y.Z/29
06-23-2014 07:22 AM
There are a few ways, but this is how I usually do it:
! These guys define our interesting networks
ip prefix-list NETWORKS-WE-WANT seq 5 permit A.B.C.D/24
ip prefix-list NETWORKS-WE-WANT seq 10 permit E.F.G.H/27
ip prefix-list NETWORKS-WE-WANT seq 15 permit W.X.Y.Z/29
! This route map tells BGP to filter the routes according to the logic below.
route-map BGP-INGRESS permit 10
match ip address prefix-list NETWORKS-WE-WANT
route-map BGP-INGRESS deny 15
! The last statment in the route map is like an implicit deny any.
router bgp XXXX
! This actually applies the route map to incoming routes.
neighbor x.x.x.x route-map BGP-INGRESS in
06-24-2014 02:23 AM
or you can apply the prefix-list directly to the neighbor
neighbor x.x.x.x prefix-list NETWORKS-WE-WANT in
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