标签:nssa的命令区别
OSPF的LSA有11类,常用的也就是1(路由器本身)、3(网络汇总)、5类(AS外部路由);
7类LSA(是非完全末梢区域下才会产生7类LSA)
NSSA(not-so-stubby area)是由NSSA区域内的 ASBR 路由器始发的 LSA 通告它只在 NSSA 区域内泛洪;和5类LSA区别就是传播的范围(5类是在整个AS区域中泛洪,7类只能在NSSA区域中泛洪)
如下图的网络拓扑(不能插入图片真麻烦):
外部---R1---R2---R3---R4----R5---R6
R1/R2在Area 2
R2/R3在Area 0
R3/R4/R5 在Area 1 为NSSA区域
R5/R6模拟的外部网络。
NSSA区域的配置:
R3的配置信息:
router ospf 1
log-adjacency-changes
area 1 nssa
redistribute connected subnets
network 192.168.2.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 1
!
如果在其他非NSSA区域的边界路由器上存在外部路由的注入,如RIP的路由注入;
在R1上配置
router ospf 1
log-adjacency-changes
redistribute rip metric 1 subnets
network 1.1.1.0 0.0.0.255 area 2
network 192.168.1.0 0.0.0.255 area 2
!
router rip
version 2
redistribute ospf 1 metric 1
network 10.0.0.0
no auto-summary
!
查看路由信息:
R3的路由查看
R3#show ip route
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 not set
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/3] via 192.168.2.2, 01:43:05, FastEthernet0/1
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 192.168.2.2, 01:43:10, FastEthernet0/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback3
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/11] via 192.168.3.4, 01:43:05, Ethernet1/1
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/21] via 192.168.3.4, 01:43:05, Ethernet1/1
O 192.168.4.0/24 [110/20] via 192.168.3.4, 01:43:05, Ethernet1/1
O N2 192.168.5.0/24 [110/20] via 192.168.3.4, 01:42:58, Ethernet1/1
10.0.0.0/24 is subnetted, 1 subnets
O E2 10.1.1.0 [110/1] via 192.168.2.2, 01:43:06, FastEthernet0/1
O IA 192.168.1.0/24 [110/2] via 192.168.2.2, 01:43:06, FastEthernet0/1
C 192.168.2.0/24 is directly connected, FastEthernet0/1
C 192.168.3.0/24 is directly connected, Ethernet1/1
R4的路由信息:
R4#show ip route
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 not set
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/13] via 192.168.3.3, 01:43:40, Ethernet1/1
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/12] via 192.168.3.3, 01:43:40, Ethernet1/1
3.0.0.0/24 is subnetted, 1 subnets
O N2 3.3.3.0 [110/20] via 192.168.3.3, 01:43:40, Ethernet1/1
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback4
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/11] via 192.168.4.5, 01:43:40, Ethernet1/0
C 192.168.4.0/24 is directly connected, Ethernet1/0
O N2 192.168.5.0/24 [110/20] via 192.168.4.5, 01:43:40, Ethernet1/0
O IA 192.168.1.0/24 [110/12] via 192.168.3.3, 01:43:40, Ethernet1/1
O IA 192.168.2.0/24 [110/11] via 192.168.3.3, 01:43:41, Ethernet1/1
C 192.168.3.0/24 is directly connected, Ethernet1/1
配置完NSSA属性之后,就会产生相应的域间路由信息;如果再引入外部路由的情况下,需要在nssa区域的ABR上注入默认的路由保证,NSSA区域的能够正常访问外部网络。否则就会出现网络无法访问的情况;
命令如下:
area 1 nssa default-information-originate
在R4上的路由信息:
R4#show ip route
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 192.168.3.3 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/13] via 192.168.3.3, 01:55:07, Ethernet1/1
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/12] via 192.168.3.3, 01:55:07, Ethernet1/1
3.0.0.0/24 is subnetted, 1 subnets
O N2 3.3.3.0 [110/20] via 192.168.3.3, 01:55:07, Ethernet1/1
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback4
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/11] via 192.168.4.5, 01:55:07, Ethernet1/0
C 192.168.4.0/24 is directly connected, Ethernet1/0
O N2 192.168.5.0/24 [110/20] via 192.168.4.5, 01:55:07, Ethernet1/0
O IA 192.168.1.0/24 [110/12] via 192.168.3.3, 01:55:07, Ethernet1/1
O IA 192.168.2.0/24 [110/11] via 192.168.3.3, 01:55:07, Ethernet1/1
C 192.168.3.0/24 is directly connected, Ethernet1/1
O*N2 0.0.0.0/0 [110/1] via 192.168.3.3, 00:00:36, Ethernet1/1
NSSA区域的路由起上就会产生一条7类的默认路由,在整个NSSA区域泛洪;同时又有一些域间的路由和默认路由,这样为了减少路由的条目数就对路由进行简化,因此产生完全末梢区域对路由进行精简
命令:area 1 nssa no-summary
完全末梢区域会自动产生一条3类LSA的默认路由并在整个NSSA区域中泛洪:
R4#show ip route
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 192.168.3.3 to network 0.0.0.0
3.0.0.0/24 is subnetted, 1 subnets
O N2 3.3.3.0 [110/20] via 192.168.3.3, 00:00:17, Ethernet1/1
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback4
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/11] via 192.168.4.5, 00:00:17, Ethernet1/0
C 192.168.4.0/24 is directly connected, Ethernet1/0
O N2 192.168.5.0/24 [110/20] via 192.168.4.5, 00:00:17, Ethernet1/0
C 192.168.3.0/24 is directly connected, Ethernet1/1
O*IA 0.0.0.0/0 [110/11] via 192.168.3.3, 00:00:17, Ethernet1/1
查看数据库信息:
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 3.3.3.3 137 0x80000001 0x00DE4B
注意:配置完全末梢区域的时候,只需要在NSSA的ABR上配置就可以,其他的NSSA路由器上正常配置就可以。
如果在NSSA区域和骨干区域的路由上引入外部路由如在R3上引入外部路由,
在R4上查看的路由信息:
R4#show ip route
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 192.168.3.3 to network 0.0.0.0
3.0.0.0/24 is subnetted, 1 subnets
O N2 3.3.3.0 [110/20] via 192.168.3.3, 00:00:17, Ethernet1/1
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback4
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/11] via 192.168.4.5, 00:00:17, Ethernet1/0
C 192.168.4.0/24 is directly connected, Ethernet1/0
O N2 192.168.5.0/24 [110/20] via 192.168.4.5, 00:00:17, Ethernet1/0
C 192.168.3.0/24 is directly connected, Ethernet1/1
O*IA 0.0.0.0/0 [110/11] via 192.168.3.3, 00:00:17, Ethernet1/1
如果设备存在大量的引入的路由信息,这样也会对设备的CPU消耗比较大,为简化路由引入另外一条命令:area 1 nssa no-summary no-redistribution
R4#show ip route
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 192.168.3.3 to network 0.0.0.0
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback4
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/11] via 192.168.4.5, 00:00:03, Ethernet1/0
C 192.168.4.0/24 is directly connected, Ethernet1/0
O N2 192.168.5.0/24 [110/20] via 192.168.4.5, 00:00:03, Ethernet1/0
C 192.168.3.0/24 is directly connected, Ethernet1/1
O*IA 0.0.0.0/0 [110/11] via 192.168.3.3, 00:00:03, Ethernet1/1
一般情况下,配置NSSA区域的时候,在ABR上配置no-summary 和no-redistribution结合使用。但不要搞混淆了,只在NSSA区域的ABR路由上配置,其他的NSSA路由器上只配置为NSSA区域就行。
NSSA区域 default-information-originate/no-redistribution/ no-summary区别
标签:nssa的命令区别
原文地址:http://205091.blog.51cto.com/195091/1881910