当前位置:网站首页>2022-07-19 advanced network engineering (XX) BGP route optimization, route optimization analysis one by one
2022-07-19 advanced network engineering (XX) BGP route optimization, route optimization analysis one by one
2022-07-27 20:45:00 【A goose】
BGP Route optimization
When there are multiple routes to the same destination network segment ,BGP Route optimization is carried out in the following order
01 optimization Preferred-Value The attribute value is the largest The routing .
02 optimization Local_Preference The attribute value is the largest The routing .
03 Locally originated BGP Routing is better than the routing learned from other peers , Local origin priority : optimization Manual aggregation > Automatic aggregation >network>import> What we learned from the equivalent .
04 optimization AS_Path The attribute value is the shortest The routing .
05 optimization Origin Attribute optimal routing .Origin The attribute value ranges from The high to low arrangement is :IGP、EGP And Incomplete.
06 optimization MED The attribute value is the smallest The routing .
07 Preferably from EBGP Peer to peer routing (EBGP Routing priority is higher than IBGP route ).
08 optimization To Next_Hop Of IGP The smallest measure The routing .
09 optimization Cluster_List The shortest The routing .
10 optimization Router ID(Orginator_ID) Smallest equipment Advertised routing .
11 optimization Minimum IP Peer notification of address The routing .
The above rules are arranged in order ,BGP When routing optimization , Start with the first rule , If you cannot make a judgment according to the first rule , For example, routed Preferred-Value Same property value , Then continue to execute the next rule , If according to the current rules ,BGP Can decide the best route , No further execution . Be similar to ACL Matching rules .
BGP Route optimization is analyzed one by one
The topology

