Lab BGP Maximum-Prefix

Topology:

实验目的:理解BGP路由数量的限制。
Step 1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
Step 2、R1,R2之间运行EBGP。R1通告前四个环回口的地址。
Step 3、R2上配置前缀数量的限制。
router bgp 2
 neighbor 12.1.1.1 maximum-prefix 4 warning-only

Step 4、基于以上配置,R1只通告了4条前缀,再通告多一条。
router bgp 1
 network 172.16.4.0 mask 255.255.255.224
当配置了参数warning-only只会通知你,路由是会照样接收的。
R2#                                                                                                        
*Mar  1 02:34:41.855: %BGP-3-MAXPFXEXCEED: No. of prefix received from 12.1.1.1 (afi 0): 5 exceed limit 4  
                                                                                                           
R2#sh ip bgp                                                                                               
BGP table version is 14, local router ID is 2.2.2.2                                                        
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                                          
*> 1.1.1.1/32       12.1.1.1                 0             0 1 i                                           
*> 172.16.1.0/24    12.1.1.1                 0             0 1 i                                           
*> 172.16.2.0/25    12.1.1.1                 0             0 1 i                                           
*> 172.16.3.0/26    12.1.1.1                 0             0 1 i                                           
*> 172.16.4.0/27    12.1.1.1                 0             0 1 i                                          

Step 5、如果只配置R2(config-router)#nei 12.1.1.1 maximum-prefix 4,当超过4条前缀时就会全部抑制。
R2#                                                                                                       
*Mar  1 03:01:41.847: %BGP-3-MAXPFXEXCEED: No. of prefix received from 12.1.1.1 (afi 0): 5 exceed limit 4 
*Mar  1 03:01:41.851: %BGP-5-ADJCHANGE: neighbor 12.1.1.1 Down BGP Notification sent                      
*Mar  1 03:01:41.851: %BGP-3-NOTIFICATION: sent to neighbor 12.1.1.1 3/1 (update malformed) 0 bytes       
R2# FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0035 0200 0000 1940 0101 0040 0204 0201 0001 4003 040C        
 0101 0180 0404 0000 0000 1BAC 1004 00                                                                    

R1+++++++++++++++++++++++++++++++++++++++++++++++++


int lo 0
ip add 1.1.1.1 255.255.255.255
int lo 1
ip add 172.16.1.1 255.255.255.0
int lo 2
ip add 172.16.2.2 255.255.255.128
int lo 3
ip add 172.16.3.3 255.255.255.192

int lo 4
ip add 172.16.4.4 255.255.255.224

int e0/0
no sh
ip add 12.1.1.1 255.255.255.0

router bgp 1
 no synchronization
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 network 172.16.1.0 mask 255.255.255.0
 network 172.16.2.0 mask 255.255.255.128
 network 172.16.3.0 mask 255.255.255.192
 neighbor 12.1.1.2 remote-as 2
 no auto-summary


 
R2+++++++++++++++++++++++++++++++++++++++++++


int lo 0
ip add 2.2.2.2 255.255.255.255

int e0/0
no sh
ip add 12.1.1.2 255.255.255.0

router bgp 2
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 12.1.1.1 remote-as 1
  no auto-summary     

原文地址:https://www.cnblogs.com/cyrusxx/p/12824198.html