Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed introduction of BGP routing switching

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

First, BGP Overview: BGP is a protocol for routing learning and routing between autonomous systems.

1. Autonomous system

An autonomous system is a collection of routers that are managed by the same technical management organization and use a unified routing strategy (running the same dynamic routing protocol).

two。 Classification of dynamic routes

(1) classified by autonomous system

IGP: the routing protocol within the autonomous system, which mainly includes RIPv1/v2,OSPF,ISIS,EIGRP (Cisco Private Protocol).

EGP: the routing protocol between autonomous systems, which usually means that BGP,EGP is a routing protocol running between AS and AS

(2) classified by protocol type

Distance vector routing protocols: RIPv1/v2,BGP (routing vector protocol), EIGP (advanced distance vector protocol)

Link-state routing protocol: OSPF,ISIS

The concept of 3.BGP

BGP is a dynamic routing protocol running between AS and AS. Its main function is to automatically exchange loop-free routing information between AS.

Characteristics of 4.BGP

Transport protocol: TCP, port number 179

Is an enhanced path vector routing protocol

Have a reliable routing update mechanism

Have rich Metric measurement methods

Loop-free protocol design

Attach multiple attribute information to the route entry

Support for CIDR (classless inter-domain routing)

Rich routing filtering and routing strategies

No periodic updates are required

Only incremental routes are sent when routing updates

Send KeepAlive messages periodically to maintain TCP connectivity

Second, the working principle of BGP

BGP is a protocol across public networks and autonomous systems, and routing can be learned between autonomous systems.

BGP message: Open packet message, Update message, Notification message, Route-Refresh,KeepAlive

BGP state machine: IdIe state, Connect state, Active state, Opensent state, Established state

The neighbor relationship of BGP

IGBGP: BGP neighbor relationship within the same AS, (internal)

BGP neighbor relationship between EBGP:AS, (external)

According to whether the neighbors belong to the same autonomous system, we can judge the EBGP neighbor relationship between R1 and R2, the IBGP neighbor relationship between R2 and R4, and the EBGP neighbor relationship between R4 and R5.

Third, the method of advertising BGP routes

(Network mode) declare the network segment

(inport mode) equivalent to route redistribution

You can view the routing table of BGP through display bgp routing-table

Fourth, the configuration of BGP peers

Fourth, the properties of BGP

Public must comply: all BGP routers can recognize and must be in the Update message

It is generally accepted that any: all BGP routers can recognize it, but it does not have to be in the Update message. You can decide whether to add it to the Update message according to the specific situation.

Optional excess: the BGP router can choose whether to carry this attribute in the Update message, and if the receiving router does not recognize this attribute, it can forward it to the neighboring router (this is the meaning of excess)

Optional non-excessive: the BGP router can choose whether to carry this attribute in the Update message. On the entire route publishing path, if some routers do not recognize this attribute, it may cause the attribute not to work, because if the receiving router does not recognize this attribute, it will be discarded and no longer forwarded to the neighboring router.

The common properties of BGP are Origin,AS-PATH,NEXT-Hop,Local-pref and MED.

Origin is a public must, which is used to define the source of path information. Its function is to mark how a route becomes a BGP route. It has the following three attributes:

IGP (I): highest priority

EGP (e): second in priority

Lncomplete (? ): lowest priority

Fifth, the routing principle of BGP

Sixth, experimental cases

1. Configure the ip and loopback of each interface first, which are 1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4 respectively

two。 Configure OSPF on the three routers on the right (configure OSPF on R2.R3.R4)

R2 is as follows (internal network segment)

R3 is as follows:

R4 is as follows:

BGP configuration

R1 is as follows

Enter the port ip of the peer to declare yourself

R2 is as follows

The next command tells R4 that the next hop port to access R1 is on R2.

R3 is as follows

R4 is as follows

Then j can use R1pingR4.

Indicate who is coming to ping who

Finally, there is routing configuration (a total of 3 methods)

1. (routing is controlled according to local priority)

Configure on R3: route-policy lop permit node 10 / / create a routing policy named lop

[R3-route-policy] apply local-prefernce 222 / / set the local priority to 222,

Quit

[R3] bgp 200

[R3-bgp] peer 10.0.34.4 route-policy lop export

Reset bgp all / / restart BGP

2. (use the AS-PATH attribute to control routing) on R2

[R2] route-policy as permit node 10

[R2-route-policy] apply as-path 123 123 123 additive

[R2-route-policy] quit

[R2] bgp 200

[R2-bgp] peer 10.0.24.4 route-policy as export

Reset bgp all

3. (routing is controlled by the MED attribute) small priority

Configure on R2

[R2] route-policy med permit node 10

[R2-route-policy] apply cost + 500

[R2-route-policy] quit

[R2] bgp 200

[R2-bgp] peer 10.0.12.1 route-policy med export

Use display bgp routing-table to check the routing table of BGP.

Sixth, there is another experimental case, adding an extra router.

Adding one more router is equivalent to adding one more area. the steps are the same. R4 has to tell R2 and R3 that you have to go through me if you want to access R5, so add two next hops to R4 and configure R5.

R5 is configured as follows:

Loopback is 5.5.5.5

Bgp is 300,

R4 is configured to add these items.

Add two strips to R4 according to the previous experiment, R5 configuration

The experiment is complete!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report