see BGP Detailed routing , You can check the reasons for not being preferred
<R7>display bgp routing-table 11.11.11.11
BGP local router ID : 7.7.7.7
Local AS number : 200
Paths: 2 available, 1 best, 1 select
BGP routing table entry information of 11.11.11.11/32:
From: 5.5.5.5 (5.5.5.5)
Route Duration: 00h06m10s
Relay IP Nexthop: 20.2.0.5
Relay IP Out-Interface: GigabitEthernet0/0/0
Original nexthop: 5.5.5.5
Qos information : 0x0
AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
Not advertised to any peer yet
BGP routing table entry information of 11.11.11.11/32:
From: 6.6.6.6 (6.6.6.6)
Route Duration: 00h06m25s
Relay IP Nexthop: 20.3.0.6
Relay IP Out-Interface: GigabitEthernet0/0/1
Original nexthop: 6.6.6.6
Qos information : 0x0
AS-path 100, origin igp, localpref 100, pref-val 0, valid, internal, pre 255, I
GP cost 1, not preferred for router ID
Not advertised to any peer yetanalysis : among , The second route is indicated at the bottom “not preferred for router ID”, The reason why this route is not preferred is Router ID The larger .
multiple BGP Routing load balancing ( Affect this machine )
[R7-bgp]maximum load-balancing ibgp ?
INTEGER<1-8> Specify maximum equal cost routes01 optimization Preferred-Value The attribute value is the largest The routing ( Unique attributes of Huawei equipment )
Modify attribute method :
1 Use preferred-value Command to change ( Modify on this machine , Routing optimization that affects itself )
[R7]bgp 200
[R7-bgp]peer 6.6.6.6 preferred-value 100View modified results
<R7>display bgp routing-table
BGP Local router ID is 7.7.7.7
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 11
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 11.11.11.11/32 6.6.6.6 100 100 100i
* i 5.5.5.5 0 100 0 100i
*>i 22.22.22.22/32 6.6.6.6 0 100 100 100i
* i 5.5.5.5 100 0 100i
*>i 33.33.33.33/32 6.6.6.6 100 100 100i
* i 5.5.5.5 100 0 100i
*>i 44.44.44.44/32 6.6.6.6 100 100 100i
* i 5.5.5.5 100 0 100i
*>i 55.55.55.55/32 5.5.5.5 0 100 0 i
*>i 66.66.66.66/32 6.6.6.6 0 100 100 i
*> 77.77.77.77/32 0.0.0.0 0 0 i
analysis :PrefVal Routes with large fields , Be preferred . modify preferred-value The feature of is that all the next hops are 6.6.6.6 All routes are optimized , Belong to right overall situation Make changes .
2 Use the routing policy to modify ( Modify on this machine , Routing optimization that affects itself )
[R7]acl 2000
[R7-acl-basic-2000]rule 5 permit source 11.11.11.11 0
[R7]route-policy 1 permit node 10
[R7-route-policy]if-match acl 2000
[R7-route-policy]apply preferred-value 200
[R7]bgp 200
[R7-bgp]peer 5.5.5.5 route-policy 1 import View modified results
<R7>display bgp routing-table
BGP Local router ID is 7.7.7.7
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 7
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 11.11.11.11/32 5.5.5.5 0 100 200 100i
* i 6.6.6.6 100 100 100i
*>i 22.22.22.22/32 6.6.6.6 0 100 100 100i
*>i 33.33.33.33/32 6.6.6.6 100 100 100i
*>i 44.44.44.44/32 6.6.6.6 100 100 100i
*>i 66.66.66.66/32 6.6.6.6 0 100 100 i
*> 77.77.77.77/32 0.0.0.0 0 0 ianalysis : Adopt the method of policy routing to modify , You can modify a specified route entry , Relative to 1 Medium method , More accurate .
02 optimization Local_Preference The attribute value is the largest The routing .
The local priority attribute will be in AS Internal delivery , Will not be passed on to others AS. The default value 100.
Modify attribute method :
1 Modify the default local priority ( stay AS Inner boundary routing modifier , influence AS Other internal routers )
[R5]bgp 200
[R5-bgp]default local-preference 200
[R6]bgp 200
[R6-bgp]default local-preference 200View modified results
<R7>dis bgp routing-table
BGP Local router ID is 7.7.7.7
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 11
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 11.11.11.11/32 5.5.5.5 0 200 0 100i
* i 6.6.6.6 200 0 100i
*>i 22.22.22.22/32 5.5.5.5 200 0 100i
* i 6.6.6.6 0 200 0 100i
*>i 33.33.33.33/32 5.5.5.5 200 0 100i
* i 6.6.6.6 200 0 100i
*>i 44.44.44.44/32 5.5.5.5 200 0 100i
* i 6.6.6.6 200 0 100i
*>i 55.55.55.55/32 5.5.5.5 0 200 0 i
*>i 66.66.66.66/32 6.6.6.6 0 200 0 i
*> 77.77.77.77/32 0.0.0.0 0 0 ianalysis : all LocPrf The field values change to 200, Belong to right overall situation Make changes .
2 Use the routing policy to modify ( stay AS Inner boundary routing modifier , influence AS Other internal routers )
[R5]acl 2000
[R5-acl-basic-2000]rule 5 permit source 11.11.11.11 0
[R5]route-policy 1 permit node 10
[R5-route-policy]if-match acl 2000
[R5-route-policy]apply local-preference 300
[R5]route-policy 1 permit node 20
[R5]bgp 200
[R5-bgp]peer 1.1.1.1 route-policy 1 importView the modification results
<R7>display bgp routing-table
BGP Local router ID is 7.7.7.7
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 10
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 11.11.11.11/32 5.5.5.5 0 300 0 100i
*>i 22.22.22.22/32 5.5.5.5 200 0 100i
* i 6.6.6.6 0 200 0 100i
*>i 33.33.33.33/32 5.5.5.5 200 0 100i
* i 6.6.6.6 200 0 100i
*>i 44.44.44.44/32 5.5.5.5 200 0 100i
* i 6.6.6.6 200 0 100i
*>i 55.55.55.55/32 5.5.5.5 0 200 0 i
*>i 66.66.66.66/32 6.6.6.6 0 200 0 i
*> 77.77.77.77/32 0.0.0.0 0 0 ianalysis : Adopt the method of policy routing to modify , You can modify a specified route entry , Relative to 1 Medium method , More accurate .
03 Locally originated BGP Routing is better than the routing learned from other peers , Local origin priority : optimization Manual aggregation > Automatic aggregation >network>import> What we learned from the equivalent
04 optimization AS_Path The attribute value is the shortest The routing
See
05 optimization Origin Attribute optimal routing .Origin The attribute value ranges from The high to low arrangement is :IGP、EGP And Incomplete
See
06 optimization MED The attribute value is the smallest The routing
MED(Multi-Exit Discriminator, Multiple exit discriminator ) Is an optional non transitional attribute , It's a measure , Used to point out to external peers that they have entered this AS Preferred path for , That is, when entering this AS There are multiple times at the entrance of ,AS have access to MED Dynamically affect others AS Choose the path to enter .
MED The smaller the attribute value is BGP The better the route is .
MED Mainly used in AS Influence between BGP The right way .MED Be passed on to EBGP After peer , Peer in its AS Internal delivery routing , Take with you MED value , But pass the route to it again EBGP Peer time , By default, it will not carry MED attribute .
characteristic :
MED At most, only two adjacent AS, received MED Attribute AS Will not pass it on to others AS.
MED Properties are similar to COST, It is applicable when a destination has multiple routes , And a AS When there are multiple entrances , Manually configurable MED Optimize the route .
Use the routing policy to modify ( stay AS Inner boundary routing modifier , influence AS Other routers in -export, Influence oneself -import)
[R5]acl 2000
[R5-acl-basic-2000]rule 5 permit source 11.11.11.11 0
[R5]route-policy 1 permit node 10
[R5-route-policy]if-match acl 2000
[R5-route-policy]apply cost 20
[R5]bgp 200
[R5-bgp]peer 1.1.1.1 route-policy 1 import
[R5-bgp]compare-different-as-med
[R5-bgp]bestroute med-none-as-maximum
PS:
compare-different-as-med command . By default , Routers only compare from the same neighbor AS Of BGP The routing MED value , You can use this command to start from different AS The same route is also compared MED value .
bestroute med-none-as-maximum command . To configure BGP When selecting the best route , If there is no MED Value is treated as the maximum .
View the modification results
[R5]display bgp routing-table
BGP Local router ID is 5.5.5.5
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 11
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 11.11.11.11/32 1.1.1.1 100 0 100i
* i 6.6.6.6 100 0 100i
*>i 22.22.22.22/32 6.6.6.6 0 100 0 100i
* 1.1.1.1 0 100i
*> 33.33.33.33/32 1.1.1.1 0 100i
* i 6.6.6.6 100 0 100i
*> 44.44.44.44/32 1.1.1.1 0 100i
* i 6.6.6.6 100 0 100i
*> 55.55.55.55/32 0.0.0.0 0 0 i
*>i 66.66.66.66/32 6.6.6.6 0 100 0 i
*>i 77.77.77.77/32 7.7.7.7 0 100 0 ianalysis : Go to 11.11.11.11 Because of the next hop 1.1.1.1 The routing MED Change the value to 100, But because of the configuration bestroute med-none-as-maximum command , So go 11.11.11.11 and 22.22.22.22 Routing of ,MED The route in case of loss is the maximum , Are not preferred .
07 Preferably from EBGP Peer to peer routing (EBGP Routing priority is higher than IBGP route )
If you arrive at a destination with 2 Different routes , One from IBGP Learning to , One from EBGP Learning to , Will be preferred EBGP Learned this .
08 optimization To Next_Hop Of IGP The smallest measure The routing
Refers to the bottom IGP The cost value of the protocol , for example OSPF、IS-IS
See
09 optimization Cluster_List The shortest The routing
Relevant command
Configure the reflector
[R7-bgp]peer 6.6.6.6 reflect-client 10 optimization Router ID(Orginator_ID) Smallest equipment Advertised routing
11 optimization Minimum IP Peer notification of address The routing
Refers to the size of the updated source address
边栏推荐
- Pyqt5 rapid development and practice 4.7 qspinbox (counter) and 4.8 QSlider (slider)
- SQL高级技巧CTE和递归查询
- Idea: solve the problem of code without prompt
- API for obtaining the latest raw data of Taobao app product details
- 从0开始写bootloader
- [RCTF2015]EasySQL-1|SQL注入
- 十年测试老鸟聊聊移动端兼容性测试
- 2022.07.11
- Ten year test old bird talk about mobile terminal compatibility test
- 【阿里安全 × ICDM 2022】20万奖金池!大规模电商图上的风险商品检测赛火热报名中!...
猜你喜欢

