案例一:在R1端的路由前缀进行设置标示符,在到R5去验证是否能区分? 1.设备R1上的配置: R1#sho run | s bgp router bgp 100 no synchronization bgp router-id 1.1.1.1 bgp bestpath med missing-as-worst neighbor 12.12.12.2 remote-as 2347 neighbor 12.12.12.2 send-community 发送团体属性有标准/扩展之分 neighbor 12.12.12.2 route-map ccxx-cisco out no auto-summary ip bgp-community new-format 支持新的属性格式,<1-4294967295> community number这是老的格式 R1#sho route-map ccxx-cisco route-map ccxx-cisco, permit, sequence 10 Match clauses: ip address (access-lists): 1 Set clauses: community 0:1000 100:1000 route-map ccxx-cisco, permit, sequence 14 Match clauses: ip address (access-lists): 4 Set clauses: community 100:4000 no-export route-map ccxx-cisco, permit, sequence 15 Match clauses: ip address (access-lists): 5 Set clauses: community 100:5000 no-advertise route-map ccxx-cisco, permit, sequence 16 Match clauses: ip address (access-lists): 6 Set clauses: community 0:6000 100:6000 route-map ccxx-cisco, permit, sequence 20 Match clauses: ip address (access-lists): 2 Set clauses: community 100:2000 additive
route-map ccxx-cisco, permit, sequence 30 Match clauses: ip address (access-lists): 3 Set clauses: community 100:3000 local-AS route-map ccxx-cisco, permit, sequence 40 Match clauses: Set clauses: R1: Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 0.0.0.0 0 32768 i *> 10.1.1.1/32 0.0.0.0 0 32768 i *> 10.1.1.2/32 0.0.0.0 0 32768 i *> 10.1.1.3/32 0.0.0.0 0 32768 i *> 10.1.1.4/32 0.0.0.0 0 32768 i *> 10.1.1.5/32 0.0.0.0 0 32768 i *> 10.1.1.6/32 0.0.0.0 0 32768 i 2.设备R2上查看BGP表的结果:
Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 12.12.12.1 0 0 100 i *> 10.1.1.1/32 12.12.12.1 0 0 100 i *> 10.1.1.2/32 12.12.12.1 0 0 100 i *> 10.1.1.3/32 12.12.12.1 0 0 100 i *> 10.1.1.4/32 12.12.12.1 0 0 100 i *> 10.1.1.5/32 12.12.12.1 0 0 100 i *> 10.1.1.6/32 12.12.12.1 0 0 100 I 从表中得知没有缺少什么? 3.查看R3上的BGP表:
Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 23.23.23.2 0 100 0 (22) 100 i * i5.5.5.5/32 45.45.45.5 0 100 0 500 i *> 10.1.1.1/32 23.23.23.2 0 100 0 (22) 100 i *> 10.1.1.2/32 23.23.23.2 0 100 0 (22) 100 i *> 10.1.1.4/32 23.23.23.2 0 100 0 (22) 100 i *> 10.1.1.6/32 23.23.23.2 0 100 0 (22) 100 I 少了10.1.1.3/32 10.1.1.5/32, 10.1.1.3 的属性是local-AS连小AS也不传出去。 10.1.1.5的属性是no-advertise 只传一个邻居
4.查看R4上的BGP表: Network Next Hop Metric LocPrf Weight Path *>i1.1.1.1/32 23.23.23.2 0 100 0 (22) 100 i *> 5.5.5.5/32 45.45.45.5 0 0 500 i *>i10.1.1.1/32 23.23.23.2 0 100 0 (22) 100 i *>i10.1.1.2/32 23.23.23.2 0 100 0 (22) 100 i *>i10.1.1.4/32 23.23.23.2 0 100 0 (22) 100 i *>i10.1.1.6/32 23.23.23.2 0 100 0 (22) 100 i
5.查看R5的BGP表: Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 45.45.45.4 0 2347 100 i *> 5.5.5.5/32 0.0.0.0 0 32768 i *> 10.1.1.1/32 45.45.45.4 0 2347 100 i *> 10.1.1.2/32 45.45.45.4 0 2347 100 i *> 10.1.1.6/32 45.45.45.4 0 2347 100 I 少了10.1.1.4/32 10.1.1.4的属性是no-export只在一个AS内传递(联邦除外)
5.假设不想让10.1.1.6加入R5的BGP表,应该如何解决? 在R5上做如下操作:
R5#sho ip community-list 66 Community standard list 66 deny 0:6000 100:6000 permit R5#sho route-map ccxx route-map ccxx, permit, sequence 10 Match clauses: community (community-list filter): 66 Set clauses:
router bgp 500 no synchronization bgp router-id 5.5.5.5 network 5.5.5.5 mask 255.255.255.255 neighbor 45.45.45.4 remote-as 2347 neighbor 45.45.45.4 route-map ccxx in no auto-summary ip bgp-community new-format 支持新格式 |