BGP+MPLS 实验指导手册(3)

2020-03-27 12:50

配置方法:(对IBGP或EBGP使用)

R5(config-router)#neighbor 172.9.0.2 fall-over bfd

BGP路由的收敛:

入口队列可以存放75个queue:hold-queue 4096 in TCP包默认大小为536B,show tcp | in max

若EBGP使用直连建立邻居是可以自动发现MTU的,=1500-20B(IP包头)-20B(tcp段头) 调整TCP大小机制:

1PMTUD(Path MTU Discovery) ○

Ip tcp path-mtu-discovery :用于发现沿途最小MTU,对所有TCP连接有效。 2BGP调整: ○

Neighbor 1.1.1.1 transport path-mtu-discovery 两边都要配置,但是关闭只需在一段做即可。(只对BGP有效) 稳定以后的收敛:

根据下一跳的变化对选路的影响:

1bgp nexthop trigger enable NHT特性(默认开启) ○

2bgp nexthop route-map ABC ○

可以通过route-map判断: route-map ABC permit 10

match source-protocol rip //下一跳学习的来源 route-map ABC permit 20

match metric 1000 2000 //下一跳metric的范围

BGP路由聚合以及各参数

R1RIPR2S1/1R3R4R5

在R2上做汇总:

aggregate-address 172.9.0.0 255.255.255.0 as-set summary-only

1、as-set:可以继承local-preference属性并且继承大的,不继承MED;可以继承origin-code属性并且继承劣的属性;会继承所有的community属性;可以继承as-path属性,当明细路由带有不同的as-path属性时显示为{1,2,4,5} 该序列是无序的并且计算as-path时按1个计算。 在联邦内传递时显示为(65534,65535) ,对外的时候只有identifiy出去标识as长度算1个。 R4(config-router)#do show ip b 172.16.12.0

11