未定义变量 “Lattice“ 或类 “Lattice.latticeEasy“(Matlab)

海康设备接入EasyCVR,出现告警信息缺失且不同步该如何解决?

One week activity express | in simple terms, issue 8; Meetup Chengdu station registration in progress
![[rctf2015]easysql-1 | SQL injection](/img/69/aa1fc60ecf9a0702d35d876e8c3dda.png)
[rctf2015]easysql-1 | SQL injection

【深度学习】Pytorch torch.autograd 自动差分引擎

Flask Mdict builds online MDICT Dictionary Service

Preprocessing and macro definition

一个程序员的水平能差到什么程度?

Idea: solve the problem of code without prompt

Babbitt | metauniverse daily must read: Tencent News suspended the sales service of digital collections, users left messages asking for a "refund", and phantom core also fell into the dilemma of "unsa
随机推荐
JVS公众号登陆配置
leetcode:1498. 满足条件的子序列数目【排序 + 二分 + 幂次哈希表】
Ten year test old bird talk about mobile terminal compatibility test
十年测试老鸟聊聊移动端兼容性测试
海康设备接入EasyCVR,出现告警信息缺失且不同步该如何解决?
[efficiency] abandon notepad++, this open source substitute is more awesome!
Recognized by international authorities! Oceanbase was selected into the Forrester translational data platform report
MySQL 日志查询日志
未定义变量 “Lattice“ 或类 “Lattice.latticeEasy“(Matlab)
IM即时通讯开发如何提升移动网络下图片传输速度和成功率
C language -- array
DP (dynamic programming)
MySQL 日志错误日志
shell
Codeworks round 810 (Div. 2) B.Party super detailed problem solution
JVM overview and memory management (to be continued)
【程序人生】“阶段总结“-不甘平凡
Users and permissions create ordinary users
Analysis on the optimization of login request in IM development of instant messaging mobile terminal
SQL高级技巧CTE和递归查询