当前位置:网站首页>Notes....
Notes....
2022-07-26 12:28:00 【YkyJkybFjj】
BGP Basic configuration

1.EBGP Peer relationship direct connection and neighbor building
[r1]bgp 1 ---- start-up BGP process ---- hinder 1 It's not a process number , and
Is where the router is configured AS Of AS Number
[r1-bgp]
[r1-bgp]router-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
[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 Between peers
Generally, it is directly connected to build neighbors , therefore , In the packet TTL Value is set to 1, To think non
Direct connection and neighbor building , You need to increase this value .
[r5-bgp]peer 4.4.4.4 ebgp-max-hop --- If it is not followed by parameters , be
For and on behalf of 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 Fine ton too Network To send
[r1-bgp]network 1.1.1.0 24 --- The target network segment information and mask must be consistent with the routing table
It is necessary to be completely consistent in .
[r1-bgp]display bgp routing-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 , Next jump
Who is the , If you sent it yourself , Then the next jump is 0.0.0.0.
Status code
* --- representative You can use --- Every time the device receives a hop of routing information , Will check its next jump
Accessibility . That is, recursively query in the routing table according to the next hop , As long as it can reach , Then change
Routing information is available .
> --- representative optimization --- 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 path
This mark will be given by . Be careful : Only one route entry is available and preferred , He can be added to the route
In the table , Can also be passed on to others BGP peers .
1.1.1.0/24 EBGP 255 --- adopt EBGP What peers learn BGP Routing letter
Rest , It is marked as EBGP, The default priority is 255.
I --- Status code I --- representative BGP Routing information is from oneself IBGP Learn from peers
Of
i 1.1.1.0/24 12.0.0.1 --- Because in AS It's inside AS-BY-AS gauge
be , therefore , By default, the attribute information passed is consistent , Because this next
Jumping is also one of the path attributes , By default, it will not pass , It may lead to
Routing availability verification failed .
[r2-bgp]peer 3.3.3.3 next-hop-local --- In giving 3.3.3.3 Transmitting routing information is
Change the next hop attribute to local
1.1.1.0/24 IBGP 255 --- adopt IBGP What peers learn BGP Routing letter
Rest , It is marked as IBGP, The default priority is 255.
In the routing table NextHop Direct use is BGP Property , Because before
Availability verification has been carried out , therefore , It can ensure that recursive search can find the next
jump .
2. Reissue -- Import route
In a router ( I have learned OSPF There are also BGP) Import information from each other
Into it
Code -- take OSPF Import the routing information into BGP among

The imported routing information is ? Number , If you learn by yourself i

OGN-- Origin code -- Yes I,e,? Three types of -- Used to identify the origin of routing entries
I-- 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 origin code of the published routing information is I
E-- Represents that the routing information originates from EGP agreement --EGP refer to BGP The external gateway protocol used before
?-- The routes learned in addition to the above two ways -- The route origin codes of republishing and importing are ?
7.BGP Road and convergence of -- The essence is routing summary
Automatic aggregation -- It only takes effect for routers that are republished
Disadvantages of automatic aggregation
1. This method can only take effect for republishing the published routing information ,
2. Automatically aggregated routes can only be aggregated according to the main class , Will cause a huge routing black hole -- Therefore, the automatic aggregation function of Huawei devices is generally turned off by default , To start it manually

Only for republishing published routing information
1. Grab traffic
![]()
2. Make routing strategy
[r1]route-policy aa permit node 10
Info: New Sequence of this List.
[r1-route-policy]if-match ip-prefix aa
[r1-route-policy]q
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 collection will be published through automatic aggregation
Total route , He does not carry a subnet mask , Because it is summarized according to the main category , Then the subnet mask
The code 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 be generated in the local routing table
Generate an empty interface to the summary , Automatic anti loop .
Status code --- S --- suppressed --- Inhibition --- Suppress the delivery and manual aggregation of routing entries --- Because automatic aggregation has two drawbacks , therefore , If it is necessary to summarize
Conduct precise time control , Manual aggregation would be a better solution .
[r1-bgp]aggregate 172.16.0.0 22 --- Manual aggregation
*> 172.16.0.0/22 127.0.0.1 --- Route entries published after manual aggregation will
Carry mask information , And the next jump also points to 127.0.0.1, Then it will also automatically generate
Form a route to the summary network segment and point to the empty interface to prevent ring .
Manual aggregation -- Because automatic aggregation has two drawbacks , So if you need to accurately control the summary , Manual aggregation would be a better solution

The problem of manual aggregation :
1. In the case of publishing aggregate routes , 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, especially AS_PATH, It will cause some attributes of the summary route to be true , There may even be a loop
In order to avoid the above two problems , Commands must be added in the configuration process to complete

because BGP The particularity of the agreement , We often cannot suppress all the detailed routes -- Only part of the routing information can be suppressed
So you need to use --suppressed-policy
1. Grab traffic -- Suppress that traffic , Just grab this ip Just go
Use prefix list

2. There is no list here
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
3 Use the suppression policy to invoke the routing policy
[r4-bgp]aggregate 172.16.0.0 22 suppress-policy
For the second question , Special settings AS_SET keyword , If you are configuring commands , Activate this keyword , be BGP When summarizing routes , Will carry details AS_PATH attribute , To protect the environment
*> 172.16.0.0/22 127.0.0.1 0 {1 4}? --- If
The detailed route carries AS_PATH Properties are different , Is activated AS_SET attribute
after , Summary routing will route the details AS Numbers are carried and enclosed in braces
Come on , after , During Anti ring , All inside AS No. will take effect , Can not
Comes 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 a summary road
Need extra attention . So , We are BGP Two attributes are specifically introduced ---
ATOMIC_AGGREGATE,AGGREGATOR
ATOMIC_AGGREGATE --- Pure warning attribute --- Only in the suppression of all Ming
It will only be carried in fine routing
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
condition
8, Routing reflectors
Router Reflector --- Routing reflectors --- RR ---- We can do it through configuration , take
Some devices are called route reflectors under certain conditions , after , The device will be able to
Reflect what you learned IBGP Routing information .

We are designating a router called Routing reflectors (RR) At the same time , Must be in his IBGP Selecting one or more devices in the peer relationship is called his Customer (client),RR The system formed between and customers is called reflection cluster (Cluster). Each reflection cluster will use RR Of RID As a cluster ID. The rest is not called RR Customer's IBGP Peer relationship , We will call it Non customers .
Reflection rules of routing reflectors :
1, When a route reflector learns a route from its client , Then he will take this road
Information is reflected to all customers and non customers
2, If the routing reflector learns one hop routing from its non clients , Then he will put this
Route information is reflected to all customers, but not to non customers .
“ Non non non transmission ”
3, When the router performs route reflection , He only uses the best BGP Route to
Reflection .
9, The federal
10,BGP The road selection principle
边栏推荐
- Use and optimization of MySQL composite index (multi column index)
- You Yuxi recommends vite to beginners [why use vite]
- Use of strjoin function in MATLAB
- Map函数统计字符出现的次数
- Paper reading MLPD: multi label pedestrian detector in multispectral domain (Internship Program of Hikvision Research Institute)
- Backtracking - 46. Full arrangement
- 回溯——131. 分割回文串
- .NET WebAPI 使用 GroupName 对 Controller 分组呈现 Swagger UI
- Why is redis so fast? Redis threading model and redis multithreading
- 可移动表空间
猜你喜欢

Here blog: running a large language model in a production environment - overview of the reasoning framework

扫雷小游戏——轻松玩上瘾(C语言版)

How RFID works

HTAP comes at a price

Problems encountered in byte stream exercises and Solutions

RFID的工作原理

Backtracking - 46. Full arrangement

Digital intelligence transformation, management first | jnpf strives to build a "full life cycle management" platform

Map函数统计字符出现的次数

【2243】module_param.m
随机推荐
腾讯云与智慧产业事业群(CSIG)调整组织架构,成立数字孪生产品部
Overseas app push (Part 2): Channel Integration Guide for overseas manufacturers
11 "pocket" universities in China! Running on campus and leaving the school before accelerating
【2243】module_ param.m
Access database cannot connect
What is oom, why it happens and some solutions
Emerging security providers to learn about in 2022
10. 509. Introduction to PKCs file format
How does the chain store cashier system help shoe stores manage their branches?
HCIP-9.OSPF的各种拓展
Introduction to FPGA (I) - the first FPGA project
扫雷小游戏——轻松玩上瘾(C语言版)
Oracle AWR report script: SQL ordered by elapsed time
Sim900a based on STM32 sends short messages in Chinese and English
DS-112时间继电器
代码报错解决问题经验之二:YOLOv5中的test报错
面试京东T5,被按在地上摩擦,鬼知道我经历了什么?
物联网设备加密的意义
Oracle AWR 报告脚本:SQL ordered by Elapsed Time
字节流习题遇到的问题及解决方法