发布时间: 2018-02-24 15:41:31
区域内部路由:Metic > AD > area-id
1.先比较Metric,越小越好;
2.如果Metric相同,比较AD值,越小越好;
3.如果AD也相同,比较Area-ID,越小越好;
4.如果上述完全相同,则负载均衡;
实验拓扑
区域内部路由选路规则第一条
首先在R2、R4启用一个loopback 0 = 20.1.1.1/24,且通告进ospf area 0
1、先比较metric值,越小越优
R3:
access-list 2 permit 20.1.1.0 0.0.0.255
access-list 4 permit 20.1.1.0 0.0.0.255
!
router ospf 110
distance 200 2.2.2.2 0.0.0.0 2
distance 110 4.4.4.4 0.0.0.0 4
!
interface FastEthernet0/0
ip address 34.1.1.3 255.255.255.0
ip ospf cost 19
!
interface FastEthernet0/1
ip address 23.1.1.3 255.255.255.0
ip ospf cost 2
查看路由表
区域内部路由选路规则第二条
2、如果metric值相同,比较AD值,越小越优
R3:
access-list 2 permit 20.1.1.0 0.0.0.255
access-list 4 permit 20.1.1.0 0.0.0.255
!
router ospf 110
distance 130 2.2.2.2 0.0.0.0 2
distance 120 4.4.4.4 0.0.0.0 4
!
interface FastEthernet0/0
ip address 34.1.1.3 255.255.255.0
ip ospf cost 2
!
interface FastEthernet0/1
ip address 23.1.1.3 255.255.255.0
ip ospf cost 2
查看路由表
区域内部路由选路规则第三条
3、如果AD值相同,比较area-id,越小越优
骨干区域与常规区域:
R6:
router ospf 110
network 20.1.1.0 0.0.0.255 area 126
!
R4:
router ospf 110
network 20.1.1.0 0.0.0.255 area 0
查看路由表
3、如果AD值相同,比较area-id,越小越优
常规区域与常规区域:
R1:
router ospf 110
network 100.100.100.100 0.0.0.0 area 15
!
R4:
router ospf 110
network 100.100.100.100 0.0.0.0 area 45
查看路由表