BGP Basic Configuration Experiment

configuration requirements

image-20220524112450273

1. Configure OSPF in the AS100 area at the bottom layer, and use static routes to connect other areas to the ospf area.
2. AR1 establishes an EBGP neighbor relationship with AR2 (using loopback 0), and AR4 establishes an EBGP neighbor relationship with
AR5. 3. AR2 and AR3 establish an IBGP neighbor relationship. , AR3 and AR4 establish an IBGP neighbor relationship
4. After AR1 announces the loopback 0 route. Can AR5 learn it? How to do it?

 BGP is a protocol based on IGP, so the first step must be to configure the IGP protocol. Everyone has learned BGP, and there must be no problem with the underlying configuration, so I will briefly list the IGP commands.

#AR2
ospf 1 router-id 10.1.2.2 
 area 0.0.0.0 
  network 10.1.2.2 0.0.0.0 
  network 10.1.23.2 0.0.0.0 
#AR1
ip route-static 10.1.2.0 255.255.255.0 10.1.12.2

AR1 and AR2 establish an EBGP neighbor relationship (using loopback 0), we need to specify the source address of the access (because the TCP connection requires the same source and destination), and the hop number of ebgp must be modified. The default is 1 and cannot be connected.

image-20220524114546785

//AR1
bgp 200
 peer 10.1.2.2 as-number 100 
    //注意双方都要改变ebgp的最大跳数值
 peer 10.1.2.2 ebgp-max-hop 5 
 peer 10.1.2.2 connect-interface LoopBack0
 
//AR2 
peer 10.1.1.1 as-number 200 
 peer 10.1.1.1 ebgp-max-hop 5 
 peer 10.1.1.1 connect-interface LoopBack0

AR4 establishes an EBGP neighbor relationship with AR5, and an interface is used to establish the neighbor relationship here.

image-20220524114903663

//AR4
bgp 100
 peer 10.1.45.5 as-number 300 
//AR5
 bgp 300
 peer 10.1.45.4 as-number 100 

AR2 and AR3 establish an IBGP neighbor relationship, and AR3 and AR4 establish an IBGP neighbor relationship

image-20220524115401922

//AR2
bgp 100
 peer 10.1.1.1 as-number 200 
 peer 10.1.1.1 ebgp-max-hop 5 
 peer 10.1.1.1 connect-interface LoopBack0
 peer 10.1.3.3 as-number 100 
 peer 10.1.3.3 connect-interface LoopBack0
    
//AR3
 bgp 100
 peer 10.1.2.2 as-number 100 
 peer 10.1.2.2 connect-interface LoopBack0
 peer 10.1.4.4 as-number 100 
 peer 10.1.4.4 connect-interface LoopBack0
    
//AR4
 bgp 100
 peer 10.1.3.3 as-number 100 
 peer 10.1.3.3 connect-interface LoopBack0
 peer 10.1.45.5 as-number 300 
    

After AR1 announces the loopback 0 route. Can AR5 learn it? How to do it?

Answer: It is impossible to learn, because of the principle of split horizon, AR2 can be passed to AR3, but AR3 cannot be passed to AR4, which is also an IBGP, and AR4 cannot receive it, let alone AR5. If you want AR5 to learn it , the premise is that AR4 can learn it, so we can make AR4 learn it by doing full interconnection, don’t forget to change the next hop (the device will not change dynamically, it needs to be manually specified).

After AR1 announces the loopback interface address 10.1.9.9, AR5 cannot learn it (horizon split principle).

image-20220524120807044

After the full interconnection is established, AR5 still cannot learn it. This is because the next hop is not specified, and what AR4 learns is not valid, so it will not be passed to AR5 (notification first principle, only the optimal and effective route is passed).

image-20220524121127376

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-gka1r1Og-1653820357266) (D:\Practical software\text editing software typora\Typora_File\img\image-20220524121142512 .png)]

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-oWpQL6la-1653820357266) (D:\Practical Small Software\Text Editing Software typora\Typora_File\img\image-20220524121256053 .png)]

Say to AR3 and AR4 on AR2, my friend, I will be your next hop, come on, and the route learned by AR4 becomes a valid route and can be passed to AR5.

[AR2-bgp]peer 10.1.3.3 next-hop-local 
[AR2-bgp]peer 10.1.4.4 next-hop-local

image-20220524121747500

image-20220524121817409

Guess you like

Origin blog.csdn.net/xiaobai729/article/details/125034410