38-Advanced routing: BGP routing: loop Prevention
1. Experimental topology:
Note: Only R2 and R3 routers are used here.
II. Experimental requirements:
1. Add Lo1:20.20.20.20 after R2 and announce that it is in BGP process;
2. Deploy static routing outbound interfaces on R3 (must be yes, otherwise inheritance occurs);
3. R3 announces 20.20.20.20 under BGP process;
4. Grab traffic on R3 and deploy route-map so that the next hop of the optimal path of 20.20.20.20 is 2.2.2.2.
5. Check whether the next hop of route 20.20.20.20 on R3 is 0.0.0.0. Is there a loop risk?
6. Verify: After deployment 4, whether the next hop of the optimal path is 2.2.2.2
III. Command deployment:
1, 2, 3 Deployment:
R2(config)#int lo1
R2(config-if)#ip add 20.20.20.20 255.255.255.0
R2(config)#router bgp 123
R2(config-router)#network 20.20.20.0 mask 255.255.255.0
R3(config)#ip route 20.20.20.0 255.255.255.0 f0/0
R3(config)#router bgp 123
R3(config-router)#network 20.20.20.0 mask 255.255.255.0
4. Deployment:
R3(config)#access-list 10 permit 20.20.20.0 0.0.0.255
R3(config)#route-map pl permit 10
R3(config-route-map)#match ip address 10
R3(config-route-map)#set weight 32768
R3(config-route-map)#route-map pl permit 20
R3(config-route-map)#match ip address 10
R3(config-route-map)#set local-preference 200
R3(config-route-map)#route-map permit 1000
R3(config)#router bgp 123
R3(config-router)#neighbor 2.2.2.2 route-map pl in
IV. Verification:
1, 2, 3 Verification after deployment:
R3#show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 20.20.20.0/24 0.0.0.0 0 32768 I
i 2.2.2.2 0 100 0 i
R2#show ip bgp
Network Next Hop Metric LocPrf Weight Path
i20.20.20.0/24 3.3.3.3 0 100 0 i
*> 0.0.0.0 0 32768 i
4. Verification after deployment: