0

I had 2 C class IP's: xx.xx.xx.0/23.

I must advertise it on BGP protocol. My config is:

ip route xx.xx.xx.0 255.255.254.0 Null0
! access-list 50 permit xx.xx.xx.0 0.0.1.255
!
route-map RIPE permit 10
match ip address 50
set origin igp
!
router bgp YYYYY
network xx.xx.xx.0 mask 255.255.254.0
redistribute static route-map RIPE
....
no auto-summary

OK, that works, but I need to move subnet of my prefix to gateway into my network:

ip route xx.xx.xx.8 255.255.255.248 xx.xx.xx.123
ip route xx.xx.xx.16 255.255.255.240 xx.xx.xx.122

How I can prevent distribute /29 and /28 ? I should distribute only /23

RO: sh ip bgp route-map RIPE


BGP table version is 9203492, local router ID is 192.168.14.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> xx.xx.xx.0/23 0.0.0.0 0 32768 i
*> xx.xx.xx.8/29 xx.xx.xx.123 0 32768 i
*> xx.xx.xx.16/28 xx.xx.xx.132 0 32768 i


Moon
  • 3
  • 1

1 Answers1

1

Use a prefix-list instead of the straight ACL. Check out this description, set it to an exact-match of the /23 and then match on it in your route-map. The longer prefixes won't be permitted.

rnxrx
  • 8,143
  • 3
  • 22
  • 31