交换路由CCIE之路BGP路由过滤剖析.docx

上传人:b****3 文档编号:26604434 上传时间:2023-06-20 格式:DOCX 页数:19 大小:40.60KB
下载 相关 举报
交换路由CCIE之路BGP路由过滤剖析.docx_第1页
第1页 / 共19页
交换路由CCIE之路BGP路由过滤剖析.docx_第2页
第2页 / 共19页
交换路由CCIE之路BGP路由过滤剖析.docx_第3页
第3页 / 共19页
交换路由CCIE之路BGP路由过滤剖析.docx_第4页
第4页 / 共19页
交换路由CCIE之路BGP路由过滤剖析.docx_第5页
第5页 / 共19页
点击查看更多>>
下载资源
资源描述

交换路由CCIE之路BGP路由过滤剖析.docx

《交换路由CCIE之路BGP路由过滤剖析.docx》由会员分享,可在线阅读,更多相关《交换路由CCIE之路BGP路由过滤剖析.docx(19页珍藏版)》请在冰豆网上搜索。

交换路由CCIE之路BGP路由过滤剖析.docx

交换路由CCIE之路BGP路由过滤剖析

实验BGP路由过滤

一实验拓扑图

二实验要求:

(1)要求RT2只将自己的路由传到RT5

(2)熟练掌握各种过滤方式

(3)了解正则表达式

三实验分析

前提:

在四个路由器分别注入10.1.0.0/1610.2.0.0/1610.3.0.0/1610.5.0.0/16

首先分析RT5中BGP表内路由,关于10.3.0.0/16有两条下一跳分别为10.0.15.110.0.25.1最佳下一跳是10.0.15.1关于10.1.0.0/16有两条下一跳分别为10.0.15.110.0.25.1最佳下一跳是10.0.15.1关于10.2.0.0有两条下一跳分别为10.0.15.110.0.25.1最佳下一跳是10.0.25.1

关于10.5.0.0有一条下一跳0.0.0.0

(1)利用分发列表过滤

要是RT2只传自己的可以在出口方向只允许自己的路由出去就行了。

(2)利用前缀列表过滤

只允许10.2.0.0/16从S0/1过就可以了

(3)利用AS过滤:

只需要用^$应该就能达到目的。

为了熟悉正则表达式中不同符号的运用后面还会通过实验具体分析举例

(4)利用route-map的匹配动作匹配

(1)中acl就行了。

这里还会要具体分析acl与prefix-list分别为空时发布后的结果,以及分发列表,前缀列表,filter-list,route-map为空时动作后的结果。

四具体实验

基本配置及连通性测试

RT1

