配置:如图A B 两路由器原来通过E0/0 接口互联,192.168 网段为业务网段;172.16 网段为办公网段,并运行OSPF 协议。现增加了一条低速的链路,想让办公网段走该链路,先欲用静态路由的方法实现。配置如下:
A:
interface Ethernet0/0
ip address 10.0.0.1 255.255.255.252
#
interface Serial0/0
link-protocol ppp
ip address 10.0.0.5 255.255.255.252
#
interface LoopBack0
ip address 192.168.0.1 255.255.255.0
#
interface LoopBack1
ip address 172.16.0.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.0.0.1 0.0.0.0
network 172.16.0.0 0.0.0.255
network 192.168.0.0 0.0.0.255
#
ip route-static 172.16.1.0 255.255.255.0 10.0.0.6 preference 60
B:
interface Ethernet0/0
ip address 10.0.0.2 255.255.255.252
#
interface Serial0/0
clock DTECLK1
link-protocol ppp
ip address 10.0.0.6 255.255.255.252
#
interface LoopBack0
ip address 192.168.1.1 255.255.255.0
#
interface LoopBack1
ip address 172.16.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.0.0.2 0.0.0.0
network 172.16.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
#
ip route-static 172.16.0.0 255.255.255.0 10.0.0.5 preference 60
故障:查看路由表发现静态输入的条目并没有添加。
[A]dis ip routing-table
Routing Table: public net
[A]
[B]dis ip routing-table
Routing Table: public net
[B]
分析:在H3C 中和CISCO 不同,H3C 中OSPF 域内路由的优先级是10,而静态路由的优先级默认是60.这就造成了因优先级不足,到时条目未能加入到全局路由表。修正静态路由协议的优先级后排除。
A:
#
ip route-static 172.16.1.0 255.255.255.0 10.0.0.6 preference 5
#
B:
#
ip route-static 172.16.0.0 255.255.255.0 10.0.0.6 preference 5
#