在IBGP重分布IGP路由时,默认情况下,协议为了防止路由环路是无法直接注入的,在H3C设备需要增加allow-ibgp参数。
网络拓扑图如下:
XRV2属于BGP AS65009 XRV3和XRV4属于BGP AS65001,其中XRV4和XRV5运行OSPF100,将XV4从IBGP邻居学习到的BGP路由注入到OSPF100操作如下:
#
route-policy BGP-TO-OSPF permit node 10
if-match ip address prefix-list BGP-TO-OSPF
#
ip prefix-list BGP-TO-OSPF index 10 permit 10.0.0.0 8 less-equal 24
#
ospf 100 router-id 10.255.255.4
import-route bgp allow-ibgp route-policy BGP-TO-OSPF
silent-interface all
undo silent-interface GigabitEthernet0/1
preference 110
preference ase 110
#
注入后在XRV5上查看OSPF OE2路由的变化:
<XRV5>display ip routing-table protocol ospf
Summary count : 131
OSPF Routing table status : <Active>
Summary count : 65
Destination/Mask Proto Pre Cost NextHop Interface
10.33.1.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.2.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.3.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.4.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.5.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.6.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.7.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.8.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.9.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.10.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.11.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.12.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.13.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.14.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.15.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.33.16.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.1.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.2.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.3.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.4.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.5.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.6.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.7.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.8.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.9.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.10.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.11.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.12.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.13.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.14.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.15.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.55.16.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.1.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.2.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.3.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.4.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.5.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.6.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.7.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.8.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.9.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.10.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.11.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.12.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.13.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.14.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.15.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.133.16.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.1.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.2.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.3.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.4.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.5.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.6.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.7.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.8.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.9.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.10.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.11.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.12.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.13.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.14.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.15.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.158.16.0/24 O_ASE2 110 1 10.202.1.1 GE1/0/1
10.255.255.4/32 O_INTRA 110 1 10.202.1.1 GE1/0/1