CCNP第十五讲BGP的属性.docx

上传人:b****2 文档编号:3247762 上传时间:2023-05-05 格式:DOCX 页数:17 大小:586.21KB
下载 相关 举报
CCNP第十五讲BGP的属性.docx_第1页
第1页 / 共17页
CCNP第十五讲BGP的属性.docx_第2页
第2页 / 共17页
CCNP第十五讲BGP的属性.docx_第3页
第3页 / 共17页
CCNP第十五讲BGP的属性.docx_第4页
第4页 / 共17页
CCNP第十五讲BGP的属性.docx_第5页
第5页 / 共17页
CCNP第十五讲BGP的属性.docx_第6页
第6页 / 共17页
CCNP第十五讲BGP的属性.docx_第7页
第7页 / 共17页
CCNP第十五讲BGP的属性.docx_第8页
第8页 / 共17页
CCNP第十五讲BGP的属性.docx_第9页
第9页 / 共17页
CCNP第十五讲BGP的属性.docx_第10页
第10页 / 共17页
CCNP第十五讲BGP的属性.docx_第11页
第11页 / 共17页
CCNP第十五讲BGP的属性.docx_第12页
第12页 / 共17页
CCNP第十五讲BGP的属性.docx_第13页
第13页 / 共17页
CCNP第十五讲BGP的属性.docx_第14页
第14页 / 共17页
CCNP第十五讲BGP的属性.docx_第15页
第15页 / 共17页
CCNP第十五讲BGP的属性.docx_第16页
第16页 / 共17页
CCNP第十五讲BGP的属性.docx_第17页
第17页 / 共17页
亲,该文档总共17页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

CCNP第十五讲BGP的属性.docx

《CCNP第十五讲BGP的属性.docx》由会员分享,可在线阅读,更多相关《CCNP第十五讲BGP的属性.docx(17页珍藏版)》请在冰点文库上搜索。

CCNP第十五讲BGP的属性.docx

CCNP第十五讲BGP的属性

BGP的属性

公认强制属性:

1.ASpath2.Next-hop3.Origin4.local5.preference6.MEDothers

修改起源属性:

R1(config)#routerbgp1

R1(config-router)#bgprouter-id1.1.1.1

R1(config-router)#nosynchronization

R1(config-router)#noauto-summary

R1(config-router)#neighbors12.1.1.2remote-as1

R1(config-router)#network1.1.1.0mask255.255.255.0

R2(config)#routerbgp1

R2(config-router)#bgprouter-id2.2.2.2

R2(config-router)#nosynchronization

R2(config-router)#noauto-summary

R2(config-router)#neighbor12.1.1.1remote-as1

R2#clearipbgp*soft

R2#showipbgp

R2(config)#ipprefix-list10permit1.1.1.0/24

R2(config)#route-mapOpermit10

R2(config-route-map)#matchipaddressprefix-list10

R2(config-route-map)#setoriginegp1

R2(config)#route-mapOpermit20

R2(config)#routerbgp1

R2(config-router)#neighbor12.1.1.1route-mapOin

R2#clearipbgp*soft

R2#showipbgp

BGP的属性

路由选择策略:

1.权重属性

传递范围:

该属性只能在路由器本地有意义,在该路由器本地BGP表中该路由器的缺省weight值为32768

如果该路由是邻居通告的,无论IBGP还是EBGP,都是缺省为0,如果该路由器是本地通告,但是来源于IGP,则该路由器缺省权重也是0.

权重取值范围:

0-65535

比较方式:

weight属性值越大,该路由器条目越优。

在AS1内网运行EIGRP

R1(config)#routereigrp90

R1(config-router)#network1.1.1.10.0.0.0

R1(config-router)#network13.1.1.10.0.0.0

R2(config)#routereigrp90

R2(config-router)#network2.2.2.20.0.0.0

R2(config-router)#network23.1.1.20.0.0.0

R3(config)#routereigrp90

R3(config-router)#network3.3.3.30.0.0.0

R3(config-router)#network13.1.1.30.0.0.0

R3(config-router)#network23.1.1.30.0.0.0

运行BGP

R1(config)#routerbgp1

R1(config-router)#bgprouter-id1.1.1.1

R1(config-router)#nosynchronization

R1(config-router)#exit

R1(config)#routerbgp1

R1(config-router)#routerbgp1

R1(config-router)#exit

R1(config)#routerbgp1

R1(config-router)#bgprouter-id1.1.1.1

