您的位置:首页 > 其它

OSPF的多区域配置、优化方法,以及各类LSA(四)

2010-12-27 22:59 621 查看


再次查看R2的路由表:

Gateway of last resort is not set

O E1 192.168.89.0/24 [110/213] via 192.168.12.1, 00:07:23, Serial0/0
O IA 192.168.46.0/24 [110/65] via 192.168.1.4, 00:20:14, FastEthernet1/0
C 192.168.12.0/24 is directly connected, Serial0/0
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 192.168.12.1, 00:20:14, Serial0/0
O E1 192.168.47.0/24 [110/21] via 192.168.1.4, 00:07:23, FastEthernet1/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.1.3, 00:20:14, FastEthernet1/0
O IA 192.168.15.0/24 [110/128] via 192.168.12.1, 00:20:14, Serial0/0
O E1 192.168.8.0/24 [110/213] via 192.168.12.1, 00:07:24, Serial0/0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/2] via 192.168.1.4, 00:20:14, FastEthernet1/0
O IA 192.168.58.0/24 [110/192] via 192.168.12.1, 00:19:50, Serial0/0
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/129] via 192.168.12.1, 00:19:50, Serial0/0
6.0.0.0/32 is subnetted, 1 subnets
O IA 6.6.6.6 [110/66] via 192.168.1.4, 00:07:29, FastEthernet1/0
172.5.0.0/22 is subnetted, 1 subnets
O IA 172.5.0.0 [110/129] via 192.168.12.1, 00:19:50, Serial0/0 //区域间路由汇总结果
172.16.0.0/22 is subnetted, 1 subnets
O E1 172.16.0.0 [110/213] via 192.168.12.1, 00:07:24, Serial0/0 //外部路由汇总的结果
7.0.0.0/24 is subnetted, 1 subnets
O E1 7.7.7.0 [110/21] via 192.168.1.4, 00:07:24, FastEthernet1/0
8.0.0.0/32 is subnetted, 1 subnets
O IA 8.8.8.8 [110/193] via 192.168.12.1, 00:19:30, Serial0/0
9.0.0.0/24 is subnetted, 1 subnets
O E1 9.9.9.0 [110/213] via 192.168.12.1, 00:07:24, Serial0/0
C 192.168.1.0/24 is directly connected, FastEthernet1/0

查看R6路由表,如下:
Gateway of last resort is 192.168.46.4 to network 0.0.0.0

C 192.168.46.0/24 is directly connected, Serial0/0
6.0.0.0/24 is subnetted, 1 subnets
C 6.6.6.0 is directly connected, Loopback0
O*IA 0.0.0.0/0 [110/65] via 192.168.46.4, 00:09:31, Serial0/0

仅剩三条路由条目,大大减少R6的负担,节省资源

1、1类LSA:每台路由器都生成针对其所属区域的LSA,而非对其所有链路,查看R1发给R2的1类LSA

实现区域间的路由过滤,方法是过滤3类LSA。
在R6上启用一个环回口,地址为192.168.6.1/24,使用ip ospf network point-to-point,将环回口地址做为网段宣告。该路由将会被整个网络中所有路由器学习到,除末节区域以外。若仅想让area1中的路由器学习到,则可在R4上做针对该网段的LSA过滤,配置如下:
ip prefix-list 10 seq 1 deny 192.168.6.0/24
ip prefix-list 10 seq 2 permit 0.0.0.0/0 le 32

router ospf 10
area 1 filter-list prefix 10 out

假设ospf area1区域未配置成末节区域,此时R4即是ABR又是ASBR,分析此时4类和5类LSA的产生和传递。
查看R6的LSDB表,下面仅选取部分:
Summary ASB Link States (Area 1)

Link ID ADV Router Age Seq# Checksum
1.1.1.1 4.4.4.4 210 0x80000001 0x006185

Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
7.7.7.0 4.4.4.4 1159 0x80000006 0x00E412 0

发现R6收到的4类LSA仅仅是R4生成的针对R1所连接的area2区域内的ASBR链路,查看详细LSA如下:
R6#sh ip ospf da asbr-summary 1.1.1.1

OSPF Router with ID (6.6.6.6) (Process ID 10)

Summary ASB Link States (Area 1)

Routing Bit Set on this LSA
LS age: 559
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(AS Boundary Router)
Link State ID: 1.1.1.1 (AS Boundary Router address)
Advertising Router: 4.4.4.4
LS Seq Number: 80000001
Checksum: 0x6185
Length: 28
Network Mask: /0
TOS: 0 Metric: 65
查看R4的LSDB表,仅选取4类LSA,如下:
Summary ASB Link States (Area 1)

Link ID ADV Router Age Seq# Checksum
1.1.1.1 4.4.4.4 955 0x80000001 0x006185
Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
7.7.7.0 4.4.4.4 418 0x80000007 0x00E213 0
9.9.9.0 1.1.1.1 164 0x80000001 0x00924F 0

由上可知,R4仅针对area1生成了关于area2的4类LSA。首先先了解下4类LSA的相关知识。
4类LSA是由ABR生成,其作用是告诉其他路由器,如何到达ASBR的。并且最初生成4类LSA的ABR是和所宣告的ASBR是属于同一区域的。定义4类LSA的原因是因为ASBR使用5类LSA将外部路由宣告进OSPF域内,但其宣告路由器永远是ASBR。如果经过了NSSA区域,则宣告路由器将是实现7类LSA向5类LSA转换的ABR路由器ID。则既然R4即为OSPF与RIP的ASBR,则与其连接的区域将知道如何到达ASBR,则R4无需为area1生成4类LSA。只有当某区域和外部自治系统之间仍有区域时,该区域的路由器才需要4类LSA。例如图中的area0与EIGRP 10,则此时ABR路由器R1就需要生成一个4类LSA告知本区域内的路由器如何到达ASBR。

再查看5类LSA 9.9.9.0的详细信息,如下:
R4#sh ip ospf da external 9.9.9.0

OSPF Router with ID (4.4.4.4) (Process ID 10)

Type-5 AS External Link States

Routing Bit Set on this LSA
LS age: 910
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 9.9.9.0 (External Network Number )
Advertising Router: 1.1.1.1
LS Seq Number: 80000001
Checksum: 0x924F
Length: 36
Network Mask: /24
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 20
Forward Address: 8.8.8.8
External Route Tag: 0
发现有一个Forward Address: 8.8.8.8,说明虽然其宣告路由器ID是实现7类LSA向5类LSA转换的ABR路由器ID,但其依旧包含一个forward address,这个才是最原始的ASBR。如果想更改forward address,可使用如下命令:
area id nssa translate type7 suppress-fa。
再次查看结果如下:
R4#sh ip ospf da external 9.9.9.0

OSPF Router with ID (4.4.4.4) (Process ID 10)

Type-5 AS External Link States

Routing Bit Set on this LSA
LS age: 5
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 9.9.9.0 (External Network Number )
Advertising Router: 1.1.1.1
LS Seq Number: 80000002
Checksum: 0xFE02
Length: 36
Network Mask: /24
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
其forward address变为了0.0.0.0,即是转换7类到5类的ABR路由器。

本文出自 “孤剑” 博客,请务必保留此出处http://gujian139.blog.51cto.com/1166106/466103
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: