【H3C】现网 BGP与OSPF结合配置

1.OSPF
 ospf 1 router-id x.x.x.x
  non-stop-routing
  import-route bgp
  silent-interface all
  undo silent-interface xxx
  area 0
  netwok X.X.X.X(router-id) 0.0.0.0
  netwok X.X.X.X(silent-interface ip) 0.0.0.0

2.BGP
 bgp 65XXX
  non-stop-routing
  router-id x.x.x.x
  timer keepalive 3 hold 9
  peer x.x.x.x as-number 65xxx
  peer x.x.x.x route-update-interval 1
  peer x.x.x.x bfd

 address-family ipv4 unicast
  import-route ospf 1
  network x.x.x.x 255.255.255.255
  peer x.x.x.x enable
  peer route-policy set-as export

 address-family ipv4 multicast
  import-route ospf 1
  network x.x.x.x 255.255.255.255
  peer x.x.x.x enable
  peer route-policy set-as export

 route-policy set-as permit node 10【配置一条路由策略,加大as-path,影响选路】
  apply as-path 65000 65000

 3.OSPF在VRF中配置
 ospf xx【进程id】 router-id X.X.X.X vpn-instance xxx【vrf名字】
  non-stop-routing
  default-route-advertise always 【配置默认路由到这个这个接口】
  import-route static type1 【重定向静态路由到ospf进程中】
  vpn-instance-capability simple 【vpn-instance-capability simple
  是使能VPN实例支持OSPF协议的关键配置,不配置将导致OSPF在VPN环境中无法正常工作】
  area 0.0.0.0
  network X.X.X.X 0.X.X.X【使用反掩码,BPG不用反掩码】

 int vlan xxx【ospf建邻居接口】
  ip binding vpn-instance xxx
  ospf cost 10 【cost 值10为路由优选】
  ospf network-type p2p 【连接的接口下配置网络类型为p2p】

  ospf xxx area 0.0.0.X 【如果没有在进程中宣告,就在接口中宣告发送这个网段的路由】

  # 根据网络拓扑合理规划开销值
  核心链路: cost 1-10
  汇聚链路: cost 10-50
  接入链路: cost 50-100
  备用链路: cost 100+