当前位置:网站首页>Day 11 notes
Day 11 notes
2022-07-23 13:22:00 【Ma ordinary】
BGP Basic configuration
1、BGP Basic configuration of neighbor building
(1)EBGP Peer relationship direct connection and neighbor building
[r1]bgp 1--- start-up BGP process --- hinder 1 It's not a process number , Instead, configure the router AS Of AS Number
[r1-bgp]
[r1-bgp]route-id 1.1.1.1--- To configure RID
[r1-bgp]peer 12.0.0.2 as-number 2--- Specify peer relationships manually
[r1]display bgp peer--- see BGP Command of neighbor table
(2)IBGP Loopback neighbor building between peer relationships
because IBGP Neighbors in the same AS in , In general , One AS There are a large number of backup paths in the , If you use a physical interface to establish a neighbor relationship , These backup or load balancing resources will be wasted , Therefore, it is recommended to use the loopback interface to IBGP Establishment of peer relationship .
[r2-bgp]peer 3.3.3.3 as-number 2
[r2-bgp]peer 3.3.3.3 connect-interface LoopBack 0--- Assigned to 3.3.3.3 Source used in contracting IP The address is loopback interface 0 Of IP Address .
Be careful : When establishing peer relationships using loopback interfaces , Be sure to modify the sending interface .
(3)EBGP Indirect neighbor building between peer relationships
Be careful : stay EBGP Peer relationships , Generally, it does not have the routing foundation of non direct connection and neighbor building , therefore , You need to ensure that the address is reachable .
[r4-bgp]peer 5.5.5.5 as-number 3
[r4-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[r4-bgp]peer 5.5.5.5 ebgp-max-hop 2--- because EBGP Peers are usually directly connected to each other , therefore , In the packet TTL Value is set to 1, If you want to build a neighbor without direct connection , You need to increase this value .
[r5-bgp]peer 4.4.4.4 ebgp-max-hop--- If it is not followed by parameters , Then it means that TTL Change the value to the maximum value 255.
2、 Publish route
(1)network--- stay BGP Can only be used to publish routing entry information
Be careful : As long as the routing entry information exists in the routing table ,BGP Both can pass Network To send .
[r1-bgp]network 1.1.1.0 24--- The information and mask of the target network segment must be completely consistent with those in the routing table .
[r1-bgp]display bgp route-table--- see BGP surface
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 1.1.1.0/24 0.0.0.0 0 0 i
Network--- Target network segment information and mask information
NextHop---BGP A path attribute of --- Who sent the routing information , Who's next , If you sent it yourself , Then the next jump is 0.0.0.0
Status code
*--- On behalf of the available --- Every time the device receives a routing message , Will check the accessibility of the next hop , That is, recursively query in the routing table according to the next hop , As long as it can reach , Then the routing information is available .
>--- Representative preference --- When receiving that there are multiple routing messages arriving at the same network segment ,BGP One will be selected and loaded into the routing table according to the attribute . This preferred route will give this tag .
Be careful : Only one route entry is available and preferred , He can be added to the routing table , Can also be passed on to others BGP peers .
1.1.1.0/24 EBGP 255--- adopt EBGP What peers learn BGP Routing information , It is marked as EBGP, The default priority is 255.
-- Status code I--- representative BGP Routing information is from oneself IBGP Learned from peers
I 1.1.1.0/24 12.0.0.1--- Because in AS It's inside AS-BY-AS The rules , therefore , By default, the attribute information passed is consistent , Because this next hop also belongs to one of the path attributes , By default, it will not pass , It may cause the routing availability verification to fail .
[r2-bgp]peer 3.3.3.3 next-hop-local--- In giving 3.3.3.3 The routing information is transferred by changing the next hop attribute to local .
1.1.1.0/24 IBGP 255--- adopt IBGP What peers learn BGP Routing information , It is marked as IBGP, The default priority is 255.
In the routing table NextHop Direct use is BGP Property , Because availability verification has been carried out before , therefore , It can ensure that recursive search can find the next hop .
(2) Reissue
[r2-bgp]import-route ospf 1--- take OSPF Import the routing information into BGP among .
OGN--- Origin code ---I,e,?--- Used to identify the origin of routing entries
-- Represents that the routing information originates from IGP agreement ( Not limited to IGP agreement , Including static , Direct connection ), Represents that the route entry originated from AS Inside --- adopt network The source code of the published routing information is I
-- Represents that the routing information originates from EGP agreement ---EGP refer to BGP The external gateway protocol used before .
?--- Routes learned through other than the above two methods --- The route origin codes of republishing and importing are ?
3、BGP Route aggregation for
Automatic aggregation ---① This method can only take effect for republishing the published routing information .② Automatically aggregated routes can only be aggregated according to the main class , Will cause a huge routing black hole . therefore , Huawei equipment BGP The auto aggregation function of is turned off by default .
(1) Grab traffic
[r1]ip ip-prefix aa permit 172.16.0.0 22 greater-equal 24 less-equal 24
(2) Make routing strategy
[r1]route-policy aa permit node 10
Info:New Sequence of this List.
[r1-route-policy]if-match ip ip-prefix aa
(3) Call the routing policy during republishing
[r1-bgp]import-route direct route-policy aa
[r1-bgp]summary automatic--- Turn on the method of automatic aggregation
Info:Automatic summarization is valid only for the routes imported through the import-route command.
*> 172.16.0.0 127.0.0.1--- A new summary route will be published through automatic aggregation , He does not carry a subnet mask , Because it is summarized according to the main category , Then the subnet mask takes the default value of the main class . And the next hop attribute of the route information published through aggregation is 127.0.0.1
Be careful : After automatic aggregation , The published summary routing information will generate an empty interface pointing to the summary in the local routing table , Automatic anti loop .
Status code ---S(suppressed)--- Inhibition --- Suppress the delivery of routing entries .
Manual aggregation --- Because automatic aggregation has two drawbacks , So if you need to accurately control the summary , Manual aggregation is a more ideal solution .
[r1-bgp]aggregate 172.16.0.0 22--- Manual aggregation
*> 172.16.0.0/22 127.0.0.1--- The route entries published after manual aggregation will carry mask information , And the next jump also points to 127.0.0.1, It will also automatically generate a route to the empty interface of the summary network segment for ring prevention .
The problem of manual aggregation :① In the case of publishing route aggregation , Detailed routes will not be suppressed , As a result, the summary operation does not reduce the number of routing entries , It increases .
(2) When summarizing , Published summary routes do not inherit the properties of detailed routes , In especial AS_PATH attribute , Then some attributes of the summary route will be missing , There may even be a loop .
In order to avoid the above two problems , We must add commands in the configuration process to complete .
[r4-bgp]aggregate 172.16.0.0 22 detail-suppressed--- Publishing summary route entries will suppress all detailed routes .
however , because BGP Some particularity of the agreement , We often cannot suppress all the detailed routes , Only part of the routing information can be suppressed --- So we need to use suppressed-policy.
① Grab traffic , Use prefix list
[r4]ip ip-prefix aa permit 172.16.1.0 24
② Use routing policies to match traffic
[r4]route-policy aa permit node 10
Info:New Sequence of this List.
[r4-route-policy]if-match ip-prefix aa
[r4-route-policy]q
③ Use the suppression policy to invoke the routing policy
[r4-bgp]aggregate 172.16.0.0 22 suppress-policy aa
For the second question , We specially designed a AS_SET keyword , If you are configuring commands , Activate this keyword , be BGP When summarizing routes , Will carry the detailed AS_PATH Property to prevent ring .
[r4-bgp]aggregate 172.16.0.0 22 suppress-policy aa as-set
*>172.16.0.0 2/22 127.0.0.1 0 {1 4}?--- If the detailed route carries AS_PATH Properties are different , Is activated AS_SET After attribute , Summary routing will route the details AS Numbers are carried and enclosed in braces , after , To prevent the ring , All inside AS No. will take effect , Can't send back . however , In the use of AS_PATH Attribute to select the path , As a AS To look at .
Because the aggregated routing information has the problem of attribute loss , therefore , Such aggregate routing requires special attention . So , We are BGP Two attributes are specifically introduced ---ATOMIC_AGGREGATE,AGGREGATOR
ATOMIC_AGGREGATE--- Pure warning attribute --- Only when all detailed routes are suppressed
AGGREGATOR--- Will carry the summary of RID And where it is AS Number
Aggregator:AS 2,Aggregator ID 4.4.4.4,Atomic-aggregate
[r4]display bgp routing-table 172.16.0.0--- Check the details of a route
4、 Routing reflectors
Router Reflector--- Routing reflectors ---RR--- We can configure some devices to become routing reflectors under certain conditions . after , The device will reflect what has been learned IBGP Routing information .

We are designating a router to become a routing reflector (RR) At the same time , Must be in his IBGP Select one or more devices in the peer relationship to become his customers (client),RR The system formed with customers is called reflection cluster (cluster). Each reflection cluster will use RR Of RID As a cluster ID. The rest did not become RR Customer's IBGP Peer relationship , We will call them non customers .
Reflection rules of routing reflectors :
① When a route reflector learns a route from its client , Then he will reflect this routing information to all his customers and non customers .
② If the route reflector learns a route from its non customers , Then it will reflect the information of this road to all its customers, but not to non customers .
“ Non non non transmission ”
③ When the router performs route reflection , He only uses the best BGP Route for reflection .
边栏推荐
- Feynman learning method (redis summary)
- [jzof] path in matrix 12
- 太空射击 Part 1: 玩家精灵和控制
- 【NOI模拟赛】不知是哪一道CF的论文题(概率期望,鞅的停时定理)
- Numpy: element selection of matrix
- EasyGBS平臺出現錄像無法播放並存在RTMP重複推流現象,是什麼原因?
- The unity model is displayed in front of the UI, and the UI behind it jitters
- Image processing image feature extraction and description
- CORTEX-A系列处理器
- Record a reptile question bank
猜你喜欢

Beifu and C transmit real type through ads communication

倍福PLC和C#通过ADS通信传输bool类型变量

转行软件测试有学历要求吗?低于大专是真的没出路吗?

倍福PLC和C#通过ADS通信传输Bool数组变量

倍福PLC和C#通过ADS通信传输String数组类型变量

Beifu PLC and C transmit bool array variables through ads communication

Intégrité du signal (si) intégrité de l'alimentation électrique (PI) notes d'apprentissage (32) Réseau de distribution d'énergie (4)

MySQL - composite query external connection

Bit synchronization process of CAN controller

Debug No5基础光照
随机推荐
高压MOS管KNX42150 1500V/3A 应用于变频器电源-逆变器等
软件测试岗位饱和了?自动化测试是新一代‘offer’技能
Beifu PLC and C transmit structure type variables through ads communication
第十天笔记
Redis distributed lock practice
Machine learning: Li Hang - statistical learning method (II) perceptron + code implementation (primitive + dual form)
OpenCV 视频操作
Bit synchronization process of CAN controller
Static routing principle and configuration
【JZOF】10斐波那契数列
Netease white hat hacker training camp notes (2)
What is the reason for the failure of video playback and RTMP repeated streaming on easygbs platform?
设计思维的“布道者”
Course design - push box C (win form)
The unity model is displayed in front of the UI, and the UI behind it jitters
UI automation
OpenCV图像处理(下) 边缘检测+模板匹配+霍夫变换
[daily training] 814. Binary tree pruning
Are there any academic requirements for career transfer software testing? Is there really no way out below junior college?
倍福PLC和C#通过ADS通信传输int类型变量