R1(config-router)#nosynchronization

R1(config-router)#noauto-summary

R1(config-router)#neighbor14.1.1.4remote-as4

R1(config-router)#neighbor3.3.3.3remote-as1

R1(config-router)#neighbor3.3.3.3update-sourceloopback0

R1(config-router)#neighbor3.3.3.3next-hop-self

R2(config)#routerbgp1

R2(config-router)#bgprouter-id2.2.2.2

R2(config-router)#nosynchronization

R2(config-router)#noauto-summary

R2(config-router)#neighbor24.1.1.4remote-as4

R2(config-router)#neighbor3.3.3.3remote-as1

R2(config-router)#neighbor3.3.3.3update-sourceloopback0

R3(config)#routerbgp1

R3(config-router)#bgprouter-id3.3.3.3

R3(config-router)#nosynchronization

R3(config-router)#noauto-summary

R3(config-router)#neighbor1.1.1.1remote-as1

R3(config-router)#neighbor1.1.1.1update-sourceloopback0

R3(config-router)#neighbor2.2.2.2remote-as1

R3(config-router)#neighbor2.2.2.2update-sourceloopback0

R4(config)#routerbgp4

R4(config-router)#bgprouter-id4.4.4.4

R4(config-router)#nosynchronization

R4(config-router)#noauto-summary

R4(config-router)#neighbor14.1.1.1remote-as1

R4(config-router)#neighbor24.1.1.2remote-as1

R4(config-router)#network4.4.4.0mask255.255.255.0

R3#showipbgp

此时R3去往4.4.4.0/24的网段优选R1,因为R3的路由表有1.1.1.1路由而没有24.1.1.4路由。

此时在R2上配置:

R2(config)#routerbgp1

R2(config-router)#neighbor3.3.3.3next-hop-self

此时R3去往4.4.4.0/24的网段选R2,原因是根据选路原则第8条。

PreferthepaththroughtheclosestIGPneighbor

R1与R3之间是串口连接,带宽1.544M,R2与R3之间时以太网线连接,带宽100M,R2距离R3较近。

到R2的度量值较小。

现在通过修改权重,让路由优选R1。

由于权重只具有本地意义,所以只能在R3上进行修改。

R3(config)#routerbgp1

R3(config-router)#neighbor1.1.1.1weight1

R3#clearIpbgp*soft

R3#showipbgp

此时R3去往4.4.4.0/24选R1。

现在再R4上在创建环回口

R4(config)#intloopback8

R4(config-if)#ipaddress8.8.8.8255.255.255.0

R4(config)#routerbgp4

R4(config-router)#network8.8.8.0mask255.255.255.0

R4#clearipbgp*soft

R3#clearipbgp*soft

偶发现R3到R4的任何网段都选择了R1,说明:

该命令R3(config-router)#neighbor1.1.1.1weight1的作用是从该邻居收到的任何BGP路由的weight值都改为1,然后加入路由表。

这是一种不精确的修改。

方法二:

route-map精确修改

R3(config)#routerbgp1

R3(config-router)#noneighbor1.1.1.1weight1

R3(config)#ipprefix-list10permit4.4.4.0/24

R3(config)#route-mapWeightpermit10

R3(config-route-map)#matchipaddressprefix-list10

R3(config-route-map)#setweight1

R3(config)#route-mapWeightpermit20

R3(config)#routerbgp1

R3(config-router)#neighbor1.1.1.1route-mapWeightin

R3#clearipbgp*soft

R3#showipbgp

2.本地优先级属性

传递范围:

只能在AS内传递(只能在传递IBGP路由的时候修改)

缺省值为100:

只要是BGP路由,无论是否本地产生,无论是否EBGP,无论是否IBGP路由缺省值都为100

本地优先级的值越大,越优,值越小越差。

网络需求:

让R3去往4.4.4.0/24网段选R1,去往8.8.8.0/24选R2路径。

解决方法:

通过修改本地优先级,改变路由选径。

R1(config)#routerbgp1

R1(config-router)#bgpdefaultlocal-preference101

R1#clearipbgp*soft

R1#showipbgp4.4.4.0255.255.255.0

R1#showipbgp8.8.8.0255.255.255.0

R1(config-router)#bgpdefaultlocal-preference101该命令会影响EBGP路由,但是不会影响IBGP路由。

使用route-map精确选路。

R1(config)#ipprefix-list10permit4.4.4.0/24

