2、完全NSSA,与完全stub一样的,也是在NSSA的基础上多过滤了LSA3而已,并且可以自动产生默认路由。
R1(config)#router ospf 1
R1(config-router)#area 12 nssa no-summary R1在area12配置为完全NSSA
R1(config-router)#end
R2(config)#router ospf 1
R2(config-router)#area 12 nssa no-summary R2在area12配置为完全NSSA
R2(config-router)#end
R1#show ip route 查看配置成完全NSSA的R1上面的路由,LSA3、4、5都被过滤掉了,只有默认路由
Codes: 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
Gateway of last resort is 12.1.1.2 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
11.0.0.0/32 is subnetted, 1 subnets
C 11.11.11.11 is directly connected, Loopback1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial3/0
O*IA 0.0.0.0/0 [110/65] via 12.1.1.2, 00:02:01, Serial3/0
R1#show ip ospf database 在R1的LSDB中只有LSA1、2、7,LSA3、4、5全被过滤了
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 12) LSA1没有2是因为p2p没有DR
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 819 0x80000017 0x00EA59 3
2.2.2.2 2.2.2.2 1353 0x80000015 0x001E37 2
Summary Net Link States (Area 12) LSA3没有了,变成一条默认路由了
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 411 0x80000001 0x00FC31
Type-7 AS External Link States (Area 12) LSA7外部路由的link信息
Link ID ADV Router Age Seq# Checksum Tag
11.11.11.11 1.1.1.1 1316 0x80000002 0x00E5FB 0
R1#show ip ospf database summary R1上查看LSA3信息发现只有一条默认路由了
OSPF Router with ID (1.1.1.1) (Process ID 1)
Summary Net Link States (Area 12)
Routing Bit Set on this LSA
LS age: 383
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 0.0.0.0 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xFC31
Length: 28
Network Mask: /0
TOS: 0 Metric: 1
R2#show ip ospf database 在完全NSSA区域中的R2上看到在area12区域中只收到了LSA1、2、7
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 1383 0x80000015 0x0016C1 1
3.3.3.3 3.3.3.3 1232 0x80000014 0x00D3FD 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
23.1.1.1 2.2.2.2 1892 0x80000006 0x00E618
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 1383 0x80000002 0x00A945
4.4.4.4 3.3.3.3 1232 0x80000003 0x00FEDE
12.1.1.0 2.2.2.2 1629 0x80000012 0x00F9DB
34.1.1.0 3.3.3.3 1232 0x80000003 0x00DAEF
Router Link States (Area 12)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 851 0x80000017 0x00EA59 3
2.2.2.2 2.2.2.2 1384 0x80000015 0x001E37 2
Summary Net Link States (Area 12)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 442 0x80000001 0x00FC31
Type-7 AS External Link States (Area 12)
Link ID ADV Router Age Seq# Checksum Tag
11.11.11.11 1.1.1.1 1349 0x80000002 0x00E5FB 0
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
11.11.11.11 2.2.2.2 1384 0x80000002 0x005C8B 0
R2#show ip ospf database summary area12区域中完全NSSA的R2的LSDB中也只有LSA1、2、7
OSPF Router with ID (2.2.2.2) (Process ID 1)
Summary Net Link States (Area 0) 在area0中的LSA3的信息(area0中的R2不是完全NSSA)
LS age: 1408
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: 0xA945
Length: 28
Network Mask: /32
TOS: 0 Metric: 65
Routing Bit Set on this LSA
LS age: 1257
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 4.4.4.4 (summary Network Number)
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0xFEDE
Length: 28
Network Mask: /32
TOS: 0 Metric: 65
LS age: 1655
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 12.1.1.0 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000012
Checksum: 0xF9DB
Length: 28
Network Mask: /24
TOS: 0 Metric: 64
Routing Bit Set on this LSA
LS age: 1258
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 34.1.1.0 (summary Network Number)
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0xDAEF
Length: 28
Network Mask: /24
TOS: 0 Metric: 64
Summary Net Link States (Area 12) 在area12中LSA3的信息
LS age: 466
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 0.0.0.0 (summary Network Number) 完全NSSA(过滤掉LSA3)产生的默认路由
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xFC31
Length: 28
Network Mask: /0
TOS: 0 Metric: 1
三、NSSA区域LSA7与LSA5转换
1、在非NSSA的区域中,NSSA区域中产生的LSA7外部路由信息,如果要传递到非NSSA区域中的话,会被NSSA区域的ABR(在传出去的时候)转换为LSA5的外部link路由(其他区域看到的就是LSA5的外部路由link)
原因是NSSA区域是不允许LSA4、5的,只允许LSA7类代替LSA4、5来宣告外部路由。但是其他非NSSA区域是允许有LSA4、5的,所以非NSSA区域的ABR会把从NSSA区域收到的LSA7转换成LSA5 宣告到区域中。
R1#show ip ospf database 在NSSA中的R1的LSDB中可看到LSA7的外部路由信息
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 12)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 819 0x80000017 0x00EA59 3
2.2.2.2 2.2.2.2 1353 0x80000015 0x001E37 2
Summary Net Link States (Area 12)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 411 0x80000001 0x00FC31
Type-7 AS External Link States (Area 12)
Link ID ADV Router Age Seq# Checksum Tag
11.11.11.11 1.1.1.1 1316 0x80000002 0x00E5FB 0
R1#show ip ospf database nssa-external 在R1上查看LSA7的内容,在area12中
OSPF Router with ID (1.1.1.1) (Process ID 1)
Type-7 AS External Link States (Area 12)
LS age: 1347
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 11.11.11.11 (External Network Number )
Advertising Router: 1.1.1.1
LS Seq Number: 8000001C
Checksum: 0xB116
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 20
Forward Address: 1.1.1.1
External Route Tag: 0
R3#show ip os database 在非NSSA区域的R3(area34的ABR)上查看由LSA7转换后的LSA5
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 233 0x80000030 0x00DFDC 1
3.3.3.3 3.3.3.3 205 0x8000002F 0x009D19 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
23.1.1.1 2.2.2.2 1008 0x80000021 0x00B033
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 233 0x8000001D 0x007360
4.4.4.4 3.3.3.3 205 0x8000001E 0x00C8F9
12.1.1.0 2.2.2.2 496 0x8000002D 0x00C3F6
34.1.1.0 3.3.3.3 205 0x8000001E 0x00A40B
Router Link States (Area 34)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 205 0x80000026 0x000369 1
4.4.4.4 4.4.4.4 935 0x80000025 0x0058EB 2
Net Link States (Area 34)
Link ID ADV Router Age Seq# Checksum
34.1.1.2 4.4.4.4 935 0x8000001E 0x004389
Summary Net Link States (Area 34)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 3.3.3.3 207 0x80000023 0x0013FC
1.1.1.1 3.3.3.3 450 0x8000001D 0x007D53
12.1.1.0 3.3.3.3 207 0x8000001E 0x00EBDA
23.1.1.0 3.3.3.3 207 0x8000001E 0x00D922
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
11.11.11.11 2.2.2.2 235 0x8000001D 0x0026A6 0
R3#show ip ospf database external R3上查看LSA5的信息与R1中的LSA7内容一致,继承了LSA7
OSPF Router with ID (3.3.3.3) (Process ID 1)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 1484
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 11.11.11.11 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 8000001C
Checksum: 0x28A5
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 20
Forward Address: 1.1.1.1
External Route Tag: 0
通过LSA7转换的LSA5的默认会继承LSA7的所有内容,包括蓝色标记的FD(Forward Address)信息也继承了(都是1.1.1.1),是否继承是取决于LSA7中的一个bit位的信息,这个bit位就是Options: (No TOS-capability,Type 7/5 translation, DC)中的“Type 7/5 translation”这个1bit:用于让NSSA区域的ABR判断是否要让转换后的(发给其他区域的)LSA5继承LSA7中的FD地址(影响到外部路由的Metric的值)
当FD为0.0.0.0时,NSSA区域的R-other到达NSSA区域的ASBR宣告的外部路由的metric是R-other到达ASBR的距离,而非NSSA的R-other到达NSSA区域ASBR宣告的外部路由的metric是该区域的ABR的距离(因为这个LSA5是由该区域的ABR转换的,所以,一句话当FD为0的时候,那么R-other到达LSA5外部路由的距离就是到达设置FD的设备的距离:ASBR发的就是到ASBR的距离,ABR转换发的就是到ABR的距离)
当FD不为0.0.0.0时(可能是ASBR上的某个接口的ip地址,具体看IOS版本和接口是否加入到了ospf中,与R-ID无关),非NSSA区域的R中到达NSSA区域的ASBR宣告的外部路由的metric是R到达ASBR连接了这条外部路由的出接口的距离
可以手工在NSSA区域的ABR(R2)上配置,转让转换后的LSA5不继承LSA7的FD地址。在NSSA区域的ABR做配置:
R2(config)#router ospf 1
R2(config-router)#area 12 nssa translate type7 suppress-fa 让NSSA的ABR开启抑制LSA7的FD继承功能R2(config-router)#end
完成后查看NSSA中ABR的LSA7和非NSSA中LSA5的信息中FD是否没有继承
R2#show ip ospf database nssa-external NSSA区域中R2的LSA7
OSPF Router with ID (2.2.2.2) (Process ID 1)
Type-7 AS External Link States (Area 12) LSA7是area12的
Routing Bit Set on this LSA
LS age: 422
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 11.11.11.11 (External Network Number )
Advertising Router: 1.1.1.1
LS Seq Number: 8000001F
Checksum: 0xAB19
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 20
Forward Address: 1.1.1.1 LSA7信息中FD:1.1.1.1
External Route Tag: 0
R3#show ip os database external 非NSSA区域中的R收到的LSA5(LSA7转换的)
OSPF Router with ID (3.3.3.3) (Process ID 1)
Type-5 AS External Link States LSA5是不分area的
Routing Bit Set on this LSA
LS age: 254
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 11.11.11.11 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 8000001F
Checksum: 0xEFDE
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0 LSA5信息中FD:0.0.0.0没有继承LSA7中的FD值
External Route Tag: 0
重点强调一下:在IOS12.4和15.2中对于从LSA7转换来的LSA5路由(ON的路由)的metric是不一样的,12.4版本中会在原有的metric基础上+1,而15.2版本不变,保持原有的metric(metirc:到达目的路由途径线路的cost之和)