r1(config#intlo0

r1(config-if#ipad10.1.0.1255.255.255.255

r1(config-if#ints0/0

r1(config-if#ipad10.0.13.1255.255.255.252

r1(config-if#noshu

r1(config-if#ints0/2

r1(config-if#ipad10.0.15.1255.255.255.252

r1(config-if#noshu

r1(config-if#intf1/0

r1(config-if#ipad10.0.12.1255.255.255.252

r1(config-if#noshu

r1(config#intlo1

r1(config-if#ipad10.1.1.1255.255.255.0

r1(config-if#end

RT2

r2(config#intlo0

r2(config-if#ipad10.2.0.1255.255.255.255

r2(config-if#ints0/1

r2(config-if#ipad10.0.25.1255.255.255.252

r2(config-if#noshu

r2(config-if#intf1/0

r2(config-if#ipad10.0.12.2255.255.255.252

r2(config-if#noshu

r2(config-if#end

r2(config#intlo1

r2(config-if#ipad10.2.1.1255.255.255.0

r2(config-if#end

RT3

r3(config#intlo0

r3(config-if#ipad10.3.0.1255.255.255.255

r3(config-if#ints0/0

r3(config-if#ipad10.0.13.2255.255.255.252

r3(config-if#noshu

r3(config-if#inte3/0

r3(config-if#ipad10.3.1.1255.255.255.0

r3(config-if#noke

r3(config-if#noshu

r3(config-if#end

RT5

r5(config#intlo0

r5(config-if#ipad10.5.0.1255.255.255.255

r5(config-if#ints0/1

r5(config-if#ipad10.0.25.2255.255.255.252

r5(config-if#noshu

r5(config-if#ints0/0

r5(config-if#ipad10.0.15.2255.255.255.252

r5(config-if#noshu

r5(config-if#inte3/0

r5(config-if#ipad10.5.1.1255.255.255.0

r5(config-if#noke

r5(config-if#noshu

r5(config-if#end

连通性测试

r1#ping10.0.12.2

Typeescapesequencetoabort.

Sending5,100-byteICMPEchosto10.0.12.2,timeoutis2seconds:

!

!

!

!

!

Successrateis100percent(5/5,round-tripmin/avg/max=12/42/92ms

r1#ping10.0.13.2

Typeescapesequencetoabort.

Sending5,100-byteICMPEchosto10.0.13.2,timeoutis2seconds:

!

!

!

!

!

Successrateis100percent(5/5,round-tripmin/avg/max=4/36/96ms

r1#ping10.0.15.2

Typeescapesequencetoabort.

Sending5,100-byteICMPEchosto10.0.15.2,timeoutis2seconds:

!

!

!

!

!

r5#ping10.0.25.1

Typeescapesequencetoabort.

Sending5,100-byteICMPEchosto10.0.25.1,timeoutis2seconds:

!

!

!

!

!

Successrateis100percent(5/5,round-tripmin/avg/max=12/90/256ms

邻居建立及路由注入

r1(config#routerbgp65001

r1(config-router#nosynchronization

r1(config-router#noau

r1(config-router#neighbor10.0.12.2remote-as65002

r1(config-router#neighbor10.0.13.2remote-as65003

r1(config-router#neighbor10.0.15.2remote-as65005

r1(config-router#end

r2(config#routerbgp65002

r2(config-router#nosynchronization

r2(config-router#noau

r2(config-router#neighbor10.0.12.1remote-as65001

r2(config-router#neighbor10.0.25.2remote-as65005

r2(config-router#end

r3(config#routerbgp65003

r3(config-router#nosynchronization

r3(config-router#noau

r3(config-router#nei10.0.13.1remote-as65001

r3(config-router#end

r5(config#routerbgp65005

r5(config-router#nosynchronization

r5(config-router#noau

r5(config-router#nei10.0.15.1remote-as65001

r5(config-router#nei10.0.25.1remote-as65002

r5(config-router#end

r1#showipbgpsummary

BGProuteridentifier10.1.1.1,localASnumber65001

BGPtableversionis1,mainroutingtableversion1

NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd

10.0.12.24650024410000:

01:

140

10.0.13.24650033310000:

00:

390

10.0.15.24650052410000:

00:

000

r1(config#iproute10.1.0.0255.255.0.0null0

r1(config#routerbgp65001

r1(config-router#network10.1.0.0mask255.255.0.0

r1(config-router#end

r2(config#iproute10.2.0.0255.255.0.0null0

r2(config#routerbgp65002

r2(config-router#net10.2.0.0mask255.255.0.0

r2(config-router#end

r3(config#iproute10.3.0.0255.255.0.0null0

r3(config#routerbgp65003

r3(config-router#net10.3.0.0mask255.255.0.0

r3(config-router#end

r5(config#iproute10.5.0.0255.255.0.0null0

r5(config#routerbgp65005

r5(config-router#net10.5.0.0mask255.255.0.0

r5(config-router#end

r5#showipbgp

BGPtableversionis5,localrouterIDis10.5.0.1

Statuscodes:

ssuppressed,ddamped,hhistory,*valid,>best,i-internal,

rRIB-failure,SStale

Origincodes:

i-IGP,e-EGP,?

-incomplete

NetworkNextHopMetricLocPrfWeightPath

*10.1.0.0/1610.0.25.106500265001i

*>10.0.15.10065001i

*10.2.0.0/1610.0.15.106500165002i

*>10.0.25.10065002i

*10.3.0.0/1610.0.25.10650026500165003i

*>10.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

现在让RT2只传自己发出的

r2(config#access-list1permit10.2.0.00.0.255.255

r2(config#routerbgp65002

r2(config-router#nei10.0.25.2distribute-list1out//利用分发列表

r2(config-router#exit

r5#showipbgp

BGPtableversionis5,localrouterIDis10.5.0.1

NetworkNextHopMetricLocPrfWeightPath

*>10.1.0.0/1610.0.15.10065001i

*10.2.0.0/1610.0.15.106500165002i

*>10.0.25.10065002i//只有这一条从RT2过来

*>10.3.0.0/1610.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

r2(config-router#nonei10.0.25.2distribute-list1out

r2(config#ipprefix-list1permit10.2.0.0/16//匹配10.2.0.0/16这条路由

r2(config#routerbgp65002

r2(config-router#nei10.0.25.2prefix-list1out

r5#showipbgp

BGPtableversionis5,localrouterIDis10.5.0.1

NetworkNextHopMetricLocPrfWeightPath

*>10.1.0.0/1610.0.15.10065001i

*10.2.0.0/1610.0.15.106500165002i

*>10.0.25.10065002i

*>10.3.0.0/1610.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

r2(config-router#nonei10.0.25.2prefix-list1out

r2(config#ipas-pathaccess-list1permit^$//匹配由自己始发的路由

r2(config#routerbgp65002

r2(config-router#nei10.0.25.2filter-list1out

r5#showipbgp

BGPtableversionis5,localrouterIDis10.5.0.1

NetworkNextHopMetricLocPrfWeightPath

*>10.1.0.0/1610.0.15.10065001i

*10.2.0.0/1610.0.15.106500165002i

*>10.0.25.10065002i

*>10.3.0.0/1610.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

r2(config-router#nonei10.0.25.2filter-list1out

r2(config#route-mapfuckjiugepermit10

r2(config-route-map#matchas-path1//匹配as-path1的动作

r2(config-route-map#exit

r2(config#routerbgp65002

r2(config-router#nei10.0.25.2route-mapfuckjiugeout

r5#showipbgp

BGPtableversionis5,localrouterIDis10.5.0.1

NetworkNextHopMetricLocPrfWeightPath

*>10.1.0.0/1610.0.15.10065001i

*10.2.0.0/1610.0.15.106500165002i

*>10.0.25.10065002i

*>10.3.0.0/1610.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

现在通过发布各种空列表观察会出现的结果

r2(config-router#nonei10.0.25.2route-mapfuckjiugeout

r2(config#route-mapaaapermit10

r2(config-route-map#matchipad2//这里的ACL2没有建立

r2(config-route-map#end

r2(config#routerbgp65002

r2(config-router#nei10.0.25.2route-mapaaaout

r5#showipbgp

BGPtableversionis5,localrouterIDis10.5.0.1

NetworkNextHopMetricLocPrfWeightPath

*10.1.0.0/1610.0.25.106500265001i

*>10.0.15.10065001i

*10.2.0.0/1610.0.15.106500165002i

*>10.0.25.10065002i

*10.3.0.0/1610.0.25.10650026500165003i

*>10.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

观察发现为允许所有

r2(config-router#nonei10.0.25.2route-mapaaaout

r2(config#route-mapbbbpermit10

r2(config-route-map#matchipadprefix-list2//这里的前缀列表也没有建立

r2(config-route-map#exit

r2(config#routerbgp65002

r2(config-router#nei10.0.25.2route-mapbbbout

r5#showipbgp

BGPtableversionis5,localrouterIDis10.5.0.1

NetworkNextHopMetricLocPrfWeightPath

*10.1.0.0/1610.0.25.106500265001i

*>10.0.15.10065001i

*10.2.0.0/1610.0.15.106500165002i

*>10.0.25.10065002i

*10.3.0.0/1610.0.25.10650026500165003i

*>10.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

发现仍然是允许所有

r2(config#route-mapcccpermit10

r2(config-route-map#matchas-path2//没有as-path2

r2(config-route-map#exit

r2(config#routerbgp65002

r2(config-router#nei10.0.25.2route-mapcccout

r5#showipbgp

NetworkNextHopMetricLocPrfWeightPath

*>10.1.0.0/1610.0.15.10065001i

*>10.2.0.0/1610.0.15.106500165002i

*>10.3.0.0/1610.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

发现为拒绝所有

r2(config#routerbgp65002

r2(config-router#nei10.0.25.2distribute-list2out//分发列表2没有

r5#showipbgp

BGPtableversionis5,localrouterIDis10.5.0.1

NetworkNextHopMetricLocPrfWeightPath

*10.1.0.0/1610.0.25.106500265001i

*>10.0.15.10065001i

*10.2.0.0/1610.0.15.106500165002i

*>10.0.25.10065002i

*10.3.0.0/1610.0.25.10650026500165003i

*>10.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

发现为允许所有

r2(config#routerbgp65002

r2(config-router#nonei10.0.25.2distribute-list2out

r2(config-router#nei10.0.25.2prefix-list2out//前缀列表也没有

r5#showipbgp

BGPtableversionis5,localrouterIDis10.5.0.1

NetworkNextHopMetricLocPrfWeightPath

*10.1.0.0/1610.0.25.106500265001i

*>10.0.15.10065001i

*10.2.0.0/1610.0.15.106500165002i

*>10.0.25.10065002i

*10.3.0.0/1610.0.25.10650026500165003i

*>10.0.15.106500165003i

*>10.5.0.0/160.0.0.0032768i

允许所有

r2(config#routerbgp65002

r2(config-router#nonei10.0.25.2prefix-list2out

r2(config-router#nei10.0.25.2filter-list2out//as路径没有

r5#showipbgp

BGPtableversionis6,localrouterIDis10.5.0.1

NetworkNe

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

当前位置:首页 > 高中教育 > 小学教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1