Network 12.1.1.1 1.1.1.1 1220 32 8000000B 0
Sum-Net 23.1.1.0 2.2.2.2 1217 28 8000000A 1
Sum-Net 34.1.1.0 2.2.2.2 1645 28 80000010 2
Sum-Asbr 4.4.4.4 2.2.2.2 158 28 80000001 2这条lsa3是告知r-id为4.4.4.4这个asbr怎么去的,从2.2.2.2这个abr走
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 4.4.4.0 4.4.4.4 160 36 80000001 2
External 34.1.1.0 4.4.4.4 160 36 80000001 1
[Huawei]
[Huawei]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 3 Routes : 3
OSPF routing table status : <Active>
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
4.4.4.0/24 O_ASE 150 2 D 12.1.1.2 GigabitEthernet0/0/0
23.1.1.0/24 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/0
34.1.1.0/24 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
[Huawei]
ospf的负均衡和路由选择
ospf的路由选择是通过路由的cost来决定的,cost越小越优先。当目的路由的cost一样时,就会形成负载均衡。在ospf中cost是以接口带宽计算的100M=10、1G=1
1、普通配置让路由形成负载均衡
AR1
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 12.1.1.1 0.0.0.0
network 13.1.1.1 0.0.0.0
#
AR2
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 12.1.1.2 0.0.0.0
network 100.1.1.1 0.0.0.0
#
AR3
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 13.1.1.3 0.0.0.0
network 100.1.1.1 0.0.0.0
#
在AR1上查看负载均衡路由
[AR1]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 1 Routes : 2
OSPF routing table status : <Active>
Destinations : 1 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
100.1.1.1/32 OSPF 10 1 D 12.1.1.2 GigabitEthernet0/0/0
OSPF 10 1 D 13.1.1.3 GigabitEthernet0/0/1
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
[AR1]
查看路由选择,选择了从AR2去往100.1.1.1/32
[AR1]tracert 100.1.1.1
traceroute to 100.1.1.1(100.1.1.1), max hops: 30 ,packet length: 40,press CTRL
_C to break
1 12.1.1.2 20 ms 13.1.1.3 10 ms 20 ms
[AR1]
如果想让数据包从AR3去往100.1.1.1/32只需要修改负载分担的优先级就可以,让AR3到100.1.1.1/32的权重大于AR2就可以了(值越小越优先)