单个区域,会造成非常多的LSAs,路由表过大,占用过多带宽
分区域设计,减少路由更新流量
典型的组网图
Types of OSPF Routers
ABR
ASBR (OSPF RIP EIGRP )
LSA Type 1 :Router LSA
1、传播范围(本区域)
2、通知者,谁产生的(路由器)
3、包含的内容(拓扑信息,路由)
Links ID ADV Router
LSA1 RID RID
实验
R1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 110)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 30 0x80000003 0x0067F8 3
2.2.2.2 2.2.2.2 18 0x80000002 0x000751 3
R1#show ip route
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Loopback0
L 1.1.1.1/32 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 12.1.1.2, 00:08:41, Serial2/0
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, Serial2/0
L 12.1.1.1/32 is directly connected, Serial2/0
在同一区域中,数据库是一致的
R1#show ip ospf database router
OSPF Router with ID (1.1.1.1) (Process ID 110)
Router Link States (Area 0)
LS age: 634
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000003
Checksum: 0x67F8
Length: 60
Number of Links: 3
Link connected to: a Stub Network
(Link ID) Network/subnet number: 1.1.1.1
(Link Data) Network Mask: 255.255.255.255
Number of MTID metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 2.2.2.2
(Link Data) Router Interface address: 12.1.1.1
Number of MTID metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 12.1.1.0
(Link Data) Network Mask: 255.255.255.0
Number of MTID metrics: 0
TOS 0 Metrics: 64
LS age: 623
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 2.2.2.2
Advertising Router: 2.2.2.2
LS Seq Number: 80000002
Checksum: 0x751
Length: 60
Number of Links: 3
Link connected to: a Stub Network
(Link ID) Network/subnet number: 2.2.2.2
(Link Data) Network Mask: 255.255.255.255
Number of MTID metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 1.1.1.1
(Link Data) Router Interface address: 12.1.1.2
Number of MTID metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 12.1.1.0
(Link Data) Network Mask: 255.255.255.0
Number of MTID metrics: 0
TOS 0 Metrics: 64
LSA Type 2:Network LSA
MA
传播范围,本区域
通告者:DR
内容:拓扑信息和路由信息
One network [type 2] LSA for each transit broadcast or NBMA network in an area
--Includes list of attached routers on the transit link 拓扑信息
--Includes subnet mask of link 掩码路由
Advertised by the DR of the broadcast network
Floods within its area only:does not cross ABR
示例
拓扑图
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DR 00:00:30 100.1.1.2 Ethernet0/0
R1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 110)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 315 0x80000001 0x009DB4 1
2.2.2.2 2.2.2.2 316 0x80000002 0x005DEA 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
100.1.1.2 2.2.2.2 316 0x80000001 0x009528
Links ID ADV Router
LSA2 DR的IP地址 DR'sRID
R1#show ip ospf database network
OSPF Router with ID (1.1.1.1) (Process ID 110)
Net Link States (Area 0)
Routing Bit Set on this LSA in topology Base with MTID 0
LS age: 558
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 100.1.1.2 (address of Designated Router)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x9528
Length: 32
Network Mask: /24
Attached Router: 2.2.2.2
Attached Router: 1.1.1.1
LSA Type 3:Summary LSA
Links ID ADV Router
LSA3 路由 ABR 的RID
实验
拓扑图
从R4显示的数据库看到ADV为ABR的router-id 2.2.2.2
R4#show ip ospf database
OSPF Router with ID (4.4.4.4) (Process ID 110)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 1104 0x80000002 0x0017C6 1
4.4.4.4 4.4.4.4 1103 0x80000003 0x00DECB 2
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
24.1.1.4 4.4.4.4 1103 0x80000001 0x009B58
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 1103 0x80000002 0x008B99
2.2.2.2 2.2.2.2 27 0x80000001 0x00FA31
100.1.1.0 2.2.2.2 1103 0x80000002 0x007F44
三条路由信息
R4#show ip ospf database summary
OSPF Router with ID (4.4.4.4) (Process ID 110)
Summary Net Link States (Area 1)
Routing Bit Set on this LSA in topology Base with MTID 0
LS age: 1698
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 1.1.1.1 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000002
Checksum: 0x8B99
Length: 28
Network Mask: /32
MTID: 0 Metric: 11
Routing Bit Set on this LSA in topology Base with MTID 0
LS age: 621
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 2.2.2.2 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xFA31
Length: 28
Network Mask: /32
MTID: 0 Metric: 1
Routing Bit Set on this LSA in topology Base with MTID 0
LS age: 1717
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 100.1.1.0 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000002
Checksum: 0x7F44
Length: 28
Network Mask: /24
扩展
关注R4的4.4.4.4这条路由信息
R2数据库
R2#show ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 110)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 316 0x80000011 0x004EDD 2
2.2.2.2 2.2.2.2 1481 0x80000012 0x003CE1 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
100.1.1.2 2.2.2.2 1259 0x80000002 0x009329
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
4.4.4.4 2.2.2.2 739 0x80000002 0x000118
13.1.1.0 1.1.1.1 304 0x80000001 0x000F11
24.1.1.0 2.2.2.2 739 0x80000002 0x005FB0
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 739 0x80000003 0x0015C7 1
4.4.4.4 4.4.4.4 701 0x80000004 0x00DCCC 2
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
24.1.1.4 4.4.4.4 701 0x80000002 0x009959
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 740 0x80000003 0x00899A
2.2.2.2 2.2.2.2 1478 0x80000001 0x00FA31
13.1.1.0 2.2.2.2 305 0x80000001 0x0055BC
100.1.1.0 2.2.2.2 740 0x80000003 0x007D45
R1数据库
R1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 110)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 722 0x80000011 0x004EDD 2
2.2.2.2 2.2.2.2 1889 0x80000012 0x003CE1 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
100.1.1.2 2.2.2.2 1667 0x80000002 0x009329
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
4.4.4.4 2.2.2.2 1147 0x80000002 0x000118
13.1.1.0 1.1.1.1 710 0x80000001 0x000F11
24.1.1.0 2.2.2.2 1147 0x80000002 0x005FB0
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 722 0x80000008 0x0046EC 0
4.4.4.4 4.4.4.4 3653 0x80000004 0x005404 2
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 1.1.1.1 723 0x80000001 0x0047EC
2.2.2.2 1.1.1.1 723 0x80000001 0x007DA8
4.4.4.4 1.1.1.1 723 0x80000001 0x00858E
4.4.4.4 4.4.4.4 3654 0x80000001 0x0062B9
13.1.1.0 1.1.1.1 711 0x80000001 0x000F11
24.1.1.0 1.1.1.1 723 0x80000001 0x00E327
100.1.1.0 1.1.1.1 723 0x80000001 0x009F29
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 678 0x80000002 0x008479 1
13.1.1.3 13.1.1.3 679 0x80000002 0x00746C 1
Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
13.1.1.3 13.1.1.3 679 0x80000001 0x00E619
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 1.1.1.1 721 0x80000001 0x0047EC
2.2.2.2 1.1.1.1 721 0x80000001 0x007DA8
4.4.4.4 1.1.1.1 721 0x80000001 0x00858E
24.1.1.0 1.1.1.1 721 0x80000001 0x00E327
100.1.1.0 1.1.1.1 721 0x80000001 0x009F29
穿越一个ABR就会标识我这个ABR的路由ID
LSA Type 5: External LSA
Links ID ADV Router
LSA5 Route(E) ASBR'sRID
实验
将rip路由重分布到OSPF中
R3(config)#router ospf 110
R3(config-router)#redistribute rip subnets
R3为ASBR
R1#show ip ospf border-routers
OSPF Router with ID (1.1.1.1) (Process ID 110)
Base Topology (MTID 0)
Internal Router Routing Table
Codes: i - Intra-area route, I - Inter-area route
i 2.2.2.2 [10] via 100.1.1.2, Ethernet0/0, ABR, Area 0, SPF 30
i 13.1.1.3 [10] via 13.1.1.3, Ethernet0/1, ASBR, Area 2, SPF 4
在R4上查看路由表
R1#show ip route
E2 - OSPF external type 2
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Loopback0
L 1.1.1.1/32 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 100.1.1.2, 00:44:24, Ethernet0/0
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/21] via 100.1.1.2, 00:44:24, Ethernet0/0
5.0.0.0/24 is subnetted, 1 subnets
O E2 5.5.5.0 [110/20] via 13.1.1.3, 00:04:46, Ethernet0/1
13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 13.1.1.0/24 is directly connected, Ethernet0/1
L 13.1.1.1/32 is directly connected, Ethernet0/1
24.0.0.0/24 is subnetted, 1 subnets
O IA 24.1.1.0 [110/20] via 100.1.1.2, 00:44:25, Ethernet0/0
35.0.0.0/24 is subnetted, 1 subnets
O E2 35.1.1.0 [110/20] via 13.1.1.3, 00:04:47, Ethernet0/1
100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 100.1.1.0/24 is directly connected, Ethernet0/0
L 100.1.1.1/32 is directly connected, Ethernet0/0
R1数据库
R1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 110)
Router Link States (Area 0)【LSA1】
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 926 0x80000012 0x004CDE 2
2.2.2.2 2.2.2.2 40 0x80000014 0x0038E3 2
Net Link States (Area 0)【LSA2】
Link ID ADV Router Age Seq# Checksum
100.1.1.2 2.2.2.2 1839 0x80000003 0x00912A
Summary Net Link States (Area 0)【LSA3】
Link ID ADV Router Age Seq# Checksum
4.4.4.4 2.2.2.2 1322 0x80000003 0x00FE19
13.1.1.0 1.1.1.1 926 0x80000002 0x000D12
24.1.1.0 2.2.2.2 1322 0x80000003 0x005DB1
Summary ASB Link States (Area 0)【LSA4】
Link ID ADV Router Age Seq# Checksum
13.1.1.3 1.1.1.1 546 0x80000001 0x00E239
Router Link States (Area 1)【LSA1】
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 927 0x80000009 0x0044ED 0
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 1.1.1.1 927 0x80000002 0x0045ED
2.2.2.2 1.1.1.1 927 0x80000002 0x007BA9
4.4.4.4 1.1.1.1 927 0x80000002 0x00838F
13.1.1.0 1.1.1.1 927 0x80000002 0x000D12
24.1.1.0 1.1.1.1 927 0x80000002 0x00E128
100.1.1.0 1.1.1.1 927 0x80000002 0x009D2A
Summary ASB Link States (Area 1)【LSA4】
Link ID ADV Router Age Seq# Checksum
13.1.1.3 1.1.1.1 546 0x80000001 0x00E239
Router Link States (Area 2)【LSA1】
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 927 0x80000003 0x00827A 1
13.1.1.3 13.1.1.3 552 0x80000004 0x007666 1
Net Link States (Area 2)【LSA2】
Link ID ADV Router Age Seq# Checksum
13.1.1.3 13.1.1.3 1000 0x80000002 0x00E41A
Summary Net Link States (Area 2)【LSA3】
Link ID ADV Router Age Seq# Checksum
1.1.1.1 1.1.1.1 927 0x80000002 0x0045ED
2.2.2.2 1.1.1.1 927 0x80000002 0x007BA9
4.4.4.4 1.1.1.1 927 0x80000002 0x00838F
24.1.1.0 1.1.1.1 927 0x80000002 0x00E128
100.1.1.0 1.1.1.1 927 0x80000002 0x009D2A
Type-5 AS External Link States【LSA5】
Link ID ADV Router Age Seq# Checksum Tag
5.5.5.0 13.1.1.3 552 0x80000001 0x009CE2 0
35.1.1.0 13.1.1.3 552 0x80000001 0x0071F7 0
LSA Type 4 :Summary ASB LSA
从R1 的数据库中可以看到 只有area 2没有Summary ASB,area1和area0中都有。area2中通过LSA1就可以知道是ASBR ,LSA1只能在本区域内传播。
AS Boundary Router(ASBR)
LS age: 1608
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 13.1.1.3
Advertising Router: 13.1.1.3
LS Seq Number: 80000004
Checksum: 0x7666
Length: 36
## ASBR路由器
AS Boundary Router
Number of Links: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 13.1.1.3
(Link Data) Router Interface address: 13.1.1.3
Number of MTID metrics: 0
TOS 0 Metrics: 10
传播范围:整个区域,除了ASBR所在的区域
Links ID ADV Router
LSA4 ASBR 的RID ABR'sRID(穿越一个ABR就会标识ABR的RID)
1类 路由信息(域内)
2类
3类 路由信息
4类 找ASBR 的位置
5 类 路由信息
Seed Cost =20 (种子COST值)
改E1
R3(config-router)#redistribute rip subnets metric-type 1
R4#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, + - replicated route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/21] via 24.1.1.2, 03:56:04, Ethernet0/1
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/11] via 24.1.1.2, 03:56:04, Ethernet0/1
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 4.4.4.0/24 is directly connected, Loopback0
L 4.4.4.4/32 is directly connected, Loopback0
5.0.0.0/24 is subnetted, 1 subnets
O E1 5.5.5.0 [110/50] via 24.1.1.2, 00:01:09, Ethernet0/1
13.0.0.0/24 is subnetted, 1 subnets
O IA 13.1.1.0 [110/30] via 24.1.1.2, 03:56:04, Ethernet0/1
24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 24.1.1.0/24 is directly connected, Ethernet0/1
L 24.1.1.4/32 is directly connected, Ethernet0/1
35.0.0.0/24 is subnetted, 1 subnets
O E1 35.1.1.0 [110/50] via 24.1.1.2, 00:01:10, Ethernet0/1
100.0.0.0/24 is subnetted, 1 subnets
O IA 100.1.1.0 [110/20] via 24.1.1.2, 03:56:05, Ethernet0/1
选路修改seed 值
R3(config-router)#redistribute rip subnets metric-type 1 metric 10
R4#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, + - replicated route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/21] via 24.1.1.2, 04:00:02, Ethernet0/1
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/11] via 24.1.1.2, 04:00:02, Ethernet0/1
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 4.4.4.0/24 is directly connected, Loopback0
L 4.4.4.4/32 is directly connected, Loopback0
5.0.0.0/24 is subnetted, 1 subnets
O E1 5.5.5.0 [110/40] via 24.1.1.2, 00:00:04, Ethernet0/1
13.0.0.0/24 is subnetted, 1 subnets
O IA 13.1.1.0 [110/30] via 24.1.1.2, 04:00:02, Ethernet0/1
24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 24.1.1.0/24 is directly connected, Ethernet0/1
L 24.1.1.4/32 is directly connected, Ethernet0/1
35.0.0.0/24 is subnetted, 1 subnets
O E1 35.1.1.0 [110/40] via 24.1.1.2, 00:00:06, Ethernet0/1
100.0.0.0/24 is subnetted, 1 subnets
O IA 100.1.1.0 [110/20] via 24.1.1.2, 04:00:04, Ethernet0/1
--------------------------------------------------------------------------------------------------------------------
OSPF LSDB Overload Protection
实验
IOU2(config-router)#max-lsa 4 ignore-time 1
IOU2(config-router)#
*Apr 9 13:05:34.103: %OSPF-4-OSPF_MAX_LSA_THR: Threshold for maximum number of non self-generated LSA has been reached "ospf 110" - 3 LSAs
*Apr 9 13:05:34.103: %OSPF-4-OSPF_MAX_LSA: Maximum number of non self-generated LSA has been exceeded "ospf 110" - 5 LSAs
IOU2(config-router)#
*Apr 9 13:06:34.175: %OSPF-5-ADJCHG: Process 110, Nbr 1.1.1.1 on Serial2/0 from FULL to DOWN, Neighbor Down: Interface down or detached
Change the Cost Metric
___________________________________________________________________________________
OSPF Route Summarization
R2上做三条路由
202.96.16.1/24 0001 0000
202.96.17.1/24 0001 0001
202.96.18.1/24 0001 0010
202.96.19.1/24 0001 0011
/22
11111111 11111111 11111100 00000000
128 192 224 240 248 252
network 202.96.0.0 0.0.255.255 area0
area 0 ranage 202.96.16.0 255.255.252.0
R2 和R1 上都做路由汇总
汇总需要注意的4点
1,基于进程还是接口
2,Null,本地产生汇总路由
3,明细路由消失
4,汇总路由cost值是 明细路由中最小的
域外汇总
R5
198.8.8.5/24
198.8.9.5/24
00001000
00001001
R3
summary -address 198.8.8.0 255.255.255.254.0
tag 标记
_________________________________________________________________________________________________
Default Routes in OSPF
向OSPF区域发布默认路由,两种方法
1、a, default-information originate
去往Internet的路由器上 进程下配置
b,本地要有默认路由 0.0.0.0
需要两步完成,5类LSA ,cost 值为1
2、default-information originate always
通过其它路由协议访问Internet