




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
BGP实验(三)重分布,no auto-summary, 路由聚合【实验要求】 按照拓扑需求,运行BGP协议,并实现BGP的重分布,no auto-summary和路由聚合,并对现象进行分析。【实验步骤】一、首先将R1、R2和R3的基本配置完成,使得BGP网络可达。R1(config)#int s0/0R1(config-if)#ip add 192.168.12.1 255.255.255.0R1(config-if)#no shR1(config-if)#int s0/1R1(config-if)#ip add 192.168.13.1 255.255.255.0R1(config-if)#no shR1(config-if)#int l0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config)#router os 1R1(config-router)#router-id 1.1.1.1R1(config-router)#net 1.1.1.0 0.0.0.255 a 0R1(config-router)#net 192.168.12.0 0.0.0.255 a 0R1(config-router)#router bgp 12R1(config-router)#bg router-id 1.1.1.1R1(config-router)#nei 2.2.2.2 remot 12R1(config-router)#nei 2.2.2.2 update-source l0R1(config-router)#nei 2.2.2.2 next-hop-sR1(config)#ip route 3.3.3.3 255.255.255.255 192.168.13.3R1(config)#router bgp 12R1(config-router)#nei 3.3.3.3 remot 3R1(config-router)#nei 3.3.3.3 up l0R1(config-router)#nei 3.3.3.3 ebgp-multihop 2R2(config)#int s0/0R2(config-if)#ip add 192.168.12.2 255.255.255.0R2(config-if)#no shR2(config-if)#int l0R2(config-if)#ip add 2.2.2.2 255.255.255.0R2(config-if)#no shR2(config-if)#router os 1R2(config-router)#router-id 2.2.2.2R2(config-router)#net 2.2.2.0 0.0.0.255 a 0R2(config-router)#net 192.168.12.0 0.0.0.255 a 0R2(config-router)#router bgp 12R2(config-router)#bgp router-id 2.2.2.2R2(config-router)#nei 1.1.1.1 remot 12R2(config-router)#nei 1.1.1.1 up l0R2(config-router)#nei 1.1.1.1 neR2(config-router)#nei 1.1.1.1 next-hop-sR3(config)#int s0/1R3(config-if)#ip add 192.168.13.3 255.255.255.0R3(config-if)#no shR3(config-if)#int l0R3(config-if)#ip add 3.3.3.3 255.255.255.0R3(config-if)#no shR3(config)#ip route 1.1.1.1 255.255.255.255 192.168.13.1R3(config-if)#router bgp 3R3(config-router)#bgp router-id 3.3.3.3R3(config-router)#nei 1.1.1.1 remot 12R3(config-router)#nei 1.1.1.1 up l0R3(config-router)#nei 1.1.1.1 e 2R3(config)#router bgp 3 /在R3的BGP中,宣告3.3.3.0的路由R3(config-router)#network 3.3.3.0 /在R3的BGP表中没有该路由因为3.3.3.0这条路由默认会汇总成主类路由3.0.0.0,但是在R3的路由表中不存在,所有宣告失败,必须加掩码R3(config-router)#net 3.3.3.0 mask 255.255.255.0R3#sh ip bgp /查看R3 的BGP表中,将3.3.3.0成功宣告Network Next Hop Metric LocPrf Weight Path* 3.3.3.0/24 0.0.0.0 0 32768 iR2#sh ip bgp /查看R2 的BGP表中,学习到了这条路由Network Next Hop Metric LocPrf Weight Path*i3.3.3.0/24 1.1.1.1 0 100 0 3 i二、 在R1上将OSPF重分发到BGP,并origin属性进行分析 R1(config)#router bg 12 R1(config-router)#redistribute os 1 R1#sh ip bgp /查看R1的BGP表 Network Next Hop Metric LocPrf Weight Path* 1.1.1.0/24 0.0.0.0 0 32768 ?* 2.2.2.2/32 192.168.12.2 65 32768 ?* 3.3.3.0/24 3.3.3.3 0 0 3 i* 192.168.12.0 0.0.0.0 0 32768 ??表示这条BGP路由,是通过IGP重分布学到的,重分布会携带IGP路由的metric和下一跳。R2#sh ip bgp/查看R2的BGP 表Network Next Hop Metric LocPrf Weight Path*i1.1.1.0/24 1.1.1.1 0 100 0 ?ri2.2.2.2/32 1.1.1.1 65 100 0 ?*i3.3.3.0/24 1.1.1.1 0 100 0 3 iri192.168.12.0 1.1.1.1 0 100 0 ?当一条路由同时通过IGP和iBGP学习到,选择IGP,因为iBGP的AD为200, 不会被放入路由表,用r 表示,但是这些路由是优的,带,会传给BGP邻居。R2#sh ip bgp rib-failure /查看R2的失效RIB表Network Next Hop RIB-failure RIB-NH Matches2.2.2.2/32 1.1.1.1 Own IP address n/a192.168.12.0 1.1.1.1 Higher admin distance n/a查看R1向邻居R3宣告了哪些BGP路由R1#sh ip bgp neighbors 3.3.3.3 advertised-routes Network Next Hop Metric LocPrf Weight Path* 1.1.1.0/24 0.0.0.0 0 32768 ?* 2.2.2.2/32 192.168.12.2 65 32768 ?* 192.168.12.0 0.0.0.0 0 32768 ?查看R3从邻居R1收到了哪些BGP路由R3#sh ip bgp nei 1.1.1.1 received-routes % Inbound soft reconfiguration not enabled on 1.1.1.1/默认in方向信息不保存R3(config)#router bgp 3R3(config-router)#nei 1.1.1.1 soft-reconfiguration inboundR3#sh ip bgp nei 1.1.1.1 received-routes / 再次查看R3从R1学到了哪些路由Network Next Hop Metric LocPrf Weight Path* 1.1.1.0/24 1.1.1.1 0 0 12 ?* 2.2.2.2/32 1.1.1.1 65 0 12 ?* 192.168.12.0 1.1.1.1 0 0 12 ? 三、 No auto-summary 由于路由器IOS版本较高,默认no auto-summary 在BGP进程中都有了,在R1上开启自动汇总。R1(config)#router bgp 12R1(config-router)#auto-summaryR1#sh ip bgp/查看R1的BGP表Network Next Hop Metric LocPrf Weight Path* 1.0.0.0 0.0.0.0 0 32768 ?* 2.0.0.0 0.0.0.0 0 32768 ?* 3.3.3.0/24 3.3.3.3 0 0 3 i* 192.168.12.0 0.0.0.0 0 32768 ?在BGP中auto-summary只是对于BGP重分布来说的,3.3.3.0/24仍然没有汇总。Auto-summary: 不携带IGP的下一跳和metric,下一跳改为自己0.0.0.0,Metric为0,将IGP的路由主类汇总。No auto-summary:不汇总,携带IGP的下一跳和metric,不进行汇总四、 路由聚合1. 在R3 上开启四个换回口,并用BGP宣告。R3(config)#int l10R3(config-if)#ip add 200.1.16.1 255.255.255.0R3(config-if)#int l11 R3(config-if)#ip add 200.1.17.1 255.255.255.0R3(config-if)#int l12 R3(config-if)#ip add 200.1.18.1 255.255.255.0R3(config-if)#int l13 R3(config-if)#ip add 200.1.19.1 255.255.255.0R3(config-if)#router bgp 3R3(config-router)#net 200.1.16.0 mask 255.255.255.0R3(config-router)#net 200.1.17.0 mask 255.255.255.0R3(config-router)#net 200.1.18.0 mask 255.255.255.0R3(config-router)#net 200.1.19.0 mask 255.255.255.0R1#sh ip bgp/在R1上查看BGP表,可以学到所有的明细路由 Network Next Hop Metric LocPrf Weight Path* 1.0.0.0 0.0.0.0 0 32768 ?* 2.0.0.0 0.0.0.0 0 32768 ?* 3.3.3.0/24 3.3.3.3 0 0 3 i* 192.168.12.0 0.0.0.0 0 32768 ?* 200.1.16.0 3.3.3.3 0 0 3 i* 200.1.17.0 3.3.3.3 0 0 3 i* 200.1.18.0 3.3.3.3 0 0 3 i* 200.1.19.0 3.3.3.3 0 0 3 i2. 在R3上做路由聚合R3(config-router)#aggregate-address 200.1.16.0 255.255.252.0R1#sh ip bgp /R1的BGP表中,既有明细,又有汇总Network Next Hop Metric LocPrf Weight Path* 1.0.0.0 0.0.0.0 0 32768 ?* 2.0.0.0 0.0.0.0 0 32768 ?* 3.3.3.0/24 3.3.3.3 0 0 3 i* 192.168.12.0 0.0.0.0 0 32768 ?* 200.1.16.0 3.3.3.3 0 0 3 i* 200.1.16.0/22 3.3.3.3 0 0 3 i* 200.1.17.0 3.3.3.3 0 0 3 i* 200.1.18.0 3.3.3.3 0 0 3 i* 200.1.19.0 3.3.3.3 0 0 3 iR3(config-router)#aggregate-address 200.1.16.0 255.255.252.0 summary-onlyR3#sh ip bgp Network Next Hop Metric LocPrf Weight Path* 1.0.0.0 1.1.1.1 0 0 12 ?* 2.0.0.0 1.1.1.1 0 0 12 ?* 3.3.3.0/24 0.0.0.0 0 32768 i* 192.168.12.0 1.1.1.1 0 0 12 ?s 200.1.16.0 0.0.0.0 0 32768 i* 200.1.16.0/22 0.0.0.0 32768 is 200.1.17.0 0.0.0.0 0 32768 is 200.1.18.0 0.0.0.0 0 32768 is 200.1.19.0 0.0.0.0 0 32768 is: 被聚合抑制掉的路由,不会通过给BGP邻居R1#sh ip bgp/R1的BGP表中只有汇总路由 Network Next Hop Metric LocPrf Weight Path* 1.0.0.0 0.0.0.0 0 32768 ?* 2.0.0.0 0.0.0.0 0 32768 ?* 3.3.3.0/24 3.3.3.3 0 0 3 i* 192.168.12.0 0.0.0.0 0 32768 ?* 200.1.16.0/22 3.3.3.3 0 0 3 i3. 聚合的时候挂suppress-map,使得只有200.1.16.0和200.1.17.0被抑制,放过200.1.18.0和200.1.19.0R3(config)#ip prefix-list 1 permit 200.1.16.0/23 ge 24 le 24/抓路由R3(config)#route-map jhy permit 10R3(config-route-map)#match ip address prefix-list 1 /R3(config-router)#aggregate-address 200.1.16.0 255.255.252.0 summary-only suppress-map jhy R3#sh ip bgpNetwork Next Hop Metric LocPrf Weight Path* 1.0.0.0 1.1.1.1 0 0 12 ?* 2.0.0.0 1.1.1.1 0 0 12 ?* 3.3.3.0/24 0.0.0.0 0 32768 i* 192.168.12.0 1.1.1.1 0 0 12 ?s 200.1.16.0 0.0.0.0 0 32768 i* 200.1.16.0/22 0.0.0.0 32768 is 200.1.17.0 0.0.0.0 0 32768 i* 200.1.18.0 0.0.0.0 0 32768 i* 200.1.19.0 0.0.0.0 0 32768 i/只有200.1.16.0和200.1.17.0被抑制。R1#sh ip bgp /查看R1的BGP表,达到效果Network Next Hop Metric LocPrf Weight Path* 1.0.0.0 0.0.0.0 0 32768 ?* 2.0.0.0 0.0.0.0 0 32768 ?* 3.3.3.0/24 3.3.3.3 0 0 3 i* 192.168.12.0 0.0.0.0 0 32768 ?* 200.1.16.0/22 3.3.3.3 0 0 3 i* 200.1.18.0 3.3.3.3 0 0 3 i* 200.1.19.0 3.3.3.3 0 0 3 i4. network和aggravation不在同一台路由器,即在R1上做聚合R3(config-router)# no aggregate-address 200.1.16.0 255.255.252.0 summary-only suppress-map jhy/将R3上的聚合 no 掉R1(config)# router bg 12 R1(config-router)#aggregate-address 200.1.16.0 255.255.252.0 summary-only R1#sh ip bgpNetwork Next Hop Metric LocPrf Weight Path* 1.0.0.0 0.0.0.0 0 32768 ?* 2.0.0.0 0.0.0.0 0 32768 ?* 3.3.3.0/24 3.3.3.3 0 0 3 i* 192.168.12.0 0.0.0.0 0 32768 ?s 200.1.16.0 3.3.3.3 0 0 3 i* 200.1.16.0/22 0.0.0.0 32768 is 200.1.17.0 3.3.3.3 0 0 3 is 200.1.18.0 3.3.3.3 0 0 3 is 200.1.19.0 3.3.3.3 0 0 3 i在R1上,明细路由都被抑制掉了,只有汇总路由宣告出去,汇总路由的AS起点是本ASR2#sh ip bgpNetwork Next Hop Metric LocPrf Weight Path*i1.0.0.0 1.1.1.1 0 100 0 ?*i2.0.0.0 1.1.1.1 0 100 0 ?*i3.3.3.0/24 1.1.1.1 0 100 0 3 iri192.168.12.0 1.1.1.1 0 100 0 ?*i200.1.16.0/22 1.1.1.1 0 100 0 iR3#sh ip bgp/在R3上重新学习到了这条汇总路由 Network Next Hop Metric LocPrf Weight Path* 1.0.0.0 1.1.1.1 0 0 12 ?* 2.0.0.0 1.1.1.1 0 0 12 ?* 3.3.3.0/24 0.0.0.0 0 32768 i* 192.168.12.0 1.1.1.1 0 0 12 ?* 200.1.16.0 0.0.0.0 0 32768 i* 200.1.16.0/22 1.1.1.1 0 0 12 i* 200.1.17.0 0.0.0.0 0 32768 i* 200.1.18.0 0.0.0.0 0 32768 i* 200.1.19.0 0.0.0.0 0 32768 i在R1上汇总的汇总路由,不携带原来的BGP路由属性,如AS,所有当这条汇总路由回传给R3时,EBGP水平分割没有作用。R1(config)# route
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025福建泉州市泉港区部分公办学校专项招聘编制内新任教师17人(二)模拟试卷有完整答案详解
- 2025福建三明市清流县金星园建设发展有限公司招聘消防驾驶员2人模拟试卷及一套参考答案详解
- 2025贵州天柱县第二季度(第一次)拟招聘8个全日制城镇公益性岗位考前自测高频考点模拟试题及1套完整答案详解
- 2025年度上饶市广信区公安局面向社会公开招聘编制外聘用人员考前自测高频考点模拟试题及答案详解(历年真题)
- 2025年甘肃省陇南市徽县招聘城镇公益性岗位人员26人考前自测高频考点模拟试题附答案详解
- 2025年潍坊诸城市市属国有企业公开招聘工作人员(9名)模拟试卷附答案详解(突破训练)
- 2025广东深圳市宝安区陶园中英文实验学校招聘精英教师16人模拟试卷及一套答案详解
- 2025湖南张家界市公安局招聘警务辅助人员360人模拟试卷及完整答案详解一套
- 2025年西安市灞桥区纺织城小学教师招聘模拟试卷及答案详解(典优)
- 2025年宁波市北仑区大榭街道社区卫生服务中心招聘编外工作人员3人模拟试卷及答案详解参考
- 潮汕美食课件
- 2025年云南省公务员公开遴选笔试试题及答案(综合类)
- 2023年中级统计师《统计工作实务》试题真题及答案
- 2025年专题讲座-纪念抗战胜利80周年93阅兵
- 新概念英语第二册+Lesson+46+A+clear+conscience+讲义
- 【获奖教学课件】小学综合实践活动创建自己的阅读银行-“阅读存折”设计方案2
- 中北大学简介
- GB/T 5656-2008离心泵技术条件(Ⅱ类)
- 原发性肝癌规范化病理诊断指南课件
- 剑桥少儿英语三级 词汇表
- (完整版)污水处理厂施工组织设计
评论
0/150
提交评论