R1:
router bgp 100
network 11.1.1.0 mask 255.255.255.0
exit
R2:
show ip route
以上表示当11.1.1.0/24这条路由同时从EBGP邻居和OSPF邻居学习到的时候,会选择从BGP邻居学习到的路由,因为EBGP路由的AD值为20.
要想让R2优选从OSPF学习的路由,需要在R2上做BGP后门路由配置。
R2:
router bgp 200
network 11.1.1.0 mask 255.255.255.0 backdoor
exit
show ip route
int f1/0
shutdown
exit
show ip route