BGP选路规则实验
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
BGP选路规则实验
1.使R1,R2,R3,R4全网建立BGP,并且互通
(1)将R3加入BGP中
R1:
r1(config)#router bgp 1
r1(config-router)#neighbor 3.3.3.3 remote-as 1
r1(config-router)#neighbor 3.3.3.3 update-source loopback 0
R3:
r3(config)#router bgp 1
r3(config-router)#bgp router-id 3.3.3.3
r3(config-router)#neighbor 1.1.1.1 remote-as 1
r3(config-router)#neighbor 1.1.1.1 update-source loopback 0
r3(config-router)#neighbor 4.4.4.4 remote-as 4
r3(config-router)#neighbor 4.4.4.4 update-source loopback 0
r3(config-router)#neighbor 4.4.4.4 ebgp-multihop
R4:
r4(config)#router bgp 4
r4(config-router)#neighbor 3.3.3.3 remote-as 1
r4(config-router)#neighbor 3.3.3.3 update-source loopback 0
r4(config-router)#neighbor 3.3.3.3 ebgp-multihop
(2)查看R3的BGP邻居
r3#sh ip bg summary
BGP router identifier 3.3.3.3, local AS number 1
BGP table version is 4, main routing table version 4
3 network entries using 351 bytes of memory
3 path entries using 156 bytes of memory
3/2 BGP path/bestpath attribute entries using 372 bytes of memory 1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 903 total bytes of memory
BGP activity 3/0 prefixes, 3/0 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 1 7 7 4 0 0 00:02:08 1
4.4.4.4 4 4 7 5 4 0 0 00:00:08 2
r3#
说明:R3已经与其它路由器建立BGP邻居。
2.改变AS 1内部下一跳
(1)查看R1的BGP路由表
r1#sh ip bgp
BGP table version is 6, local router ID is 1.1.1.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
*> 11.1.1.0/24 0.0.0.0 0 32768 i
*>i22.2.2.0/24 2.2.2.2 0 100 0 ?
* i44.4.4.0/24 4.4.4.4 0 100 0 4 i
*>i 4.4.4.4 0 100 0 4 i
r i100.1.1.0/24 4.4.4.4 0 100 0 4 i
r>i 4.4.4.4 0 100 0 4 i
r1#
说明:因为R1都是从iBGP收到的路由,所以到达R4的路由44.4.4.0的下一跳都为4.4.4.4,而没有被R2和R3改变。
(2)改变R2与R3对R1的下一跳为自己
r2(config)#router bgp 1
r2(config-router)#neighbor 1.1.1.1 next-hop-self
r3(config)#router bgp 1
r3(config-router)#neighbor 1.1.1.1 next-hop-self
(3)再次查看R1的BGP路由表
r1#sh ip bgp
BGP table version is 8, local router ID is 1.1.1.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
*> 11.1.1.0/24 0.0.0.0 0 32768 i
*>i22.2.2.0/24 2.2.2.2 0 100 0 ?
* i44.4.4.0/24 3.3.3.3 0 100 0 4 i