BGP協議學習精華 三

2021-09-04 10:57:05 字數 2672 閱讀 2165

bgp decicion algorithm

as_path attribute

當有更新資訊通過as 時,bgp將在前面加上自己的as號。

origin attribute 路由的origin屬性有以下三種:

igp---路由起源於同一as域內,用show ip bgp時由i代表

egp---路由通過exterior gateway protocol學得,用show ip bgp時由e代表。

incomplete---路由起源未知或通過其他方式學得,用?表示

1. external bgp peering 例:

router a in as100

inte***ce ethernet 5/0

ip address 222.222.10.2 255.255.255.240

router bgp 100

network 220.220.8.0 mask 255.255.255.0

neighbor 222.222.10.1 remote-as 101

neighbor 222.222.10.1 distribute-list 180 in

neighbor 222.222.10.1 distribute-list 181 out

router b in as101

inte***ce ethernet 1/0/0

ip address 222.222.10.1 255.255.255.240

router bgp 101

network 220.220.16.0 mask 255.255.240.0

neighbor 222.222.10.2 remote-as 100

neighbor 222.222.10.2 distribute-list 150 in

neighbor 222.222.10.2 distribute-list 151 out

2. stable ibgp peering(peering to loopback address)

.peer with loopback address

.ibgp session is not dependent on a single inte***ce

.loopback inte***ce does not go down ever 例:

router a:

inte***ce loopback 0

ip address 215.10.7.1 255.255.255.255

router bgp 100

network 220.220.1.0

neighbor 215.10.7.2 remote-as 100

neighbor 215.10.7.2 update-source loopback 0

neighbor 215.10.7.3 remote-as 100

neighbor 215.10.7.3 update-source loopback 0

router b:

inte***ce loopback 0

ip address 215.10.7.2 255.255.255.255

router bgp 100

network 220.220.5.0

neighbor 215.10.7.1 remote-as 100

neighbor 215.10.7.1 update-source loopback 0

neighbor 215.10.7.3 remote-as 100

neighbor 215.10.7.3 update-source loopback 0

3. local preference

. default: 100

選用local preference 高的路由

.local to as

. used to influence bgp path selection

.path with highest local preference selection 例

: router bgp 400

neighbor 220.5.1.1 remote-as 300

neighbor 220.5.1.1 route-map local-pref in

route-map local-pref permit 10

match ip address 1

set local preference 800

access-list 1 permit 160.10.0.0 0.0.255.255

access-list 1 deny any

example:

autonomous-system 200

定義as號

router bgp 100

network 200.200.4.0 mask 255.255.252.0

neighbor 200.200.7.224 remote-as 100

neighbor 200.200.7.224 update-source loopback 0

sh ip bgp summary

sh ip bgp

no router bgp 100

BGP協議學習精華 三

bgp decicion algorithm as path attribute 當有更新資訊通過as 時,bgp將在前面加上自己的as號。origin attribute 路由的origin屬性有以下三種 igp 路由起源於同一as域內,用show ip bgp時由i代表 egp 路由通過exte...

BGP協議學習精華 三

bgp decicion algorithm as path attribute 當有更新資訊通過as 時,bgp將在前面加上自己的as號。origin attribute 路由的origin屬性有以下三種 igp 路由起源於同一as域內,用show ip bgp時由i代表 egp 路由通過exte...

BGP協議學習精華 二

bgp route maps router map 與bgp 一起使用時可控制路由資訊,並可定義路由再分配的條件 route map map tag permit deny sequence number map tag 是route map 的標識號,sequence number 是每乙個 ro...