R1(config)#route-mapLocalprepermit10

R1(confg-route-map)#matchipaddressprefix-list10

R1(config-route-map)#setlocal-preference101

R1(config)#route-mapLocalprepermit20

R1(config)#routerbgp1

R1(config-router)#neighbor14.1.1.4route-mapLocalprein

R1#clearipbgp*soft

R1#showipbgp

R3#clearipbgp*soft

R3#showipbgp

3.本地路优先属性(next-hop0.0.0.0)

R3(config)#iproute10.10.10.0255.255.255.0null0

R3(config)#routerbgp1

R3(config-router)#network10.10.10.0mask255.255.255.0

R3(config-router)#neighbor1.1.1.1weight32768

R3(config-router)#redistributestatic

R1(config)#intloopback10

R1(config-if)#ipaddress10.10.10.1255.255.255.0

R1(config)#routerbgp1

R1(config-router)#network10.10.10.0mask255.255.255.0

R3#clearIpbgp*soft

R3#showipbgp

4.AS_path属性

设计需求:

R5去往4.4.4.0走R1,去往8.8.8.0走R2

解决方案:

在R4上出向调用route-map

R4(config)#access-list10permit4.4.4.0/24

R4(config)#route-mapAPpermit10

R4(config-route-map)#matchipaddress10

R4(config-route-map)#setas-pathperpend5678

R4(config)#route-mapAPpermit20

R4(config)#routebgp4

R4(config-route)#neighbor24.1.1.2route-mapAPout

R4#clearipbgp*soft

R2#showipbgp

方法二:

在R2上做入向调用

R2(config)#access-list10permit4.4.4.0

R2(config)#route-mapAPpermit10

R2(config-route-map)#matchipaddress10

R2(config-route-map)#setas-pathprepend5678

R2(config)#route-mapAPpermit20

R2(config)#routerbgp1

R2(config-route)#neighbor24.1.1.4route-mapAPin

R2#clearipbgp*soft

R2#showipbgp

我们知道As-path的属性可以在整个internet中传递,但是R5上却收不到添加的属性。

R5#showipbgp

原因是由于水平分割原则,EBGP路由器不接受带有本地AS号的路由。

那么该如何解决呢?

方案如下:

R2(config)#access-list10permit4.4.4.0

R2(config)#route-mapAPpermit10

R2(config-route-map)#matchipaddress10

R2(config-route-map)#setas-pathprepend4444

R2(config)#route-mapAPpermit20

R2(config)#routerbgp1

R2(config-route)#neighbor24.1.1.4route-mapAPin

R2#clearipbgp*soft

R2#showipbgp

在网络中限制AS-path的最长跳数

R2(config)#routerbgp1

R2(config-router)#bgpmaxas-limit10//指定R2接收到的路由AS号最多包涵10个。

5.Preferlowestorigincode(IGP

起源属性在整个internet域内传递。

R4(config)#ipprefix-list10permit4.4.4.0/24

R4(config)#route-mapOpermit10

R4(config-route-map)#matchipaddressprefix-list10

R4(config-route-map)#setoriginincomplete

R4(config)#route-mapOpermit20

R4#clearipbgp*soft

R4#showipbgp

6.PreferthelowestMED(exchangebetweenautosystem)

MED(多出口鉴别器)只能在直连的邻居的一跳AS域内传递。

只能在EBGP传递路由的时候出方向修改。

缺省值:

IETF标准:

为最大值CISCO标准:

0

比较值越小越优。

MED用于通告EBGP邻居如何从对端AS到达本AS。

R1(config)#access-list10permit3.3.3.0

R1(config)#route-mapMEDpermit30

R1(config-route-map)#matchipaddress10

R1(config-route-map)#setmetric10

R1(config)#route-mapMEDpermit40

R1#clearipbgp*soft

上比较来自相同AS邻居的相同路由,

R4(config)#routerbgp4

R4(config-router)#bgpalways-compare-med

使用上面的命令比较来自不同AS邻居的相同路由

R4(config)#routerbgp4

R4(config-router)#bgpbest-pathas-pathignore

默认情况如果一条路由的MED的值没有设置,那么该路由MED值为最大值。

必须要在所有路由器上都进行配置。

R4(config)#routerbgp4

R4(config-router)#bgpbestpathmedmissing-as-worst

如果前6项相同就比较下面几项

在这11步选路原则中前6项可控性比较强,AS_path一般不建议使用,通常建议使用第2、6两项。

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2