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

Huawei BGP dynamic routing Protocol Theory + experiment

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Article directory preface 1: BGP protocol theory 1.1: Overview 1.2: dynamic routing classification 1.2.1: classification by autonomous system 1.2.2: classification by protocol type 1.3:BGP working principle 1.4.1:BGP message 1.4.2:BGP database 1.4.3:BGP type 2: BGP protocol experiment 2.1: experimental environment 2. 2: experimental purpose 2.3Experimental Topology Diagram 2.4Experimental process 2.4.1: command explanation 2.4.2: practice 2.5: experimental Verification 2.6.Experimental Summary 1: BGP Protocol Theory 1.1: Overview BGP is a dynamic routing protocol running between AS and AS The main function is to automatically exchange loop-free routing information between AS to construct the topology diagram of AS, so as to eliminate routing loops and implement user-configured routing policies. At present, there are many entries in the public network, which cannot be carried by the IGP protocol, but BGP can easily deal with it. Usually, the BGP protocol is used for routing information exchange between ISP and ISP or between general and branch offices in cross-domain regions. The self-made numbering autonomous system (AS) is managed by a technical management organization. A group of routers using a unified routing policy have a set of autonomous system numbers: 1-65535, of which 1-64511 is the registered public AS number on the Internet. Similar to the public network IP address. 64512-65535 is a private AS number, similar to private IP address www.inna.org, registered URL (individual cannot register) 1.2.1: classification of dynamic routing 1.2.1: classified by autonomous system internal routing protocol of IGP autonomous system, mainly: RIP1/RIP2, OSPF, ISIS, EIGRP (Cisco private protocol) IGP is a routing protocol running within AS, which mainly solves the routing problem within AS. Discovering and calculating routing protocols between EGP autonomous systems, usually: BGPEGP is a routing protocol running between AS and AS, and it solves the routing problem between AS. 1.2.2: distance vector routing protocols rip1/2, BGP (path vector protocol), EIGRP (advanced distance vector protocol) link-state routing protocols OSPF, ISIS: characteristics of 1.3:BGP using SPF shortest path algorithm: TCP, port number 179BGP is an external routing protocol Used to pass routing information between AS is an enhanced path vector routing protocol with reliable routing update mechanism with rich Metric metrics loop-free protocol design for routing entries with multiple attribute information support for CIDR (classless inter-domain routing) rich routing filtering and routing policies when there is no need to periodically update routing updates only send incremental routes periodically send KeepAlive packets to protect How TCP Connectivity 1.4:BGP works 1.4.1:BGP message Open message OPen message is the first message sent after the establishment of TCP Used to establish the connection relationship between BGP peers, mainly including BGP version number, local AS number, Holdtime, etc. UPdate message Update message is used to update routing information between BGP, Updata message can advertise multiple reachable routing information with the same attribute, or it can revoke multiple routing information that is unreachable. The function of Notification message is to send NOtification message to peer immediately when BGP detects an error state. After that, the BGP will interrupt that as soon as it receives the Notification message, it will return the idle status Route-Refresh message to inform the peer of the refresh ability of the supported route. The ingress policy route of the BGP has changed, and the local BGP route will send the Route-Refresh message to the peer. After receiving the message, the peer will re-send its routing information to the local BGP router KeepAlive message. This message is sent periodically between peers. To maintain the validity of the connection and maintain its connection, the KeepAlive message has only one BGP header. The default KeepAlive message sending cycle is 60s and the retention time is 180s. This is similar to the Hello message 1.4.2:BGP database in OSPF IP routing table: global routing information base, including optimal IP routing information BGP routing information database, including local BGPSpeak advertised routing information. Add its optimal neighbor table to the routing table: peer neighbor list table, including neighbor information at both ends of peer and neighbor list Adi-RIB-In: unprocessed routing information base declared by peer to local Speak Adjust-RIB-OUT: local Speak declared to specified peer routing information base 1.4.3:BGP two types of neighbors: IBGP and EBGPIBGP: the same AS internal BGP neighbor relationship IBGP neighbor refers to the BGP neighbor relationship between peers running BGP protocol in the same AS domain, which belongs to the internal EBGP:AS of BGP AS. EBGP usually refers to the two ends of peers running BGP protocol in different AS. 2: BGP protocol experiment 2.1: experimental environment eNSP software 4 routers (R1 Magi R2 Magi R4 in OSPF area 0, also in AS100 R3 in AS200 2.2: experimental purpose through configuration Realization of network-wide interworking 2.3: experimental topology diagram

2.4.1: the command explains the BGP configuration idea 1. Enable BGP, followed by AS system number 2, declare Route-id, and establish neighbor relationship. Because this contains OSPF protocol, router-id can announce before starting BGP, reduce one operation step 3, declare who to establish neighbor relationship with 4, advertise BGP route. (network, import) commands show'/ / establish neighbor relationship'[R1] router-id 1.1.1.1'/ / declare router-id' [R1] bgp 100'/ / launch bgp' [R1-bgp] peer 7.7.7.7 as-number 100'/ / the first step in establishing a neighbor relationship, and announce the second step of establishing a neighbor relationship in the as area'[R1-bgp] peer 7.7.7 connect-interface loo 0'/ / to be established. Use loo 0 address to establish neighbor relationship'[R1-bgp] network 1.1.1.1 32'/ declare network segment'/ / View command'[R1] display bgp peer'/ / View BGP neighbor'[R1] display routing-table'/ / View BGP routing table'[R1-bgp] import-route ospf 1'/ / routes injected into ospf/ISIS'/ / only neighbor relationships are established The injected routing information can be learned by the neighbors' 2.4.2: I directly give the results of the actual configuration commands, and everyone should know the details. If you have any questions, you can talk to me privately or comment on the R1 configuration sysname R1 / / modify the name router id 1.1.1.1 / / announce the router idint g0 30int loo 0 / / configure the interface address ip add 12.0.0.1 30int g0 prime 0 / / configure the interface address ip address 15.0.0.1 30int loo 0 / / configure the interface address ip add 1.1 .1.1 32bgp 100 / / start bgp The first step to establish a neighbor relationship for the route with process number peer 2.2.2.2 as-number 100 / / and the route with router id 2.2.2.2 and as area 100, and specify the second step for establishing neighbor relationship for the route with peer 2.2.2.2 connect-interface LoopBack0 / / and router id 2.2.2.2 The first step of establishing a neighbor relationship by using the loo 0 interface to connect the other side peer 4.4.4.4 as-number 100 / / and the route whose router id is 4.4.4.4 and as area is 100, specify the other side peer 4.4.4.4 connect-interface LoopBack0 / / and router id 4.4.4. The second step in establishing a neighbor relationship Connect the other side network 1.1.1.1 255.255.255.255 / / declare the network segment ospf 1 / / start the ospf process as 1area 0.0.0.0 / / declare the ospf area network 1.1.1.1 0.0.0.0 / / the following are declared network segments network 12.0.0.0 0.0.0.3network 15.0.0.0 .0.3R2 configuration sysname R2router id 2.2.2.2int g0/0/0ip add 12.0.0.2 30int g0/0/1ip add 23.0.0.1 30int loo 0ip add 2.2.2.2 32bgp 100peer 1.1.1.1 as-number 100peer 1.1.1.1 connect-interface LoopBack0peer 4.4.4.4 as-number 100peer 4.4.4.4 connect-interface LoopBack0peer 23.0.0.2 as-number 200 / / Direct use 23 .0.0.2 physical address to establish a connection with the router in the bgp200 area You cannot use the virtual interface address network 2.2.2.2 255.255.255.255import-route ospf 1 / / to inject routing entries into ospf 1, otherwise R3 will not learn other routing entries in bgp100, except for the 2.2.2.2 announced by R2 in BGP. So you need to inject the routing entry 'ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 12.0.0.0 0.0.0.3network 23.0.0.0 0.0.0.3R3 configuration sysname R3router id 3.3.3.3int g0/0/1ip add 23.0.0.2 30int loo 0ip add 3.3.3.3 32bgp 200peer 23.0.0.1 as-number Establish neighbor relationship with router with physical address 23.0.0.1 and bgp100 network 3.3.3.3 255.255.255.255R4 configure sysname R5router id 4.4.4.4int g0/0/1ip add 15.0.0.2 30int loo 0ip add 4.4.4.4 32int loo 1ip add 202.0.0.1 24int loo 2ip add 202.0.1.1 24bgp 100peer 1.1.1.1 as-number 100peer 1. 1.1.1 connect-interface LoopBack0peer 2.2.2.2 as-number 100peer 2.2.2.2 connect-interface LoopBack0network 4.4.4.4 255.255.255.255ospf 1area 0network 4.4.4.4 0.0.0.0network 15.0.0.0 0.0.0.3network 202.0.0.0 0.0.0.255network 202.0.1.0 0.0.255 at this point we can use dis ip routing-table to find that the Learned all routing entries 2.5 from each other: experiment verifies successful network-wide interconnection You can test several other routers in the same way.

2.6. it is concluded that physical address is needed to establish neighbor relationship across autonomous domains, otherwise two routers cannot learn each other's routing entries. If you want to learn all routing entries in each other's area, you need to inject ospf or IS-IS routing entries into the neighbor relationship across autonomous domains. If you want to use a virtual loopback address, you need to add a static route. And point to the addition of the next two-hop'/ / static route without repeating'# R2hop # [R2] router id 2.2.2.2 [R2] bgp 100 [R2-bgp] peer 3.3.3.3 as-number 200 [R2-bgp] peer 3.3.3.3 connect-interface LoopBack 0 [R2-bgp] peer 3.3.3.3 ebgp-max-hop 2##R3## [R3] router id 3.3.3.3 [R3] Bgp 200 [R3-bgp] peer 2.2.2.2 as-number 100 [R3-bgp] peer 2.2.2.2 connect-interface LoopBack 0 [R3-bgp] peer 2.2.2.2 ebgp-max-hop 2

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