Wednesday, March 11, 2015

BGP max prefix

  • Router có bộ nhớ RAM và khả năng CPU xử lý có hạn nên chỉ xử lý được một lượng prefix nhận được nhất định. Max-prefix là feature nhằm hạn chế lượng prefix router nhận được.
  • Có 2 option config:
 <1-100>       Threshold value (%) at which to generate a warning msg
  restart       Restart bgp connection after limit is exceeded
  warning-only  Only give warning message when limit is exceeded
  <cr>
  • <1-100> lượng max prefix
  • Restart: sau khi router nhận lượng prefix > max-prefix => neighbor BGP chuyển sang trạng thái IDLE. Restart là time để BGP try neighbor
  • Warning-only: router sẽ  sinh ra log và lượng pre-fix vẫn được nhận xử lý

R1:
interface Loopback0
 ip address 1.1.1.1 255.255.255.0
!
interface Loopback1
 ip address 11.11.11.11 255.255.255.0
!
interface Loopback2
 ip address 111.111.111.111 255.255.255.0
!
interface FastEthernet0/0
 ip address 10.1.12.1 255.255.255.0
 !
router bgp 1
  bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 network 11.11.11.0 mask 255.255.255.0
 neighbor 10.1.12.2 remote-as 1
 ----------------------------------------------------------
 network 111.111.111.0 mask 255.255.255.0
 3 prefix advertise to IOS-XR
IOS-XR
interface GigabitEthernet0/0/0/2
 ipv4 address 10.1.12.2 255.255.255.0
router bgp 1
 bgp router-id 2.2.2.2
 address-family ipv4 unicast
 !
 neighbor 10.1.12.1
  remote-as 1
  address-family ipv4 unicast
   maximum-prefix 2 1 restart 1
!

// IOS-XR can treat only 2 prefix. If it over, neigbor go down and syslog

RP/0/0/CPU0:ios#show bgp ipv4 unicast neighbors 10.1.12.1 | i prefixes
Wed Mar 11 10:04:01.784 UTC
  2 accepted prefixes, 2 are bestpaths
  Cumulative no. of prefixes denied: 0.
  Maximum prefixes allowed 2
  Last reset 00:24:35, due to Peer exceeding maximum prefix limit (CEASE notification sent - maximum number of prefixes reached)
  Error Code: maximum number of prefixes reached



RP/0/0/CPU0:ios#RP/0/0/CPU0:Mar 11 09:39:05.287 : bgp[1047]: %ROUTING-BGP-5-MAXPFX : No. of IPv4 Unicast prefixes received from 10.1.12.1 has reached 2, max 2
RP/0/0/CPU0:Mar 11 09:39:26.735 : bgp[1047]: %ROUTING-BGP-4-MAXPFXEXCEED : No. of IPv4 Unicast prefixes received from 10.1.12.1: 3 exceed limit 2

RP/0/0/CPU0:Mar 11 09:39:26.735 : bgp[1047]: %ROUTING-BGP-5-ADJCHANGE : neighbor 10.1.12.1 Down - Peer exceeding maximum prefix limit (CEASE notification sent - maximum number of prefixes reached) (VRF: default) (AS: 1

No comments:

Post a Comment