Dynamic routing BGP summary 1

1, Dynamic routing protocol partition

algorithm

  • Distance vector RIP EIGRP (fastest convergence) BGP (path information)
  • Link state OSPF ISIS
  • Path vector BGP

Scope AS

  • IGP internal gateway protocol
  • EGP border gateway protocol

BGP partition AS 1-65535 64512-65535 private as 2 ^ 16 insufficient as number

2, Characteristics

  1. Neighbors can be established across hops
  2. A protocol that emphasizes routing delivery control: routing learning, selectivity, routing control
  3. Manually establish neighbors
  4. BGP has multiple routing attributes

3, Neighbor building of BGP

BGP uses TCP protocol to establish neighbor port number 179 through unicast

Neighbor type:

  • The BGP neighbor established within the IBGP neighbor AS is consistent with the AS number of the neighbor router
  • BGP neighbors are established between EBGP neighbors and AS, and the AS numbers of neighbor routers are different

    Generally speaking, BGP's EBGP neighbor building will use direct connection and IBGP neighbor building will use loopback.
    If we use loopback to establish EBGP neighbors, we need to modify the number of neighbor hops.
bgp 200
 router-id 2.2.2.2
 peer 10.1.24.2 as-number 300
 peer 10.4.4.4 as-number 300
 peer 10.4.4.4 ebgp-max-hop 2 //Modify the number of hops without adding a value. The default value is 255
 peer 10.4.4.4 connect-interface LoopBack0
bgp 100
 router-id 1.1.1.1
 peer 10.1.13.2 as-number 300
 peer 10.1.13.2 password simple 123 //BGP certification

BGP neighbor state transition and packet

BGP does not update periodically, but only triggers the update. The update package can update the route or revoke the route. The update speed of BGP is very slow.

4, BGP route generation

  1. network
    The Network command introduces the existing routes in the IP routing table into the BGP routing table one by one.
    The mask declaration must correspond to the routing mask in the routing table, otherwise it will not be declared.
  2. import
    The Import command imports routes into the BGP routing table according to the running Routing Protocols (RIP, OSPF, ISIS, etc.), and
    The import command can also introduce direct and static routes.

5, BGP routing learning

  1. Only publish your best route to your neighbors
  2. The optimal route obtained through EBGP is published to all BGP neighbors
  3. Transfer routing cannot be performed between IBGP - the reason is that ring prevention is a horizontal split setting - there is no ring prevention calculation between IBGP
  4. Synchronization between BGP and IGP - BGP will check whether its route has been republished to IGP. If yes, it is synchronous. If not, it is out of sync (out of sync routes are not superior in BGP)
    -1 BGP full interconnection - configure BGP on the black hole router and establish neighbors with other BGP routers
    -2 republish - introduce BGP routing into IBGP - synchronize BGP with IGP
    -3 mpls as tunnel
  5. When routing is transferred between IBGP, the next hop of the route remains unchanged
    Peer 10.4.4.4 next hop local / / solve the next hop unreachable problem
  6. When routing between EBGP, the next hop of the route will be modified to its own update address (neighbor building address)

6, BGP routing update

Local routing (BGP-RIB) - -- > filtering ----- > outgoing BGP-RIB - updata – > incoming BGP-RIB of neighbor – > filtering - > local BGP-RIB of neighbor

7, BGP filtering

  1. Use prefix lists to implement filtering
bgp 100 
router-id 1.1.1.1 
peer 10.1.13.2 as-number 300 
#
ipv4-family unicast 
undo synchronization 
network 30.1.1.1 255.255.255.255 
network 100.1.1.1 255.255.255.255 
network 100.2.2.2 255.255.255.255 
network 100.3.3.3 255.255.255.255 
peer 10.1.13.2 enable 
peer 10.1.13.2 ip-prefix 3 export 
#
ip ip-prefix 3 index 10 deny 100.3.3.3 32 
ip ip-prefix 3 index 20 permit 0.0.0.0 0 less-equal 32
  1. Use route policy to implement filtering
bgp 300
router-id 4.4.4.4
peer 10.1.24.1 as-number 200
peer 10.3.3.3 as-number 300
peer 10.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 20.4.4.4 255.255.255.255
import-route direct route-policy direct
peer 10.1.24.1 enable 
peer 10.1.24.1 route-policy 2 export 
peer 10.3.3.3 enable 
peer 10.3.3.3 next-hop-local 
route-policy 2 deny node 10 
if-match ip-prefix 3 
#
route-policy 2 permit node 20 
#
ip ip-prefix 3 index 10 permit 100.2.2.2 32

Tags: Operation & Maintenance network Network Protocol

Posted on Sun, 10 Oct 2021 03:58:17 -0400 by cliffdodger