cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
389
Views
3
Helpful
2
Replies

BGP inbound route learning filtering

Yuvi1983
Level 1
Level 1

Hi Community, 

I am facing some issues on the route learning via EBGP.

I like to receive only specific prefixes from PE, e.g. 10.61.128.0/22

I like to advertise only specific prefixes to PE, e.g. 10.50.120./22 

#Adverstise to VENDOR
ip prefix-list vendor-advertise seq 5 permit 10.50.120.0/22

#Receive only specific prefix from VENDOR
ip prefix-list vendor-receive seq 5 permit 10.61.128.0/22

route-map vendor-advertise permit 10
match ip address prefix-list vendor-advertise

route-map vendor-receive permit 20
match ip address prefix-list vendor-receive

 

#BGP configurations
router bgp 64512
neighbor 192.168.252.2 remote-as 394566 >>>> CORE
neighbor 192.168.254.1 remote-as 13979 >>>> PE >> Attached topology below for ref

address-family ipv4
neighbor 192.168.252.2 activate
neighbor 192.168.252.2 soft-reconfiguration inbound
neighbor 192.168.254.1 activate
neighbor 192.168.254.1 soft-reconfiguration inbound

neighbor 192.168.254.1 route-map vendor-receive in   
neighbor 192.168.254.1 route-map vendor-advertise out
exit-address-family

 


#I can see the advertised routes are looking good
R1#sh ip bgp neighbors 192.168.254.1 advertised-routes
BGP table version is 1061, local router ID is 10.254.0.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path, L long-lived-stale,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
*> 10.50.120.0/24 192.168.252.2 0 0 394566 ?
*> 10.50.121.0/24 192.168.252.2 11 0 394566 ?

Total number of prefixes 2
R1#


# I see many routes learning via PE router, 
R1#sh ip bgp neighbors 192.168.254.1 received-routes
Network Next Hop Metric LocPrf Weight Path
* 10.105.0.0/22 192.168.254.1 0 13979 12076 i
* 10.105.0.0/16 192.168.254.1 0 13979 12076 i
* 10.105.4.0/24 192.168.254.1 0 13979 12076 i
* 10.106.0.0/22 192.168.254.1 0 13979 12076 i
* 10.106.0.0/16 192.168.254.1 0 13979 12076 i
* 10.107.0.0/22 192.168.254.1 0 13979 12076 i
* 10.107.0.0/16 192.168.254.1 0 13979 12076 i
* 10.107.4.0/24 192.168.254.1 0 13979 12076 i
* 10.107.5.0/24 192.168.254.1 0 13979 12076 i
* 10.107.10.0/24 192.168.254.1 0 13979 12076 i
* 10.108.0.0/22 192.168.254.1 0 13979 12076 i
* 10.108.0.0/16 192.168.254.1 0 13979 12076 i


How do I receive only specific prefixes from PE please? 10.61.128.0/22

Thanks ..Yuvi

 Topology 

Yuvi1983_0-1731934876152.png

 

 

 

2 Accepted Solutions

Accepted Solutions

@Yuvi1983 

 On the received, try to deny the rest

 

ip prefix-list vendor-receive seq 5 permit 10.61.128.0/22

ip prefix-list vendor-receive  seq 10 deny 0.0.0.0/0 le 32

View solution in original post

Harold Ritter
Spotlight
Spotlight

Hi @Yuvi1983 ,

2 things to consider.

1. "ip prefix-list vendor-advertise seq 5 permit 10.50.120.0/22" will only allow the specific /22, not the more specific /24. If you want to allow the more specific /24, you need to configure the following instead.

ip prefix-list vendor-advertise seq 5 permit 10.50.120.0/22 le 24

2. You should always do a "clear bgp ipv4 uni * soft <in|out>" to force the readvertisement of inbound and outbound advertisement after changing the BGP routing policy.

Regards,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)

View solution in original post

2 Replies 2

@Yuvi1983 

 On the received, try to deny the rest

 

ip prefix-list vendor-receive seq 5 permit 10.61.128.0/22

ip prefix-list vendor-receive  seq 10 deny 0.0.0.0/0 le 32

Harold Ritter
Spotlight
Spotlight

Hi @Yuvi1983 ,

2 things to consider.

1. "ip prefix-list vendor-advertise seq 5 permit 10.50.120.0/22" will only allow the specific /22, not the more specific /24. If you want to allow the more specific /24, you need to configure the following instead.

ip prefix-list vendor-advertise seq 5 permit 10.50.120.0/22 le 24

2. You should always do a "clear bgp ipv4 uni * soft <in|out>" to force the readvertisement of inbound and outbound advertisement after changing the BGP routing policy.

Regards,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)