当前位置:网站首页>Day 12 notes

Day 12 notes

2022-07-23 13:22:00 Ma ordinary

1、 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 .

because IBGP Horizontal segmentation is to prevent the generation of loops , The route reflector reflects the route and then breaks IBGP The horizontal division of , It may cause the appearance of the loop . therefore , The routing reflector is to prevent the appearance of the loop , Two more attributes are introduced ---Originator_ID( Originator ID),Cluster_list( Cluster list )

Originator ID---O_ID--- When a routing message comes to the routing reflector , The reflector needs to reflect this route information , This attribute will be added to the routing information before reflection , The value of this attribute is the notifier of the reflector receiving this route information RID, after , Other routing reflectors receive a routing message if it contains O_ID, Then he will not change this attribute . If a device receives a routing entry, the originator ID For their own local RID, You will no longer learn this routing information , Play the effect of preventing loops .

 

If in a AS among , There are multiple reflections , Then there must be multiple reflection clusters , Then each RR When reflecting the routing information, local clusters will be added to the cluster list attribute ID. When a device receives a reflected routing message , The cluster list attribute contains local clusters ID, You will no longer learn this route , To prevent the generation of loops .

[r3-bgp]peer 2.2.2.2 reflect-client --- Appoint R2 As a reflective customer , At the same time R3 Automatically become RR.

2、 The federal

The idea of the union is to put the same AS In the middle of IBGP The peer relationship is changed to EBGP Peer relationship , In this way to break IBGP The horizontal division of . This requires different IBGP Peers are divided into different members AS among , member AS Between the sword spirit EBGP Peer relationship is a special EBGP Peer relationship , They only follow EBGP Transitivity of peers , From the perspective of the content of transmission , Still need to follow AS-BY-AS The rules , Because from a macro point of view , They are still in the same AS among .

The federal approach is also equivalent to breaking IBGP The horizontal division of , Loop problems may also occur , You need to consider anti ring . The anti ring method can be directly used for reference EBGP Horizontal segmentation , stay AS_PATH Add members to the attribute AS No. to prevent backtransmission . Be careful , To distinguish members AS And normal AS, member AS Use parentheses to enclose .

Configuration of federation :

Configuration of federation :

[r2]bgp 64512--- Federate device startup BGP The process needs to be started with a small number

[r2-bgp]confederation id 2--- Declare the large size of federal members

[r2-bgp]peer 3.3.3.3 as-number 64512--- Between members of the Federation IBGP Peer relationships require the use of small No. to establish

[r3-bgp]confederation peer-as 64513--- In need of federation EBGP Peer relationship devices need To declare the members of the neighborhood AS Number

[r3-bgp]peer 4.4.4.4 as-number 64513--- Federal EBGP Peer relationships use trumpets to build neighbors

[r3-bgp]peer 4.4.4.4 ebgp-max-hop --- Because of the federal EBGP Peer relationships need to follow EBGP Transitivity of peers , therefore , Its TTL The value is defaults to 1, When building neighbors through indirect connection, it is necessary to TTL Value modification only Can build neighbors normally .

3、BGP The road selection principle

BGP The prerequisite for choosing a route --- Discard all impossible routing information

The attribute name

The scope of communication

The default value is

Criteria

PV

No transmission

0(0-65535)

The bigger the better

LP

IBGP Between peers

100

The bigger the better

AS_path

BGP Between peers

The smaller the number of records, the better

OGN

BGP Between peers

Depending on the type of origin

I>e>?

MED

BGP Between peers

By default, it inherits the cost value in the global routing table

 

 

 (1) optimization PV The route with the largest value

PV Value is Huawei's private attribute , It can be understood as weight , The greater the numerical , The higher the priority , And because he is So the first principle in the road selection principle , therefore , This attribute is the most convenient attribute for routing on this device .--- This attribute can only take effect on this device , He can't pass it on to anyone BGP peers .

modify PV Affect the configuration of routing :

Method 1 : Global modification

[r4-bgp]peer 3.3.3.3 preferred-value ?

INTEGER<0-65535> Preference value

r4-bgp]peer 3.3.3.3 preferred-value 100

AS-path 1, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, pre 2

55, IGP cost 1, not preferred for PreVal

Load sharing --- That is, let different traffic go on different lines , Share the pressure of a single line .

Method 2 : Fine control

① Grab traffic

[r4]ip ip-prefix PV permit 10.0.0.0 24

② Make routing strategy

[r4]route-policy PV permit node 10

[r4-route-policy]if-match ip-prefix pv

[r4-route-policy]apply preferred-value 100

[r4-route-policy]q

[r4]route-policy PV permit node 20--- Be careful , Empty tables must be configured to release all remaining   Traffic

Info: New Sequence of this List.

[r4-route-policy]q

③ stay BGP Call the routing policy

[r4-bgp]peer 3.3.3.3 route-policy PV import

(2) optimization LP The route with the largest attribute value

LP--- Local priority --- The default value is 100, The bigger the better . This property can be used in IBGP Pass between peers , therefore , He is AS The most common attribute of internal routing . Routing information is being passed to EBGP Peer will not carry this attribute .

By modifying the LP Value to affect routing

Method 1 : Global modification

[r3-bgp]default local-preference 200---R3 Then send it to IBGP Peer routing LP Properties will be changed to 200

Method 2 : Fine control

stay R3 Out of the direction to do

① Grab traffic

[r3]ip ip-prefix lp permit 10.0.0.0 24

② Make routing strategy

[r3]route-policy lp permit node 10

