bgp综合实验答案.docx

上传人:b****6 文档编号:6824522 上传时间:2023-01-10 格式:DOCX 页数:8 大小:68.25KB
下载 相关 举报
bgp综合实验答案.docx_第1页
第1页 / 共8页
bgp综合实验答案.docx_第2页
第2页 / 共8页
bgp综合实验答案.docx_第3页
第3页 / 共8页
bgp综合实验答案.docx_第4页
第4页 / 共8页
bgp综合实验答案.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

bgp综合实验答案.docx

《bgp综合实验答案.docx》由会员分享,可在线阅读,更多相关《bgp综合实验答案.docx(8页珍藏版)》请在冰豆网上搜索。

bgp综合实验答案.docx

bgp综合实验答案

BGP综合实验

1.AS65001内建立IBGP对等体关系,尽可能的克服AS内IBGP会话过多,BGP更新冗余的问题.

2.要求IBGP对等体关系最大限度的稳定.

3.要求IBGP会话高安全性.

4.AS65002成为AS65001的邻居AS.

5.要求EBGP对等体关系最大限度的稳定.

6.要求外部AS65003成为AS65002的邻居AS,并且要求AS65002里的路由器从外部AS65003接收的BGP更新能看到AS_PATH属性包含65004一项.

7.要求AS65001优先选择R3到达外部AS65003;但对于去往AS65002的流量,优先经过R1.

8.要求R6不传递来自外部AS65003的任何更新.

IP地址自行规划,各路由器起回环接口rx的为x.x.x.x/32

一:

本来想让AS65001里建立全互联的IBGP,必须在每一台路由器,分别指定另外所有的路由器为邻居,但图中,R8和所有的路由相联,这样由题意知,我们可以配置路由映射器,在R8上指明R4,R5,R6为映射器的客户端。

命令如下:

neighbor4.4.4.4route-reflector-clientneighbor5.5.5.5route-reflector-clientneighbor6.6.6.6route-reflector-client

这样呢R4,R5,R6只要和R8建立邻居关系,就可以通过R8的其它所有路由器建立邻居了。

二:

IBGP要求最大限度的稳定性,也就是通过回环口来建立邻居关系,也就是在建立邻居关系时要指明更新是自己的回环口:

neighbor4.4.4.4update-sourceloopback0

三:

要求IBGP会话高安全性,就是要指定邻居时配置认证:

neighbor4.4.4.4password0sfgo(其中0是加密类型,不加密)

四:

BGP建立邻居关系时可以跟上路由图,用来作一些策略。

BGP选路策略顺序如下:

BGP的选路原则

1)BGP的路径属性

A路径属性的分类

  1、well-knownvsoptional

  well-known:

表示该路径属性能够被所有的BGP实现者支持

  optional:

表示该路径属性不一定能够被所有的BGP实现者支持

说明:

FRC(request  for  comment),shouldbe、mustbe、maybe

  2、mandatoryvsdiscretionary

  mandatory:

要求在每个BGP更新中,必须包含该路径属性

  discretionary:

在BGP更新中,可以包含也可以不包含该路径属性

常见的BGP路径属性:

well-knownmandatory:

公认强制属性

well-knowndiscretionary:

公认自由选择属性

optional  transitive:

可选传递属性

optionalnontransitive:

可选传递属性

  3、transitivevsnontransitive

  atransitive:

若一个BGP的实现者收到无法识别的optional属性,若该属性为transitive保留并传给其他的BGP实现者

  bnontransitive:

若一个BGP的实现者收到无法识别的optional属性,若该属性为nontransitive,则丢弃。

  4partial:

  若一个BGP的实现者收到无法识别的optional属性,若该属性为transitive保留并传给其他的BGP实现者同时将该属性标为partial

    BBGP路径属性:

1、AS-path(公认强制属性)

防止AS间的路由环路。

as-path

  当一个BGP路由器向EBGP邻居通告路由时,会将本路由器所属的AS添加在AS-PATH的最左边

  当一个BGP路由器向IBGP邻居通告路由时,AS-PATH保持不变

2、next-hop(公认强制)

nexthop

当一个BGP路由器向EBGP邻居通告路由时,next-hop修改为本路由器的某个接口IP地址

当一个BGP路由器向IBGP邻居通告路由时,next-hop保持不变

3、origin(公认强制)

  i/e/?

  i:

表示该BGP路由是通过network命令引入的

  e:

  表示该BGP路由是通过redistribute命令从EGP引入的

  ?

