1,重分发直连接口
r7(config)#route-map aaa //定义策略路由,名字为aaar7(config-route-map)#match interface loopback 110 //匹配环回接口110r7(config-route-map)#exitr7(config)#router os 100r7(config-router)#redistribute connected route-map aaa subnetsORr7(config-router)#redistribute connected route-map bbb subnets metric-type 1 //metric标准为OE1ORr7(config-router)#redistribute connected route-map bbb subnets metri 21 //手工指定metric值ORr7(config-router)#redistribute connected route-map bbb subnets tag 555 // 为充分布路由打标记r7(config-router)#exit
2、重分发静态路由没有办法把静态默认路由充分发进OSPF网络,仅能充分发静态明细路由
方法一:ip route 112.1.1.1 255.255.255.255 23.1.1.3ip route 0.0.0.0 0.0.0.0 23.1.1.3sw3(config)#router ospf 100sw3(config-router)#redistribute static subnetssw3(config-router)#exit
方法二:ip route 113.1.1.1 255.255.255.255 23.1.1.2 tag 100ip route 114.1.1.1 255.255.255.255 23.1.1.2 tag 200 ——为路由打上标记route-map aaa per 10match tag 100exitrouter ospf 100redistribute static route-map aaa subnetsexit
充分发进来的路由有两个metric标准:
------OE1:累加OSPF域内COST值------OE2:不累加OSPF域内cost值,默认cost为20
说明metric标准是可以影响OSPF选路的
充分发进来的外部路由默认的metric值为20,可以修改为150:(针对直连接口不生效)
router OSPF 100default-metric 150exit