The topology diagram and the topic are in the 2016 Xinhua Three Cup rematch experiment blog in this column, the basic configuration is not included (IP address and vlan division)
IPv4 BGP routing deployment
The BGP protocol is used between the headquarters and the distribution, and the specific requirements are as follows:
- The branch is AS200, the headquarters is AS100
- R1 and R2 in the headquarters need to establish an IBGP connection with loopback0 as the original address
- Configure the next hop (NEXT_HOP) attribute of BGP to avoid routing loops
- All the routes of the branch must be advertised with the network command, and the routes of the headquarters are advertised by importing
- Avoid routing loops by configuring the BGP route priority value as 80 (EBGP), 100 (IBGP), and 130 (local BGP).
- The branch advertises the default route to the headquarters
- Ultimately reach the whole network interoperability
R1
bgp 100 #Create and enter bgp100
router-id 9.9.9.1
peer 9.9.9.2 as-number 100 #Specify the neighbor's IP address and AS number
peer 9.9.9.2 connect-interface LoopBack0 #Specify the source interface
peer 10.0 used to establish a TCP connection. 0.18 as-number 200
#
address-family ipv4 unicast
preference 80 100 130 #Configure the BGP route priority value as 80 (EBGP), 100 (IBGP), 130 (local BGP)
import-route ospf 10 #For ospf routing, that is private Network routing to import
peer 9.9.9.2 enable #Enable the ability of the local router to exchange routing information with the specified peer(neighbor's address)
peer 9.9.9.2 next-hop-local #Configure the next hop (NEXT_HOP) attribute of BGP
peer 10.0.0.18 enable
R2
bgp 100
router-id 9.9.9.2
peer 9.9.9.1 as-number 100
peer 9.9.9.1 connect-interface LoopBack0
peer 10.0.0.22 as-number 200
#
address-family ipv4 unicast
preference 80 100 130
import-route ospf 10
peer 9.9.9.1 enablepeer 9.9.9.1 next-hop-local
peer 10.0.0.22 enable
R3
bgp 200
router-id 9.9.9.3
peer 10.0.0.17 as-number 100
peer 10.0.0.21 as-number 100
#
address-family ipv4 unicast
network 9.9.9.3 255.255.255.255
network 192.0.50. 0 255.255.255.0
peer 10.0.0.17 enable
peer 10.0.0.17 default-route-advertise #Advertise a default route to neighbors
peer 10.0.0.21 enable
peer 10.0.0.21 default-route-advertise
Test view: view neighbor status on R1
At this time, if you want to achieve network-wide intercommunication, you need to introduce bgp routing into the ospf protocol on R1 and R2
R1 and R2 have the same configuration
ospf 10
import-route bgp #Introduce bgp routing in ospf
Route Optimization Deployment
In order to prevent the originating route in this routing domain from being redirected back to this routing domain, thus causing a loop. Plan to use Route-Policy to filter when importing routes from BGP to OSPF. The specific requirements are as follows:
- Use the method of labeling the imported route (label value is 100) to achieve
- The Route-Policy name is bgp2ospf, and the node numbers are 10 and 20
R1 and R2 are configured the same
route-policy bgp2ospf deny node 10 #Configure the first routing policy node to deny the route with a tag value of 100
if-match tag 100
#
route-policy bgp2ospf permit node 20 #Configure the second routing policy node as Empty nodes allow all