表示该BGP路由是通过redistribute命令从IGP引入的

4、localpreference(公认自由选择)

  目的:

控制离开本AS的流量

  locpref属性只能在ibgp中的邻居传播

  在BGP中,LOCpref越高,路由越优先。

缺省情况下。

localpref的值为100(先讲这个)

5、med(cisco设备--metric,可选非传递)

目的:

控制进入本AS的流量

  MED属性传播给EBGP邻居,并在EBGP所属的AS中传播(注:

对方AS不能将MED再发送其他AS)

  在BGP中,MED越小,路由越优先。

缺省情况下。

localpref的值为100

  注:

缺省情况下,BGP路由器只会比较来自同一个AS,不比较来自不同的AS

6、weight(cisco私有属性)

  weight属性不传播给任何BGP邻居,只能在同一个路由器上使用。

  weight越大,路由越优先。

其他。

      注:

数据流量的方向《---------》路由的学习方向是相反的

  

BGP的选路原则

    注意:

BGP设计不是为了负载均衡,它的选路是根据策略来进行的。

它的选路最终与带宽无关,BGP将为每个目标网络选择出一条最优的路由(若希望进行负载均衡,需要额外的命令配置)

首先BGP只考虑同步(如果同步原则开启的话)b、无AS环路、c、有效的下一跳(基本条件)

1、优先选择weight最大的

  注:

cisco路由器上,本地路由器起源的路由weight为32768,而从其他路由器学习的均为0

  (因为weight属性不传播给任何BGP邻居)(假设未作任何策略)

2、优先选择localpreference最高

3、优先选择本路由器起源(nexthop为0.0.0.0)

4、优先选择AS-PATH最短

5、优先选择origincode最小:

i(igp)

(incomplete)

6、优先选择MED最小

7、优先选择从EBGP邻居学习的路由。

8、优先选择从最近的IGP邻居学习的路由

9、优先选择最老的路由(即最稳定的路由)

10、优先选择从具有最小BGProuterID的邻居学习的路由

11、优先选择从具有最小的接口IP地址bgp邻居学习的路由

就题目来说,我们可以在65002中也可以在65003中配置,只是方向不同而已,这里我们只配置下R2指R1邻居时的命令:

route-mapsf

setas-pathprepend65004定义好路由图和相关策略,然后把这策略应用到路由进程下:

neighbor1.1.1.1route-mapsfout(注意此时65004是出现在65003的右边,而如果应用的是in方向,也就是说在R1上指R2为邻居时,则65004是出现在65003左边的)

五:

ipas-pathaccess-list

Definesanaccesslistbasedonautonomoussystempathinformation.

Syntax:

[no]ipas-pathaccess-listlist-name {permit|deny} as-regular-expression

.

list-name

Uniquealpha-numericnamethatidentifiestheregularexpressionaccesslist.Listnamescanbeupto255charactersinlengthandcontainthefollowingcharacters:

A-Z,a-z,0-9,_,and-.Usetheshowipas-path-access-listtodisplaythenamesofalldefinedas-pathaccesslists.

permit

Permitsaccessformatchingconditions.

deny

Deniesaccessformatchingconditions.

as-regular-expression

Autonomoussystemintheaccesslistthatusesaregularexpression.

Description:

Accesslistsarefiltersthatenableyoutorestricttheroutinginformationarouterlearnsoradvertisestoandfromaneighbor.

MultipleBGPpeersorroutemapscanreferenceasingleaccesslist.Youcanapplyaccessliststobothinboundrouteupdatesandoutboundrouteupdates.Eachrouteupdateispassedthroughtheaccess-list.BGPapplieseachruleintheaccesslistintheorderitappearsinthelist.Whenaroutematchesanyrule,thedecisiontopermittheroutethroughthefilterordenyismade,andnofurtherrulesareprocessed

AccesslistsbasedonautonomoussystempathenableyoutocontrolroutingupdatesbasedonBGPautonomouspathsinformation.Ifyouwanttocontrolupdatesforalltheroutestoorfromanautonomoussystem,filteringbasedonautonomoussystempathismoreefficientthanlistingeachrouteindividually.

Aregularexpressionisapatternusedtomatchagainstaninputstring.InBGP,youcanbuildaregularexpressiontomatchinformationaboutanautonomoussystempath.Regularexpressionscaninclude:

Table5-3.CharactersandComponentsofRegularExpressions 

ComponentCharacter

Description

Ranges

Asequenceofcharacterswithinsquarebrackets:

[1234]

Atoms

Asinglecharacterwithspecialmeaning.Atomsinclude:

.

Matchesanysinglecharacter.

^

Matchesthebeginningofaninputstring.

$

Matchestheendofaninputstring.

_(underscore)

Matchesacomma,leftbrace,rightbrace,thebeginningofaninputstring,theendofaninputstring,oraspace.

Pieces

Atomsfollowedbyaspecialcharacterlistedbelow:

Branches

0ormoreconcatenatedpieces.

Thefollowingtableprovidessampleregularexpressions:

Table5-4.SampleRegularExpressions 

RegularExpression

Description

^nnn$

Indicatestherouteoriginatedinautonomoussystemnnn.The^meanstheexpressionmuststartwiththenextcharacter.The$meanstheexpressionmustendwiththeprecedingcharacter.

^100$matches:

100

^aaa_bbb$

Theautonomoussystemlistmustcontainbothaaaandbbbwithaaaappearingbeforethebbb.Forexample:

^123_456$matches:

123456

                                    868123999456

^nnn.*nnn$

Theexpressionmustbeginwithaspecificautonomoussystemandendwithaspecificautonomoussystem,butcanhaveanythinginbetween.Forexample:

∙123456

∙123123456

∙^123.*456$(matches:

 123123123456)

∙123868999456

∙12341456

_nnn_

Indicatestheroutewasviaautonomoussystemnnn.

^$

Indicatestherouteoriginatedinthisautonomoussystem.

NOTERegularexpressionsarematchedagainsttheautonomoussystempathasifitisastring-notasequenceofnumbers.Encloseautonomoussystemnumberswithinunderscorestomatchaspecificautonomoussystemnumber.

Permitanddenyapplyonlywhenthereisanexactmatchbetweentheregularexpressionandtheautonomoussystempath.

Usetheipas-pathaccesslistcommandtocreateanaccesslisttofilterroutesbasedontheirautonomoussystempath.Addentriestotheaccesslistbyrepeatingthecommandfordifferentautonomoussystempaths.

Usetheneighborormatchas-pathcommandstoapplyanautonomoussystempathbasedaccesslist.

Usethenoipas-pathaccess-listcommandtodeleteanentireautonomoussystempathbasedaccesslist.

Usethenoipas-pathaccess-listlist-name{permit|deny}as-regular-expressiontodeleteaspecificfilterfromanautonomoussystempathaccesslist.

FactoryDefault:

Noaccesslists.

CommandMode:

Configuration.

Example1:

Inthefollowingexample,theipas-pathaccess-listcommandscreateanas-pathaccesslistnamed'1'topermitonlythoseroutesthatincludepathsfromorthroughautonomoussystems234and345:

router(config)#ipas-pathaccess-list1permit_234_

router(config)#ipas-pathaccess-list1permit_345_

router(config)#ipas-pathaccess-list1denyany

Notethelastlineoftheaccesslistisadenyanystatementtoremindyourreaderthatallotheraccessisdenied.

Example2:

Inthefollowingexample,theneighborfilter-listcommandspecifiesthatonlypathsfromorthroughautonomoussystems234and345(asspecifiedbyaccesslist1)areadvertisedtoBGPneighbor125.181.1.5andtheweightforthoseroutesissetto30.

router(config)#routerbgp100

router(config-router)#network170.100.0.0.

router(config-router)#neighbor170.100.205.5remote-as234

router(config-router)#neighbor121.180.1.4remote-as345

router(config-router)#neighbor125.181.1.5remote-as171

router(config-router)#neighbor125.181.1.5filter-list1weight30

依题意我们建两个正规表达式来分别匹配AS65003的流量和AS65002的流量,命令如下:

R6上

ipas-pathaccess-list1permit^65002$

ipas-pathaccess-list2permit^65002_65003$然后把这两个正规表达式通过路由应用到进程中

neighbor1.1.1.1route-mapsfin

route-mapsfpermit10

matchas-path1

setweight200

matchas-path2

setweight100

六:

BGP的COMMUNITY

我们同样做一个正规列表来匹配AS65003

neighbor3.3.3.3route-mapsfin

route-mapgopermit10

matchas-path1

setweight100

matchas-path2

setweight200

ipas-pathaccess-list2permit^65002_65003$然后setcommunityno-advertise

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

当前位置:首页 > 人文社科 > 文化宗教

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

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