本文共 11141 字,大约阅读时间需要 37 分钟。
Public routing table : BGP
Destinations : 3 Routes : 3BGP routing table status : <Active>
Destinations : 3 Routes : 3Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 IBGP 255 0 RD 44.1.1.1 Serial1/0/0 6.6.6.6/32 EBGP 255 0 RD 66.1.1.1 Serial2/0/0 22.1.1.1/32 IBGP 255 0 RD 44.1.1.1 Serial1/0/0
Public routing table : BGP
Destinations : 4 Routes : 4BGP routing table status : <Active>
Destinations : 3 Routes : 3Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 EBGP 255 0 D 10.1.24.2 GigabitEthernet0/0/1 5.5.5.5/32 IBGP 255 0 RD 55.1.1.1 Serial1/0/0 6.6.6.6/32 IBGP 255 0 RD 55.1.1.1 Serial1/0/0
Public routing table : OSPF
Destinations : 14 Routes : 14OSPF routing table status : <Active>
Destinations : 14 Routes : 14Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 O_ASE 150 1 D 10.1.35.5 GigabitEthernet0/0/0
//R3的下一跳是35.5
3)MPLS 环境
标签转发1.2 BGP的同步概念同步的目的是为了在不做全互联的前提下解决BGP路由黑洞但本身是一种过时的技术(所以华为设备无法开启BGP同步)同步是IBGP和IGP路由同步,如果没有实现同步,那么结果是路由不更新给eBGP本身此时iBGP得到了11.1.1.1的路由,但是IGP没有得到,此时同步没有完成,但是却开启了同步命令router bgp 200synchronization结果是什么?结果是由于该路由不是最优的,所以不会更新给eBGP邻居R5!1--(2--3--4)--52.BGP的路由提高(产生路由)BGP的路由如何产生:1)network命令,在bgp中不用于建立邻居,只是产生路由。BGP可以network其他协议产生的路由(OSPF、rip、isis、静态、直连),这个位置有一个属性:origin属性为i;聚合方式也可以产生路由,起源属性也是i2)EGP形式,起源属性为e3)引入路由:import,起源属性为?(incomplete)3.聚合3.1 自动聚合仅仅在DV协议才存在仅仅对引入的(import)路由有效[R5]bgp 345[R5-bgp][R5-bgp]su[R5-bgp]summary au[R5-bgp]summary automatic Info: Automatic summarization is valid only for the routes imported through the import-route command.<R6>dis bgp routing-table 66.0.0.0BGP local router ID : 0.0.6.6
Local AS number : 60Paths: 1 available, 1 best, 1 selectBGP routing table entry information of 66.0.0.0/8:From: 55.1.1.1 (10.1.35.5)Route Duration: 00h02m01s Relay IP Nexthop: 10.1.56.5Relay IP Out-Interface: Serial2/0/0Original nexthop: 55.1.1.1Qos information : 0x0AS-path 345, origin incomplete, pref-val 0, valid, external, best, select, active, pre 255, IGP cost 48Aggregator: AS 345, Aggregator ID 10.1.35.53.2 增加了一种手动聚合方式利用BGP的network命令,手工产生一条汇总后的静态的汇总路由,然后再通告该路由6.6.6.6 0000,01106.6.6.9 0000,10016.6.6.0 /28[R6]ip route-static 6.6.6.0 28 NULL 0 //空接口,一个路由黑洞接口,所有到达6.6.6.0/28的数据都将被丢弃进空接口,否则将会造成带宽的浪费[R6]bgp 60[R6-bgp]network 6.6.6.0 28 //仅仅通告汇总后的静态路由,去掉明细路由,否则路由条目增多的<R5>display bgp routing-table 6.6.6.0BGP local router ID : 10.1.35.5
Local AS number : 345Paths: 1 available, 1 best, 1 selectBGP routing table entry information of 6.6.6.0/28:From: 66.1.1.1 (0.0.6.6)Route Duration: 00h06m34s Relay IP Nexthop: 10.1.56.6Relay IP Out-Interface: Serial2/0/0Original nexthop: 66.1.1.1Qos information : 0x0AS-path 60, origin igp, MED 0, pref-val 0, valid, external, best, select, active, pre 255, IGP cost 48Advertised to such 2 peers:44.1.1.133.1.1.13.3 专门的AGGREGATE聚合的前提是BGP表中存在明细路由3.3.1 直接实施,没有任何参数[R6-bgp]aggregate 6.6.6.0 28 //会生成一条聚合路由,但并不会抑制明细路由<R5>dis bgp routing-tableBGP Local router ID is 10.1.35.5
Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 21
Network NextHop MED LocPrf PrefVal Path/Ogn>i 2.2.2.2/32 44.1.1.1 0 100 0 20i> 5.5.5.5/32 0.0.0.0 0 0 i
> 6.6.6.0/28 66.1.1.1 0 60i> 6.6.6.6/32 66.1.1.1 0 0 60i*> 6.6.6.9/32 66.1.1.1 0 0 60i3.3.2 抑制明细路由,仅仅向邻居公告汇总[R6-bgp]aggregate 6.6.6.0 28 detail-suppressed <R5>dis bgp routing-tableBGP Local router ID is 10.1.35.5
Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 19
Network NextHop MED LocPrf PrefVal Path/Ogn>i 2.2.2.2/32 44.1.1.1 0 100 0 20i> 5.5.5.5/32 0.0.0.0 0 0 i
> 6.6.6.0/28 66.1.1.1 0 60i> 10.1.1.0/24 0.0.0.0 0 0 ?[R6-bgp]dis bgp rouBGP Local router ID is 0.0.6.6
Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 20
Network NextHop MED LocPrf PrefVal Path/Ogn> 2.2.2.2/32 55.1.1.1 0 345 20i> 5.5.5.5/32 55.1.1.1 0 0 345i
*> 6.6.6.0/28 127.0.0.1 0 is> 6.6.6.6/32 0.0.0.0 0 0 is> 6.6.6.9/32 0.0.0.0 0 0 i //s代表被抑制的,即没有更新给邻居的路由R5聚合后<R2>dis bgp routing-table 6.6.6.0BGP local router ID : 10.1.24.2
Local AS number : 20Paths: 1 available, 1 best, 1 selectBGP routing table entry information of 6.6.6.0/28:From: 10.1.24.4 (4.4.4.4)Route Duration: 00h00m09s Direct Out-interface: GigabitEthernet0/0/2Original nexthop: 10.1.24.4Qos information : 0x0AS-path 345, origin igp, pref-val 0, valid, external, best, select, active, pre 255Aggregator: AS 345, Aggregator ID 10.1.35.5, Atomic-aggregate //在AS345的R5聚合后丢失了as属性或者团体属性3.3.3 关于聚合之后的属性可能会改变eBGP的防环:如果在收到的bgp的as-path属性中包含和自身相同的As号码,则丢弃该路由[R5-bgp]aggregate 6.6.6.0 255.255.255.240 detail-suppressed as-set //聚合后依旧携带原有的as集合的参数,避免环路的发生以及次优的转发路径Jan 13 2018 14:46:27.729.1-08:00 R6 RM/6/RMDEBUG:BGP.Public: 55.1.1.1 MSG ignored : Looping in ASPATH value, while recv UPDATE .<R6>
Jan 13 2018 14:46:27.729.2-08:00 R6 RM/6/RMDEBUG:BGP: routes in update message need to be processed as withdrawn message due to reason mentioned above.<R6>
Jan 13 2018 14:46:27.729.3-08:00 R6 RM/6/RMDEBUG:BGP.Public: Recv UPDATE from 55.1.1.1 with following destinations :Update message length : 66 MP_reach : AFI/SAFI 1/1 Origin : IGP AS Path : 345 60 Next Hop : 55.1.1.1 BGP.Public: Recv UPDATE(Withdraw) MSG from 55.1.1.1 with following destinations : 6.6.6.0/28,
需求:
在R5上完成聚合,不能看到明细路由,R2上得到的路由的as-path为345 60Atomic_Aggregate:标识发生了路径信息的丢失。生成的聚合路由带Atomic-aggregate属性,并且不能携带原具体路由的团体属性。
Aggregator:标识路径信息丢失发生的位置3.3.4 抑制部分明细,放行汇总
[R6-bgp]aggregate 6.6.6.0 28 suppress-policy SUPPRESS //使用SUPPRESS这个路由策略来命中路由,被聚合中的suppress-policy调用,命中的路由抑制,其他路由放行!acl number 2000 rule 5 permit source 6.6.6.9 0 route-policy SUPPRESS permit node 5 if-match acl 2000[R6]dis bgp routing-tableBGP Local router ID is 0.0.6.6
Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 20
Network NextHop MED LocPrf PrefVal Path/Ogn> 2.2.2.2/32 55.1.1.1 0 345 20i> 5.5.5.5/32 55.1.1.1 0 0 345i
> 6.6.6.0/28 127.0.0.1 0 i> 6.6.6.6/32 0.0.0.0 0 0 is> 6.6.6.9/32 0.0.0.0 0 0 i //被抑制在本地的路由3.3.4聚合后的起源属性是?[R6-bgp]aggregate 6.6.6.0 255.255.255.240 suppress-policy SUPPRESS attribute-policy ATTRIBUTE //对聚合后的路由修改起源属性为egproute-policy ATTRIBUTE permit node 10 apply origin egp 123验证结果:<R5>dis bgp routing-tableBGP Local router ID is 10.1.35.5
Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 20
Network NextHop MED LocPrf PrefVal Path/Ogn>i 2.2.2.2/32 44.1.1.1 0 100 0 20i> 5.5.5.5/32 0.0.0.0 0 0 i
> 6.6.6.0/28 66.1.1.1 0 60 123e //成功> 6.6.6.6/32 66.1.1.1 0 0 60i聚合后并不能改变所有属性,常见可以修改的属性:起源和团体属性——————————————————————————————SW1和R3建立ebgp邻居,同时聚合一条6.0.0.0的路由[R4-route-policy]dis cu conf bgp[V200R003C00]#bgp 345peer 10.1.24.2 as-number 20 peer 33.1.1.1 as-number 345 peer 55.1.1.1 as-number 345 peer 55.1.1.1 connect-interface LoopBack0#ipv4-family unicastundo synchronizationaggregate 6.0.0.0 255.0.0.0 as-set detail-suppressed origin-policy ORIGIN //可以更加明晰的表明某些路由起源自哪些ASroute-policy ORIGIN permit node 10 if-match acl 2000 [R4-route-policy]dis acl allTotal quantity of nonempty ACL number is 2Basic ACL 2000, 2 rules
Acl's step is 5rule 5 permit source 6.6.6.10 0 (1 matches)rule 10 deny (2 matches)验证结果:<R2>dis bgp routing-tableBGP Local router ID is 10.1.24.2
Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 21
Network NextHop MED LocPrf PrefVal Path/Ogn> 2.2.2.2/32 0.0.0.0 0 0 i> 5.5.5.5/32 10.1.24.4 0 345i
> 6.0.0.0 10.1.24.4 0 345 30i> 6.6.6.0/28 10.1.24.4 0 345 60 123e*> 6.6.6.6/32 10.1.24.4 0 345 60i4.RR和联邦
应用场景都是管理大型BGP域的重要的技术,设计理念不同:RR是大面积的修改了iBGP的防环规则;联邦依旧遵循iBGP的防环规则4.1 实施和RR的规则角色:1)RR 2)RR的客户端 3)非客户端 bgp 345peer 10.1.30.10 as-number 30 peer 44.1.1.1 as-number 345 peer 44.1.1.1 connect-interface LoopBack0peer 55.1.1.1 as-number 345 peer 55.1.1.1 connect-interface LoopBack0#ipv4-family unicastundo synchronizationpeer 10.1.30.10 enablepeer 44.1.1.1 enablepeer 44.1.1.1 reflect-client //指定R4和R5为RR的客户端,意味着R3成为RRpeer 55.1.1.1 enablepeer 55.1.1.1 reflect-client![R5]bgp 345[R5-bgp]un peer 44.1.1.1 //不在需要全部互联4.2 RR环境下的防环规则两个新的属性:起源者Originator和簇ID,Cluster list切记:非非(非客户端之间)不传1)从非客户端收到的路由会更新给客户端和ebgp邻居[R3]dis bgp routing-table 6.6.6.6BGP local router ID : 10.1.35.3
Local AS number : 345Paths: 1 available, 1 best, 1 selectBGP routing table entry information of 6.6.6.6/32:From: 55.1.1.1 (10.1.35.5)Route Duration: 00h09m31s Relay IP Nexthop: 10.1.35.5Relay IP Out-Interface: GigabitEthernet0/0/0Original nexthop: 55.1.1.1Qos information : 0x0AS-path 60, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, best, select, active, pre 255, IGP cost 48Advertised to such 2 peers:10.1.30.1044.1.1.1 //更新给客户端2)从客户端收到的路由会更新给所有的邻居(客户端和非客户端、eBGP,不反射回该客户端)BGP local router ID : 10.1.35.3
Local AS number : 345Paths: 1 available, 1 best, 1 selectBGP routing table entry information of 2.2.2.2/32:RR-client route.From: 44.1.1.1 (4.4.4.4)Route Duration: 00h10m16s Relay IP Nexthop: 10.1.35.5Relay IP Out-Interface: GigabitEthernet0/0/0Original nexthop: 44.1.1.1Qos information : 0x0AS-path 20, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, best, select, active, pre 255, IGP cost 144Advertised to such 2 peers:10.1.30.10 //更新给ebgp55.1.1.1 //更新给非客户端4.3 层次化的RR5.团体属性
转载于:https://blog.51cto.com/enderjoe/2060601