Info: New Sequence of this List.

[r3-route-policy]if-match ip-prefix lp

[r3-route-policy]apply local-preference 300 

[r3-route-policy]q

[r3]route-policy lp permit node 20

Info: New Sequence of this List.

[r3-route-policy]q

③ stay BGP Call in process

[r3-bgp]peer 4.4.4.4 route-policy lp export

(3) The priority of self initiated routes is higher than that learned from peers , There are also many kinds of self initiated , their Priority relation is manual aggregation > Automatic aggregation >network>import

(4) priority AS-path Attribute the shortest route

AS_PATH When attribute routing , There are two things to note :

① When we are doing route aggregation , If activated AS_PATH After keyword , Will be different AS Aggregate detailed routes , Then we will AS_PATH Attribute carries all details AS Of AS Number , And enclose it with braces . When comparing routes , The contents of braces are treated as a AS No .

② In the union , We also need to use... Within the Federation AS_PATH To protect the environment , We will use parentheses to put AS Put the numbers around , When comparing routes , The contents in parentheses will not be counted .

Method 1 : stay R1 Modify the exit direction of AS_PATH attribute

① Grab traffic

[r1]ip ip-prefix as permit 10.0.0.0 24

② Configure routing policies

[r1]route-policy as permit node 10

Info: New Sequence of this List.

[r1-route-policy]if-match ip-prefix as

[r1-route-policy]apply as-path 11 22 33 ?

INTEGER<1-4294967295> AS number in asplain format

(number<1-4294967295>)

STRING<3-11> AS number in asdot format

(number<1-65535>.number<0-65535>)

additive  Append to original As Number---- In the original AS_PATH Attributes based on Add configured AS Number

overwrite  Overwrite original As Number---- Directly cover the original AS_PATH attribute value

[r1-route-policy]apply as-path 11 22 33 additive --- It is recommended to add , because AS_path Property is mainly used to prevent loops , Overwriting the original attributes may lead to routing Comes back , Cause loop generation .

[r1-route-policy]q

[r1]route-policy as permit node 20

Info: New Sequence of this List.

③ stay BGP Call policy

[r1-bgp]peer 12.0.0.2 route-policy as export

*>i 10.0.0.0/24 3.3.3.3 0 100 0 1i

* i 2.2.2.2 0 100 0 1 11 22 33

*> 10.0.0.0/24 12.0.0.1 0 0 11 22 33 1 

i

[r2-route-policy]apply as-path 1 1 1 additive ---- It is suggested that AS_PATH Add the real leaving AS Of AS Number , because AS_PATH Attribute itself has anti ring effect , add to AS The route cannot be sent to the corresponding AS among , Affect the delivery of routes .AS_PATH Attribute when selecting a route , Just focus on AS Length of No , Don't pay attention to the content .

4、 Choose the route with the best origin code attribute . Priority of origin code ---I>E>?

OGN --- Origin code ---I,e,?--- 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

?--- Routes learned through other than the above two methods --- The route origin codes of republishing and importing are ?

Control the method of route selection :

(1) Grab flow

[r2]ip ip-prefix ogn permit 10.0.0.0 24

(2) Configure routing policies

[r2]route-policy ogn permit node 10 

Info: New Sequence of this List.

[r2-route-policy]if-match ip-prefix ogn

[r2-route-policy]apply origin ?

egp Remote EGP

igp Local IGP

incomplete Unknown heritage

[r2-route-policy]apply origin incomplete

[r2-route-policy]q

[r2]route-policy ogn permit node 20

Info: New Sequence of this List.

[r2-route-policy]q

(3) stay BGP Call in the

[r2-bgp]peer 12.0.0.1 route-policy ogn import

5、 optimization MED Routes with small attribute values

MED --- Multi exit authentication attribute ---MED The default initial value is not 0, Instead, it inherits the cost value of the routing entry in the routing table , therefore , It can reflect the arrival of the target network segment in this AS Internal overhead size , Through this parameter , other AS The flow is entering this AS You will be able to choose the less expensive entrance to enter . By modifying this attribute value , We can also influence others AS Flow into this AS The path of . If it passes locally IBGP The peer learns a BGP route , There is MED value , Then you need to pass this route to the local EBGP peers , Then he will no longer carry this MED value . This setting may cause poor route selection . therefore , Suggest , If there are multiple groups of boundary devices, you need to send routes to EBGP Peer relationship , All routing information needs to be published .( Every device needs to be released )

Interference routing method :

stay R2 On the configuration , influence R1 The right way

(1) Grab traffic

[r2]ip ip-prefix med permit 4.4.4.0 24

(2) Configure routing policies

[r2]route-policy med permit node 10

Info: New Sequence of this List.

[r2-route-policy]if-match ip-prefix med 

[r2-route-policy]apply cost 10

[r2-route-policy]q

[r2]route-policy med permit node 20

Info: New Sequence of this List.

[r2-route-policy]q

(3) stay BGP Call in process

[r2-bgp]peer 12.0.0.1 route-policy med export

Be careful :MED Value affects others AS The flow enters the city through multiple outlets AS Inside , If the inflow is not the same AS, That is, in the received routing entries AS_PATH The leftmost of the property AS Different numbers , Then we will not compare Article 6 , Compare directly with 7 strip .

[r4]ping -r -a 4.4.4.4 1.1.1.1--- It can record the whole process of flow

6、EBGP Peer routing is better than IBGP peers

原网站

版权声明
本文为[Ma ordinary]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207230604354386.html