配置:如圖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
#