BGP routing table entry for 172.16.12.0/22, version 19 Paths: (1 available, best #1, table default) Not advertised to any peer

3 {123,5}, (aggregated by 3 172.9.0.3) //表示在AS3上由172.9.0.3聚合产生。 172.9.34.3 from 172.9.34.3 (172.9.0.3)

Origin IGP, metric 0, localpref 100, valid, external, best 若不加as-set参数:最后一行将显示

Origin IGP, metric 0, localpref 100, valid, external, atomic-aggregate, best //表示聚合的时候丢失了某些属性。

简单介绍一下建立邻居协商的参数: AFI=1:ipv4 AFI=2:ipv6 SubAFI=1:unicast 2:multicast 64:tunnel

65:4Byte AS号协商

66:mdt multicast data tree 128: vpn

2、advertise-map :用于匹配明细路由。

它对map中匹配的路由进行汇总+ as-set只会继承adv-map中匹配路由的属性+summary-only将抑制所有的明细路由。

3、 attribute-map /route-map :设置聚合路由的属性+as-set 将继承明细路由的属性与map内设置的属性。 小知识:

BGP触发更新:iBGP=5s,EBGP=30s 查看:show ip bgp nei 2.2.2.2 更改:neighbor 2.2.2.2 advertise-interval 0

BGP的各种属性,BGP选路原则,最优条件

1、prefer the highest weight

weight is a cisco specific parameter ,it is local to the router on which it is configured . 2、prefer the highest local-preference

3、origin code network > aggregate >redistribute

Prefer the path that was locally originated via a network or aggregate BGP subcommand or through

4、 Prefer the path with the shortest AS_PATH. bgp bestpath as?path ignore

5、Prefer the path with the lowest origin type. Igp>egp>?

6、Prefer the path with the lowest multi?exit discriminator (MED). 7、Prefer eBGP over iBGP paths.

8、Prefer the path with the lowest IGP metric to the BGP next hop.

9、Determine if multiple paths require installation in the routing table for BGP Multipath.

12

10、When both paths are external, prefer the path that was received first (the oldest one). bgp best path compare?routerid

11、Prefer the route that comes from the BGP router with the lowest router ID.

12、If the originator or router ID is the same for multiple paths, prefer the path with the minimum cluster list length.

13、Prefer the path that comes from the lowest neighbor address.

1.6.1 BGP选路原则

R2R1S1/1S1/1F0/0R3

该实验又称BGP绕圈实验

R2上lo1 22.22.22.22 路由宣告进bgp,r3上lo1 33.33.33.33 宣告进bgp,r1与r2,r3建立ebgp邻居,R2R3建立IBGP邻居。在r1上选择到r2走r3,到r3走r2。

首先,在刚建立BGP邻居关系以后选择的是最老的ebgp路由(选路原则第10条)。更改: bgp bestpath compare-routerid R1#show ip bgp 22.22.22.0

BGP routing table entry for 22.22.22.0/24, version 6 Paths: (2 available, best #2, table default) Advertised to update-groups:

1 //该路由将发送到那些AS上去 2

3.3.3.3 (metric 1) from 3.3.3.3 (3.3.3.3) 括号内的为对端router-id 下一跳 neighbor update-source Origin incomplete, localpref 100, valid, external

更改路由属性影响选路的方法: 1、修改weight值 第一种方法:

更改weight值(只能在ibgp/ebpg入向做,因为cisco私有只有本地有效)。 第二种方法:

1nei 3.3.3.3 weight 10 ,影响所有从该邻居学来的路由 ○

2nei 3.3.3.3 route-map set_weight 对特定邻居特定路由进行更改 ○

R1(config)#route-map set_weight

R1(config-route-map)#match ip add prefix-list 1

13

R1(config-route-map)#set weight 20

R1(config-route-map)#route-map set_weight per 20 R1(config-route-map)#ip prefix 1 per 22.22.22.0/24 第三种方法:

IGP引入BGP是修改weight

默认本地产生的路由network,redistribute,aggregate都为32768 。 2、修改local_pref(优先) Ebgp out方向不可以做,其他都可以并只在本AS内有效。默认IBGP发来的路由的local_pref是可传递的,而本地产生的或者ebgp发来的路由是不带local_pref的以本地默认值计算。可以使用show 命令产看明细路由。

1bgp default local-preference 200,对本地产生的和Ebgp路由有效。 ○

2同上○2使用route-map set local_pref 200 ○

3同上○3 ○

修改local_pref的使用地方:1、Ebgp入向。入向的map会影响本地路由器,影响出站数据流量,而出向map不影响本地R但是影响入站的数据流量。2、IGP引入BGP时使用以影响路由选择。

3、本地起源属性的修改

1neighbor 3.3.3.3 route-map r2-r3-out out ○

route-map r2-r3-out permit 10 match ip address prefix-list 1 set origin incomplete

route-map r2-r3-out permit 20

可在IBGP和EBGP出向、入向上使用。

EBGPloop0loop0S2/0AS23R2R3

R2/3运行RIP使用loop0接口建立EBGP邻居(hold time=180),在bgp中network loop0 会发生邻居关系抖动。 解决:

1使用静态路由或者修改AD ○

2在R1上network R2的loop0接口,忽略AS-path 和weight ○

3network +backdoor ,它不会修改BGP的属性,仅仅将bgp的AD修改为local 200 ,这样○

就会优选IGP路由。 4、修改AS-path属性公认必遵属性 (注意面试,网通中使用AS-path控制数据包来回的路径) 只在EBGP in/out方向使用,1-65535 ,后1024个(64512-65535)为私有AS。(As path ignor) route-map r2-r1-out permit 10 match ip address prefix-list 1 set as-path prepend 2 2

route-map r2-r1-out permit 20 1set prepend last-as <1-10> ○

Set as-path prepend 2set as-path tag ○

14

默认情况下,BGP重分布进IGP会把最前面AS-path号作为tag 带到BGP中。混淆的方法 Router bgp 9 Table-map A Route-map A Set automatic-as

Tag 是32bit而AS号是16bit的,转换方式(A000)+AS_num然后转换成10进制。

缩短AS的方式:neighbor 1.1.1.1 remove-private-as ,在ebgp出向使用(出去之前移除私有as,只能移除连续的私有as号)

neighbor 1.1.1.1 allowas-in 默认允许出现3次

bgp maxas-limit <1-2000> 允许bgp接收路由带有的AS号的数量。 3新AS号32bit 100.100方式显示 ○

两台R之间协商是在open包里面capability 131= multisession capability 65=4bytes ASN capability

Bgp asnotation dot 以点分十进制形式显示AS号

neighbor 1.1.1.1 remote-as 23456 对于不支持32bit的路由器使用 bgp bestpath as-path ignore 隐藏命令 5、origin code I>e>?

4个方向都可以做,一般使用在redistribute +route-map。 6、 修改MED (multiexit Distinct)

4个方向都可以做,相当于IGP的metric,优选小的。

1本地产生路由的MED = IGP 的metric ,默认将IGP的metric作为MED值带到BGP内好○

处是可以实现自动负载均衡。老IOS默认是不带的,修改方法: route-map set_MED Set metric-type internal

2从IBGP邻居学来路由的MED是可传递的,保持不变 ○

3从ebgp学来的路由:必须本地始发路由的med才会发给他的EBGP邻居,否则为空(以○

0处理)。

R2R1S1/1S1/1F0/0R3

R2将本地产生的路由发给R1/R3的时候带有MED值,但是r3发给r1/r3的时候MED为空。这样就导致在r1上出现了次优路径。

解决:bgp bestpath med missing-as-worst 4294967294 Bgp always-compare-med 所有的med都比,包括联邦 Bgp bestpath med confed

15


BGP+MPLS 实验指导手册(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:改革开放是历史的必然选择

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: