




下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
BGP路由選路原則詳解技術培訓中心修訂記錄修訂日期修訂版本修訂描述作者2009-09-27V1.0初稿完成。巖學習目標掌握BGP十三條選路原則的原理熟練掌握常見的BGP路由選路原則BGP路由選路原則Weight屬性Local
Preference屬性本地路由始發(fā)方式AS-Path長度Origin屬性6.MED屬性EBGP優(yōu)于IBGP到達Next-hop的代價執(zhí)行等價負載均衡EBGP路由接收的順序路由的Router-ID12.Cluster-list長度13.配置的BGP
Peer指定地址第一條:Weight屬性比較原則及配置注意事項:Cisco私有,可通過關聯(lián)Route-map方式進行配置,該值無法傳遞給其他BGPPeer,只能在本地使用.攜帶的Weight值越大,則該路由越優(yōu)先.本地始發(fā)路由的默認值是32768,從其他BGP
Peer學習過來的路由的默認值是0雖然Weight屬性是Cisco私有的,但是很多廠商也是內置該屬性(但無法顯示及修改),這樣就保證了本地始發(fā)的路由是最優(yōu)先的,因為本地始發(fā)路由的”Weight”為32768,從其他
BGP
Peer學習過來的路由的”Weight”為0.第一條:Weight屬性實驗驗證R2、R3分別通告10.0.0.0給R1R1將10.0.0.0使用network方式引入BGP10.0.0.0/810.0.0.0/810.0.0.0/8AS
1AS
2R3R1R2IBGPEBGP第一條:Weight屬性實驗驗證R1的BGP表r1#sh
ip
bgpBGP
table
version
is
2,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*i10.0.0.09.9.13.301000i*9.9.12.2002i*>0.0.0.0032768i第一條:Weight屬性實驗驗證R1對BGP
Peer應用不同的Route-map修改所學習路由的
Weight值10.0.0.0/810.0.0.0/810.0.0.0/8AS
1AS
2R3R1R2IBGPEBGProuter
bgp
1
---R1的路由策略neighbor
9.9.12.2
route-map
FROM_R2
inroute-map
FROM_R2
permit
10set
weight
65535第一條:Weight屬性實驗驗證R1的BGP表選路結果r1#sh
ip
bgpBGP
table
version
is
7,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Pathri10.0.0.09.9.13.301000ir>9.9.12.20655352
ir0.0.0.0032768iBGP路由選路原則Weight屬性Local
Preference屬性本地路由始發(fā)方式AS-Path長度Origin屬性6.MED屬性EBGP優(yōu)于IBGP到達Next-hop的代價執(zhí)行等價負載均衡EBGP路由接收的順序路由的Router-ID12.Cluster-list長度13.配置的BGP
Peer指定地址第二條:Local
Preference屬性比較原則及配置注意事項:值越大,越優(yōu)先默認情況下,本地始發(fā)的路由的LP為100,從EBGP
Peer接收的路由的LP為100.Local
Preference屬性只能在IBGP
Peer之間傳遞,不能在
EBGP
Peer之間傳遞,如果在EBGP
Peer之間收到的路由的路徑屬性中攜帶了LocalPreference,則會觸發(fā)Notifacation報文,造成會話中斷第二條:Local
Preference屬性比較原則及配置注意事項:Local
Preference通過如下三種方法進行設置:通過將IGP路由引入BGP時關聯(lián)Route-map進行設置針對IBGPPeer應用IN/OUT方向的Route-map,對從Peer接收到的或者通告給Peer的所有或部分路由進行設置針對EBGPPeer應用IN方向的Route-map,對從Peer接收到的所有或部分路由進行設置Local
Preference為BGP選路策略中經常使用的一個路徑屬性第二條:Local
Preference屬性實驗一:Local
Prefenerce無法在EBGP
Peer之間傳遞R1R2AS
1AS
210.0.0.0/8EBGProuter
bgp
2network
10.0.0.0neighbor
9.9.12.1
remote-as
1neighbor
9.9.12.1
route-map
TO_R1
out!route-map
TO_R1
permit
10set
local-preference
500第二條:Local
Preference屬性實驗一:Local
Prefenerce無法在EBGP
Peer之間傳遞查看本地始發(fā)的BGP路由的LP值r2#show
ip
bgpBGP
table
version
is
2,
local
router
ID
is
9.9.0.2Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,rRIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork*>
10.0.0.0iNext
Hop Metric
LocPrf
Weight
Path0.0.0.0
0
空值?
32768r2#sh
ip
b
10.0.0.0BGP
routing
table
entry
for
10.0.0.0/8,
version2Paths:
(1
available,
best
#1,
table
Default-IP-Routing-Table)Advertised
to
non
peer-group
peers:9.9.12.1Local0.0.0.0
from
0.0.0.0
(9.9.0.2)Origin
IGP,
metric
0,
localpref
100,
weight
32768,
valid,
sourced,
local,
best第二條:Local
Preference屬性實驗一:Local
Prefenerce無法在EBGP
Peer之間傳遞R2通告給R1的BGP路由是否攜帶LP?r1#sh
ip
bgpBGP
table
version
is
2,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork*>
10.0.0.0Next
Hop Metric
LocPrf
Weight
Path9.9.12.2
0
0
2
i500沒有傳遞?r2#sh
ip
bgp
neighbors
9.9.12.1
advertised-routesBGP
table
version
is
2,
local
router
ID
is
9.9.0.2Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork*>
10.0.0.0Next
Hop Metric
LocPrf
Weight
Path0.0.0.0
0 32768
i第二條:Local
Preference屬性實驗一:Local
Prefenerce無法在EBGP
Peer之間傳遞R2通告給R1的BGP
Update報文R2通告的10.0.0.0/8前綴的路徑屬性中不包含Local
Preference屬性第二條:Local
Preference屬性實驗二:修改本地始發(fā)路由的默認LP值R1R210.0.0.0/8AS
1IBGProuter
bgp
1---R2的路由策略
bgp
default
local-preference
500network
10.0.0.0neighbor
9.9.12.1
remote-as
1第二條:Local
Preference屬性實驗二:修改本地始發(fā)路由的默認LP值r2#sh
ip
bBGP
table
version
is
2,
local
router
ID
is
10.0.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork*>
10.0.0.0NextHop Metric
LocPrf
Weight
Path0.0.0.0
0
空值?
32768
ir2#sh
ip
b
10.0.0.0BGP
routing
table
entry
for
10.0.0.0/8,
version2Paths:
(1
available,
best
#1,
table
Default-IP-Routing-Table)Advertised
to
non
peer-group
peers:9.9.12.1Local0.0.0.0
from
0.0.0.0
(10.0.0.1)Origin
IGP,
metric
0,
localpref
500,
weight
32768,
valid,
sourced,
local,
best第二條:Local
Preference屬性實驗二:修改本地始發(fā)路由的默認LP值r1#sh
ip
bBGP
table
version
is
4,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork*>i10.0.0.0NextHop Metric
LocPrf
Weight
Path9.9.12.2
0
500 0
i第二條:Local
Preference屬性實驗三:將IGP中的路由引入BGP時關聯(lián)Route-map設置LPR1R2AS
110.0.0.0/8IBGProuter
bgp
1---R2的路由策略network
10.0.0.0
route-map
SET_LPneighbor
9.9.12.1
remote-as
1!route-map
SET_LP
permit
10set
local-preference
400第二條:Local
Preference屬性實驗三:將IGP中的路由引入BGP時關聯(lián)Route-map設置LPr2#sh
ip
bBGP
table
version
is
3,
local
router
ID
is
10.0.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetworkNextHopMetric
LocPrf
WeightPath*>
10.0.0.00.0.0.00 400
32768ir1#sh
ip
bBGP
table
version
is
6,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork*>i10.0.0.0Next
Hop Metric
LocPrf
Weight
Path9.9.12.2
0
400
0i第二條:Local
Preference屬性實驗四:對IBGP
Peer應用IN/OUT方向Route-mapR3單向
R6的數(shù)據(jù)流需求R1\R2對R3應用OUT方向Route-mapR1R2AS
1R3R4R5AS
2R6以該方式部署策略,對數(shù)據(jù)流控制的作用范圍10.0.0.0/811.0.0.0/8EBGP第二條:Local
Preference屬性實驗四:對IBGP
Peer應用IN/OUT方向Route-mapR4、R5正常通告R6的路由,R1、R2的BGP表R1R2AS
1R3R4R5AS
2R610.0.0.0/811.0.0.0/8EBGPr1#sh
ip
bgpNetwork Next
Hop Metric
LocPrf
Weight
Pathr2#sh
ip
bgpNetwork Next
Hop
Metric
LocPrf
Weight
Path*
10.0.0.09.9.15.502
i*
10.0.0.09.9.25.502
i*>9.9.14.402
i*>9.9.24.402
i*
11.0.0.09.9.15.502
i*
11.0.09.9.25.502
i*>9.9.14.402
i*>9.9.24.402
i第二條:Local
Preference屬性實驗四:對IBGP
Peer應用IN/OUT方向Route-mapR1、R2的路由策略router
bgp
1
-----R1的路由策略neighbor
9.9.13.3
route-map
TO_R3
outaccess-list
1
permit
10.0.0.0access-list
2
permit
11.0.0.0route-map
TO_R3
permit
10match
ip
address
1set
local-preference
500route-map
TO_R3
permit
20match
ip
address
2set
local-preference
400router
bgp
1----R2的路由策略neighbor
9.9.23.3
route-map
TO_R3
outaccess-list
1
permit
10.0.0.0access-list
2
permit
11.0.0.0route-map
TO_R3
permit
10match
ip
address
1set
local-preference
400route-map
TO_R3
permit
20match
ip
address
2set
local-preference
500R2AS
1R3R1
R4R5AS
2R610.0.0.0/811.0.0.0/8EBGP第二條:Local
Preference屬性實驗四:對IBGP
Peer應用IN/OUT方向Route-mapR3的路由選路結果r3#sh
ip
bBGP
table
version
is
6,
local
router
ID
is
9.9.0.3Status
codes:
s
suppressed,
d
damped,
h
history,
*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*i10.0.0.09.9.23.2040002
i*>i9.9.13.1050002
i*>i11.0.0.09.9.23.2050002
i*
i9.9.13.1040002
iR2AS
1R3R1
R4R5AS
2R610.0.0.0/811.0.0.0/8EBGP第二條:Local
Preference屬性實驗四:對IBGP
Peer應用IN/OUT方向Route-map路由策略結果:R3到R6的實際單向數(shù)據(jù)流R1R2AS
1R3R4R5AS
2R610.0.0.0/811.0.0.0/8EBGP以該方式部署策略,對數(shù)據(jù)流控制的作用范圍第二條:Local
Preference屬性實驗五:對EBGP
Peer應用IN方向Route-mapR3單向
R6的數(shù)據(jù)流需求R1\R2分別對R4\R5應用OUT方向的Route-mapR1R2AS
1R3R4R5AS
2R6以該方式部署策略,對數(shù)據(jù)流控制的作用范圍10.0.0.0/811.0.0.0/8EBGP第二條:Local
Preference屬性實驗五:對EBGP
Peer應用IN方向Route-mapR1、R2的路由策略router
bgp
1---R1的路由策略neighbor
9.9.14.4
route-map
FROM_R4
inaccess-list
1
permit
10.0.0.0route-map
FROM_R4
permit
10match
ip
address
1set
local-preference
500route-map
FROM_R4
permit
20router
bgp
1---R2的路由策略neighbor
9.9.25.5
route-map
FROM_R5
inaccess-list
2
permit
11.0.0.0route-map
FROM_R5
permit
10match
ip
address
2set
local-preference
500route-map
FROM_R5
permit
20R1R2AS
1R3R4R5AS
2R610.0.0.0/811.0.0.0/8EBGP第二條:Local
Preference屬性實驗五:對EBGP
Peer應用IN方向Route-mapR1、R2的BGP表r1#sh
ip
bgpNetwork Next
Hop
Metric
LocPrf
Weight
Pathr2#sh
ip
bgpNetwork
Next
Hop
Metric
LocPrf
Weight
Path*
10.0.0.09.9.15.502
i*
10.0.0.09.9.25.502
i*>9.9.14.450002
i*>9.9.24.402
i*
11.0.0.09.9.14.402
i*>
11.0.0.09.9.25.550002
i*>9.9.15.502
i*9.9.24.402
iR1R2AS
1R3R4R5AS
2R610.0.0.0/811.0.0.0/8EBGP第二條:Local
Preference屬性實驗五:對EBGP
Peer應用IN方向Route-mapR3的BGP表r3#sh
ip
bgpBGP
table
version
is
10,
local
router
ID
is
9.9.0.3Status
codes:
s
suppressed,
d
damped,
h
history,
*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*i10.0.0.09.9.23.2010002
i*>i9.9.13.1050002
i*>i11.0.0.09.9.23.2050002
i*
i9.9.13.1010002
iR2AS
1R3R1
R4R5AS
2R610.0.0.0/811.0.0.0/8EBGP第二條:Local
Preference屬性實驗五:對EBGP
Peer應用IN方向Route-map路由策略結果:R3到R6的實際單向數(shù)據(jù)流R1R2AS
1R3R4R5AS
2R610.0.0.0/811.0.0.0/8以該方式部署策略,對數(shù)據(jù)流控制的作用范圍BGP路由選路原則Weight屬性Local
Preference屬性本地路由始發(fā)方式AS-Path長度Origin屬性6.MED屬性EBGP優(yōu)于IBGP到達Next-hop的代價執(zhí)行等價負載均衡EBGP路由接收的順序路由的Router-ID12.Cluster-list長度13.配置的BGP
Peer指定地址第三條:本地路由始發(fā)方式比較原則及配置注意事項該比較原則主要是指本地在進入一條IGP路由進去BGP表時,使用不同的方式比如network或redistribute等,那么這些方式之間是存在優(yōu)先順序的:network>redistribute>aggregate注意,該原則是不會作為BGP路由選路策略的第三條:本地路由始發(fā)方式實驗驗證本地分別以3種方式引入一條路由,如下配置所示interface
Loopback1ip
address
3.3.3.3
255.255.255.255router
bgp
1network
3.3.3.3
mask
255.255.255.255
route-map
Aaggregate-address
3.3.3.3
255.255.255.255
attribute-map
Credistribute
connected
route-map
Broute-map
A
permit
10set
local-preference
200route-map
B
permit
10set
local-preference
300route-map
C
permit
10set
local-preference
400第三條:本地路由始發(fā)方式實驗驗證本地BGP表中的顯示,network方式為第一選擇r3#sh
ip
bgpBGP
table
version
is
13,
local
router
ID
is
9.9.0.3Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,rRIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork*>
3.3.3.3/32Next
Hop Metric
LocPrf
Weight
Path0.0.0.0
0
200
32768i第三條:本地路由始發(fā)方式實驗驗證將network
3.3.3.3
mask
255.255.255.255刪除redistribute方式成為優(yōu)選r3#sh
ip
bBGP
table
version
is
14,
local
router
ID
is
9.9.0.3Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork*>3.3.3.3/32Next
Hop Metric
LocPrf
Weight
Path0.0.0.0
0
300
32768?BGP路由選路原則Weight屬性Local
Preference屬性本地路由始發(fā)方式AS-Path長度Origin屬性6.MED屬性EBGP優(yōu)于IBGP到達Next-hop的代價執(zhí)行等價負載均衡EBGP路由接收的順序路由的Router-ID12.Cluster-list長度13.配置的BGP
Peer指定地址第四條:AS-Path長度比較原則及配置注意事項優(yōu)選長度小的AS-Path列表其他AS-Path比較原則:在做聚合路由時,使用as-set后產生的AS-Path列表中的{}里的AS號長度只算一個AS號的長度在內的AS-Path列表中的()的AS號長度不做計算依據(jù)當向EBGP
Peer
通告路由時,將自己的AS號加在AS-Path列表的最左端,向IBGP
Peer通告路由時,不會對AS-Path列表做任何修改第四條:AS-Path長度比較原則及配置注意事項修改AS-Path列表的方法:可以通過對EBGP
Peer使用IN/OUT方向的Route-map,使用setas-path
prepend命令來添加AS號。注意,上述操作只能對EBGPPeer,對IBGP
Peer無法生效??梢栽贐GP進程下使用bgpbestpathas-pathignore命令來跳過AS-Path的長度比較修改AS-Path長度可作為BGP選路策略的一種。第四條:AS-Path長度實驗一:使用OUT方向的Route-map來修改AS-PathR3
R4的單向數(shù)據(jù)流需求R1R3R4AS1AS210.0.0.0/8R2以該方式部署策略,對數(shù)據(jù)流控制的作用范圍第四條:AS-Path長度實驗一:使用OUT方向的Route-map來修改AS-PathR1、R2的路由策略(R1保持默認)router
bgp
2----R2的路由策略neighbor
9.9.23.3
route-map
TO_R3
outroute-map
TO_R3
permit
10set
as-path
prepend
5
5
5R1R2R3AS1AS2R410.0.0.0/8第四條:AS-Path長度實驗一:使用OUT方向的Route-map來修改AS-PathR3的BGP表選路結果r3#sh
ip
bBGP
table
version
is
2,
local
router
ID
is
9.9.0.3Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetworkNext
HopMetric
LocPrf
Weight
Path*
10.0.0.09.9.23.20 2
5
5
5
i*>9.9.13.10
2
i第四條:AS-Path長度實驗二:使用IN方向的Route-map來修改AS-PathR3
R4的單向數(shù)據(jù)流需求R1R3R4AS1AS210.0.0.0/8R2以該方式部署策略,對數(shù)據(jù)流控制的作用范圍第四條:AS-Path長度實驗二:使用IN方向的Route-map來修改AS-PathR3的路由策略router
bgp
1---R3的路由策略neighbor
9.9.23.2
route-map
FROM_R2
inroute-map
FROM_R2
permit
10set
as-path
prepend
5
5
5R1R2R3AS1AS2R410.0.0.0/8第四條:AS-Path長度實驗二:使用IN方向的Route-map來修改AS-PathR3的BGP表選路結果r3#sh
ip
bgpBGP
table
version
is
2,
local
router
ID
is
9.9.0.3Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,rRIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetworkNext
HopMetric
LocPrf
Weight
Path*
10.0.0.09.9.23.20
5
5
5
2
i*>9.9.13.10
2
i不同方向的route-map對于的AS號的位置是不同的BGP路由選路原則Weight屬性Local
Preference屬性本地路由始發(fā)方式AS-Path長度Origin屬性6.MED屬性EBGP優(yōu)于IBGP到達Next-hop的代價執(zhí)行等價負載均衡EBGP路由接收的順序路由的Router-ID12.Cluster-list長度13.配置的BGP
Peer指定地址第五條:Origin屬性比較原則及配置注意事項三種不同的Origin屬性的優(yōu)先順序:IGP>EGP>Origin屬性會一直在BGP路由中攜帶Origin屬性配置方法:–將IGP路由引入BGP時關聯(lián)Route-map進行設置plete默認情況下,network方式產生的BGP路由的Origin屬性為IGP,而redistribute方式產生的BGP路由的Origin屬性為“?”–對BGP
Peer應用IN/OUT方向的Route-map進行設置很少使用設置Origin屬性作為BGP路由選路策略第五條:Origin屬性實驗1:設置Origin屬性R1\R2\R3分別以network方式引入路由,R1\R3關聯(lián)不同的Route-map設置不同的Origin屬性11.0.0.0/813.0.0.0/812.0.0.0/8AS
1AS
2R3R1R2IBGPEBGProuter
bgp
1---R3的路由策略network
13.0.0.0
route-map
SET_Originroute-map
SET_Origin
permit
10set
origin
pleterouter
bgp
1---R1的路由策略network
11.0.0.0
route-map
SET_Originroute-map
SET_Origin
permit
10set
origin
egp第五條:Origin屬性實驗1:設置Origin屬性R1的BGP表r1#
sh
ipbgpBGP
table
version
is
4,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*>
11.0.0.00.0.0.0032768e*>
12.0.0.09.9.12.2002
i*>i13.0.0.09.9.13.301000?第五條:Origin屬性實驗1:設置Origin屬性R1對R3應用IN方向的Route-map修改Origin屬性,R2對R1使用OUT方向的Route-map修改Origin屬性11.0.0.0/813.0.0.0/812.0.0.0/8AS
1AS
2R3R1R2IBGPEBGProuter
bgp
1---R1的路由策略neighbor
9.9.13.3
route-map
FROM_R3
inroute-map
FROM_R3
permit
10set
origin
igprouter
bgp
2---R2的路由策略neighbor
9.9.12.1
route-map
TO_R1
outroute-map
TO_R1
permit
10set
origin
plete第五條:Origin屬性實驗1:設置Origin屬性R1的BGP表r1#sh
ip
bgpBGP
table
version
is
6,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*>
11.0.0.00.0.0.0032768e*>
12.0.0.09.9.12.2002?*>i13.0.0.09.9.13.301000i第五條:Origin屬性10.0.0.0/810.0.0.0/8實驗2:不同Origin屬性之間的優(yōu)先順序AS
1R3R1R2IBGPIBGPR410.0.0.0/8IBGProuter
bgp
1---R3的路由策略network
10.0.0.0
route-map
SET_Originroute-map
SET_Origin
permit
10set
origin
pleteR2僅使用network方式引入10.0.0.0router
bgp
1---R4的路由策略network
10.0.0.0
route-map
SET_Originroute-map
SET_Origin
permit
10set
origin
egp第五條:Origin屬性實驗2:不同Origin屬性之間的優(yōu)先順序R1的BGP表路由選路結果r1#sh
ip
bgpBGP
table
version
is
2,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,rRIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*i10.0.0.09.9.14.401000e*
i9.9.13.301000?*>i9.9.12.201000i第五條:Origin屬性實驗2:不同Origin屬性之間的優(yōu)先順序斷開R1與R2的連接,R1的BGP表路由選路結果r1#sh
ip
bBGP
table
version
is
3,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*i10.0.0.09.9.14.401000e*>i9.9.13.301000?BGP路由選路原則Weight屬性Local
Preference屬性本地路由始發(fā)方式AS-Path長度Origin屬性6.MED屬性EBGP優(yōu)于IBGP到達Next-hop的代價執(zhí)行等價負載均衡EBGP路由接收的順序路由的Router-ID12.Cluster-list長度13.配置的BGP
Peer指定地址第六條:MED屬性比較原則及配置注意事項MED值越小,越優(yōu)先.默認情況下,只比較來自同一鄰居AS的BGP路由的MED值MED設置方法:將IGP路由引入BGP時關聯(lián)Route-map進行設置對BGP
Peer應用IN/OUT方向的Route-map進行設置非Route-map(自動)方式:使用network或redistribute方式將IGP路由引入BGP時,MED將繼承IGP路由的Metric(直聯(lián)路由的Metric為0)使用aggregate-address方式引入路由,則MED為空第六條:MED屬性比較原則及配置注意事項本地在將一條BGP路由通告給EBGP
Peer時,是否攜帶MED值,需要根據(jù)以下條件進行判斷(不對EBGP
Peer使用Route-map):如果該BGP路由是本地始發(fā)(network或redistribute)的,則攜帶MED值發(fā)送給EBGPPeer(如果MED為空,則設置為0)如果該BGP路由是從其他BGPPeer學習過來的,那么將該路由通告給EBGPPeer時不攜帶MED本地在將一條BGP路由通告給IBGP
Peer時,一定會攜帶
MED值如果接收或產生的路由的MED為空,那么在向IBGP
Peer通告時,將MED設置為0第六條:MED屬性比較原則及配置注意事項其他MED相關配置命令(BGP進程下):bgp
pare-medbgp
bestpath
med
missing-as-worstbgp
deterministic-medbgp
bestpath
med
confedMED為BGP選路策略中經常使用的一個路徑屬性第六條:MED屬性11.0.0.0/812.0.0.0/8實驗1:MED繼承IGP的MetricR1使用network方式將11.0.0.0引入BGP,使用redistribute方式將12.0.0.0引入BGPAS
1R3R1R2IBGPOSPFCost100router
bgp
1---R1的路由策略network
11.0.0.0redistribute
ospf
1第六條:MED屬性實驗1:MED繼承IGP的MetricR1的路由表R1的BGP表r1#sh
ip
ro…9.0.0.0/8
is
variably
subnetted,
3
subnets,
2
masksC
9.9.0.1/32
is
directly
connected,
Loopback0C
9.9.12.0/24
is
directly
connected,
FastEthernet0/0.12C
9.9.13.0/24
is
directly
connected,
FastEthernet0/0.13C
11.0.0.0/8
is
directly
connected,
Loopback1O
12.0.0.0/8
[110/101]
via
9.9.12.2,
00:01:59,
FastEthernet0/0.12r1#sh
ip
bgpBGP
table
version
is
4,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*>
9.9.12.0/240.0.0.0032768?*>
11.0.0.00.0.0.0032768i*>
12.0.0.09.9.12.210132768?第六條:MED屬性實驗2:MED屬性的傳遞范圍R2\R3分別使用network方式引入直連路由進入BGP,并關聯(lián)Route-map,將MED設置為10013.0.0.0/812.0.0.0/8AS
1AS
2R3R1R2IBGPEBGProuter
bgp
1---R3的路由策略
network
13.0.0.0
route-map
SET_MEDroute-map
SET_MED
permit
10set
metric
100router
bgp
2---R2的路由策略
network
12.0.0.0
route-map
SET_MEDroute-map
SET_MED
permit
10set
metric
100R4IBGP第六條:MED屬性實驗2:MED屬性的傳遞范圍R3的BGP表R1的BGP表R2的BGP表r3#sh
ip
bgp…NetworkNext
HopMetric
LocPrf
Weight
Path*i12.0.0.09.9.12.210010002
i*>
13.0.0.00.0.0.010032768ir1#sh
ip
bgp…NetworkNext
HopMetric
LocPrf
Weight
Path*>
12.0.0.09.9.12.210002
i*>i13.0.0.09.9.13.31001000ir2#
sh
ip
bgp…NetworkNext
HopMetric
LocPrf
Weight
Path*>12.0.0.00.0.0.010032768i*>
13.0.0.09.9.12.101
i第六條:MED屬性實驗2:MED屬性的傳遞范圍R2的BGP表(詳細)R4的BGP表r2#sh
ip
bgp
13.0.0.0BGP
routing
table
entry
for
13.0.0.0/8,
version3Paths:
(1
available,
best
#1,
table
Default-IP-Routing-Table)Not
advertised
to
any
peer19.9.12.1
from
9.9.12.1
(9.9.0.1)Origin
IGP,
localpref
100,
valid,
external,
bestr4#sh
ip
bBGP
table
version
is
3,
local
router
ID
is
9.9.0.4Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*>i12.0.0.09.9.24.21001000i*>i13.0.0.09.9.12.1010001
i第六條:MED屬性實驗3:對EBGP
Peer應用IN\OUT方向Route-mapR3單向
R6的數(shù)據(jù)流需求R4\R5分別對R1\R2應用OUT方向Route-mapR1R2AS
1R3R4R5AS
2R6以該方式部署策略,對數(shù)據(jù)流控制的作用范圍10.0.0.0/811.0.0.0/8EBGP第六條:MED屬性實驗3:對EBGP
Peer應用IN\OUT方向Route-mapR4\R5的路由策略router
bgp
2---R4的路由策略neighbor
9.9.14.1
route-map
TO_R1
outneighbor
9.9.24.2
route-map
TO_R2
outaccess-list
1
permit
10.0.0.0access-list
2
permit
11.0.0.0route-map
TO_R2
permit
10set
metric
200route-map
TO_R1
permit
10match
ip
address
1set
metric
100route-map
TO_R1
permit
20match
ip
address
2set
metric
300router
bgp
2---R5的路由策略neighbor
9.9.15.1
route-map
TO_R1
outneighbor
9.9.25.2
route-map
TO_R2
outaccess-list
1
permit
10.0.0.0access-list
2
permit
11.0.0.0route-map
TO_R2
permit
10match
ip
address
1set
metric
300route-map
TO_R2
permit
20match
ip
address
2set
metric
100route-map
TO_R1
permit10set
metric
200第六條:MED屬性實驗3:對EBGP
Peer應用IN\OUT方向Route-mapR1\R2的BGP表r1#sh
ip
bgpBGP
table
version
is
9,
local
router
ID
is
9.9.0.1Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*
10.0.0.09.9.15.520002i*>9.9.14.410002i*
11.0.0.09.9.14.430002i*>9.9.15.520002ir2#sh
ip
bgpBGP
table
version
is
10,
local
router
ID
is
9.9.0.2Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*>
10.0.0.09.9.24.420002
i*9.9.25.530002
i*>
11.0.0.09.9.25.510002
i*9.9.24.420002
i第六條:MED屬性實驗3:對EBGP
Peer應用IN\OUT方向Route-mapR3的BGP表路由選路結果r3#sh
ip
bgpBGP
table
version
is
10,
local
router
ID
is
9.9.0.3Status
codes:
s
suppressed,
d
damped,
h
history,*
valid,
>
best,
i
-
internal,r
RIB-failure,
S
StaleOrigin
codes:
i
-
IGP,
e
-
EGP,
?
-
pleteNetwork Next
Hop Metric
LocPrf
Weight
Path*i10.0.0.09.9.23.220010002
i*>i9.9.13.110010002
i*
i11.0.0.09.9.13.120010002
i*>i9.9.23.210010002
i第六條:MED屬性實驗4:對IBGP
Peer應用IN\OUT方向Route-mapR3單向
R6的數(shù)據(jù)流需求R1\R2分別對R3應用OUT方向Route-mapR1R2AS
1R3R4R5AS
2R6以該方式部署策略,對數(shù)據(jù)流控制的作用范圍10.0.0.0/811.0.0.0/8EBGP第六條:MED屬性實驗4:對IBGP
Peer應用IN\OUT方向Route-mapR1\R2的路由策略router
bgp
1---R1的路由策略neighbor
9.9.13.3
route-map
TO_R3
outaccess-list
1
permit
10.0.0.0access-list
2
permit11.0.0.0route-map
TO_R3
permit
10match
ip
address
1set
metric
100route-map
TO_R3
permit
20match
ip
address
2set
metric
200router
bgp
1---R
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 制作拍攝合同范本
- 債務變更合同范本
- 代銷汽車合同范本
- 二手車合同范本商家自己寫
- 分階段付款合同范本
- 華帝櫥柜合同范本
- 農村建房主體合同范本
- 單位門合同范本
- 醫(yī)療美容轉讓合同范例
- 產品設計開發(fā)合同范本
- CJJ2-2008城市橋梁工程施工與質量驗收規(guī)范
- 病媒生物防治操作規(guī)程
- 2024年社會工作者《社會工作實務(中級)》考試真題必考題
- 德育教育研究課題申報書
- (高清版)JTG 3810-2017 公路工程建設項目造價文件管理導則
- 《煤礦重大事故隱患判定標準》試題及答案
- 《ISO31000:2024風險管理指南》指導手冊(雷澤佳譯2024-04)
- 學前兒童表演游戲的組織與指導(學前兒童游戲課件)
- 建筑用真空陶瓷微珠絕熱系統(tǒng)應用技術規(guī)程
- (高清版)DZT 0214-2020 礦產地質勘查規(guī)范 銅、鉛、鋅、銀、鎳、鉬
- 《拒絕校園欺凌 防霸凌主題班會》課件
評論
0/150
提交評論