Ruijie-BGP routing control experiment-route-map

  1. Configure the IP address as required, R1 and R4 configure the loopback interface to simulate the service network segment, and R2 and R3 configure the Loopback0 interface address as the OSPF Router-id and IBGP neighbor address
  2. AS200 internally configures OSPF, which is only used to achieve BGP TCP reachability, and does not allow the announcement of service network segments
  3. Configure BGP, R1 and R2/R3 establish an EBGP neighbor relationship, R4 and R2/R3 establish an IBGP neighbor relationship, and R1 and R4 respectively declare the service network segment into BGP
  4. Modify the MED so that the route from R1 to the 192.168.2.0/24 network segment passes through R3
  5. By modifying the Preferred-value attribute, make the route from R4 to the network segment 192.168.0.0/24 pass through R3
  6. By modifying the AS_path attribute, the route from R1 to the 192.168.3.0/24 network segment passes through R3
  7. By modifying the Local-pref attribute, make the route from R4 to the network segment 192.168.1.0/24 pass through R3

Problem solving:

1. Omission

2. Omission

3. Configure BGP, R1 and R2/R3 establish EBGP neighbors, R4 and R2/R3 establish IBGP neighbors, R1 and R4 respectively declare the business network segment into BGP

R1

router bgp 100

 neighbor 100.1.1.2 remote-as 200 # Establish a neighbor with a direct connection interface
 neighbor 100.3.3.2 remote-as 200

 network 192.168.0.0 mask 255.255.255.0 #declare business routing
 network 192.168.1.0 mask 255.255.255.0

R2

router bgp 200

 neighbor 4.4.4.4 remote-as 200
 neighbor 4.4.4.4 update-source Loopback 0 #Set update source as loopback port
 neighbor 100.1.1.1 remote-as 100

 neighbor 4.4.4.4 next-hop-self #Set the next hop as self

R3

router bgp 200

 neighbor 4.4.4.4 remote-as 200
 neighbor 4.4.4.4 update-source Loopback 0
 neighbor 100.3.3.1 remote-as 100

 neighbor 4.4.4.4 next-hop-self

R4

router bgp 200

 neighbor 2.2.2.2 remote-as 200
 neighbor 2.2.2.2 update-source Loopback 0
 neighbor 3.3.3.3 remote-as 200
 neighbor 3.3.3.3 update-source Loopback 0

 network 192.168.2.0 mask 255.255.255.0 #declare business routing
 network 192.168.3.0 mask 255.255.255.0     

4. Modify the MED so that the route from R1 to the 192.168.2.0/24 network segment passes through R3

R2

ip access-list standard 1 #Set ACL list, capture traffic
 10 permit 192.168.2.0 0.0.0.255

route-map x2 permit 10 #Create a routing policy, call acl1, the action is to modify the cost to 100
 match ip address 1
 set metric 100

route-map x2 permit 20 #Set empty nodes to allow other traffic to pass

router bgp 200 #Enter bgp to call the routing policy of R1, according to the routing rules, the route with low cost will be selected

neighbor 100.1.1.1 route-map x2 out

Test: Execute show ip bgp on R1 to view the bgp routing table, you can see that *> means the best, and R3 is preferred as the next hop

 5. By modifying the Preferred-value attribute, make the route from R4 to the 192.168.0.0/24 network segment pass through R3

R4

ip access-list standard 1 #Set acl No. 1 to capture traffic
 10 permit 192.168.0.0 0.0.0.255 

route-map x4 permit 10 #Create a routing policy, call No. 1 acl, and modify the Preferred-value to 200
 match ip address 1
 set weight 200

route-map x4 permit 20 #Set empty nodes

router bgp 200 #Enter bgp to invoke the strategy for R3, and select the one with the higher Preferred-value value according to the routing rules

neighbor 3.3.3.3 route-map x4 in

Test: Execute show ip bgp on R4 to view the bgp routing table, you can see that *> means the best, and R3 is preferred as the next hop

 6. By modifying the AS_path attribute, make the route from R1 to the 192.168.3.0/24 network segment pass through R3

R1

ip access-list standard 1 #Set ACL to capture traffic
 10 permit 192.168.3.0 0.0.0.255 

route-map x1 permit 10 #Create a routing policy, call No. 1 acl, and set the action to add an as number of 100
 match ip address 1
 set as-path prepend 100

route-map x1 permit 20 #Set empty nodes

router bgp 100 #Enter bgp to invoke routing, according to routing rules, will select the one with the shortest as list

neighbor 100.1.1.2 route-map x1 in

test:

 7. By modifying the Local-pref attribute, make the route from R4 to the network segment 192.168.1.0/24 pass through R3

ip access-list standard 1 #Set acl number 1, capture traffic
 10 permit 192.168.1.0 0.0.0.255 

route-map x3 permit 10 #Set the routing strategy, call acl number 1, and set the action to modify the local priority
 match ip address 1
 set local-preference 200

route-map x3 permit 20 #Set empty nodes

router bgp 200 #Enter bgp to call the policy, according to the routing rules, the local priority (local-preference) will be selected

 neighbor 4.4.4.4 route-map x3 out

test:

Guess you like

Origin blog.csdn.net/m0_62621003/article/details/130011068