學(xué)習OSPF的過(guò)程中我們遇到過(guò)比較難的知識點(diǎn)如OSPF的幾種LSA的類(lèi)型和OSPF特殊區域。其中LSA的類(lèi)型的判別是OSPF特殊區域的基礎,今天技術(shù)帖我們就給大家介紹OSPF的特殊區域中的LSA。
首先OSPF的特殊區域劃分的目的主要是在OSPF劃分區域的基礎上,進(jìn)一步減少LSA的交互量,換而言之就是讓LSA的數量更少。其中特殊區域中最主要的是stub區域、totally stub區域和NSSA區域。
Stub區域的特點(diǎn):不允許有4類(lèi)和5類(lèi)LSA,取而代之的是一條攜帶0.0.0.0的3類(lèi)LSA。
Totally stub區域的特點(diǎn):不允許有4類(lèi)和5類(lèi)LSA,區域之間交互的明細的3類(lèi)LSA也不存在,取而代之的是一條攜帶0.0.0.0 的3類(lèi)LSA。
NSSA區域的特點(diǎn):不允許有4類(lèi)和5類(lèi)LSA,取而代之的是7類(lèi)的明細LSA。
配置和顯示信息如下:
//RTA配置
RTA(config)#interface ethernet 0/0
RTA(config-if)# ip address 192.168.1.1 255.255.255.0
RTA(config-if)#exit
RTA(config)#interface Loopback0
RTA(config-if)# ip address 100.1.1.1 255.255.255.0
RTA(config)#router ospf 110
RTA(config-router)# router-id 1.1.1.1
RTA(config-router)# redistribute connected subnets
RTA(config-router)# network 192.168.1.0 0.0.0.255 area 0
//RTB配置
RTB(config)#interface Ethernet0/0
RTB(config-if)# ip address 192.168.1.2 255.255.255.0
RTB(config-if)#exit
RTB(config)#interface Ethernet0/1
RTB(config-if)# ip address 192.168.2.1 255.255.255.0
RTB(config-if)#exit
RTB(config)#router ospf 110
RTB(config-router)# router-id 2.2.2.2
RTB(config-router)# network 192.168.1.0 0.0.0.255 area 0
RTB(config-router)# network 192.168.2.0 0.0.0.255 area 1
//RTC配置
RTC(config)#interface Ethernet0/1
RTC(config-if)# ip address 192.168.2.2 255.255.255.0
RTC(config-if)#exit
RTC(config)#router ospf 110
RTC(config-router)# router-id 3.3.3.3
RTC(config-router)# network 192.168.2.0 0.0.0.255 area 1
RTC#show ip ospf database
OSPF Router with ID (3.3.3.3) (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 44 0x8000002C 0x00AB68 1
3.3.3.3 3.3.3.3 10 0x80000029 0x00709E 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.2 3.3.3.3 45 0x8000001A 0x000291
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.1.0 2.2.2.2 50 0x80000009 0x00E4D3
Summary ASB Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 50 0x80000001 0x0075B0
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
100.1.1.0 1.1.1.1 1347 0x80000012 0x0077AD 0
配置和顯示信息如下:
RTB(config-router)#area 1 stub //將OSPF的區域1配置成STUB區域
RTC(config-router)#area 1 stub
RTC#show ip ospf database
OSPF Router with ID (3.3.3.3) (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 4 0x8000002E 0x00C54E 1
3.3.3.3 3.3.3.3 4 0x8000002B 0x008A84 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.2 3.3.3.3 4 0x8000001C 0x001C77
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 9 0x80000001 0x0075C0
192.168.1.0 2.2.2.2 9 0x8000000A 0x0001B8
從上述現象發(fā)現,STUB區域中R2過(guò)濾了4/5類(lèi)LSA,并自動(dòng)下發(fā)3類(lèi)0.0.0.0/0LSA。
RTC#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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is 192.168.2.1 to network 0.0.0.0
O*IA 0.0.0.0/0 [110/11] via 192.168.2.1, 00:01:49, Ethernet0/1
100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 100.3.3.0/24 is directly connected, Loopback0
L 100.3.3.3/32 is directly connected, Loopback0
O IA 192.168.1.0/24 [110/20] via 192.168.2.1, 00:01:49, Ethernet0/1
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, Ethernet0/1
L 192.168.2.2/32 is directly connected, Ethernet0/1
RTC#ping 100.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
從上述現象發(fā)現,STUB區域內設備能訪(fǎng)問(wèn)外部網(wǎng)段。
配置和顯示信息如下:
RTB(config-router)#area 1 stub no-summary//將OSPF的區域1配置成完全STUB區域
RTC#show ip ospf database
OSPF Router with ID (3.3.3.3) (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 378 0x8000002E 0x00C54E 1
3.3.3.3 3.3.3.3 379 0x8000002B 0x008A84 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.2 3.3.3.3 379 0x8000001C 0x001C77
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 15 0x80000003 0x0071C2
從上述現象發(fā)現,完全STUB區域中R2過(guò)濾了3/4/5類(lèi)LSA,并自動(dòng)下發(fā)3類(lèi)0.0.0.0/0LSA。
RTC#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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is 192.168.2.1 to network 0.0.0.0
O*IA 0.0.0.0/0 [110/11] via 192.168.2.1, 00:01:44, Ethernet0/1
100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 100.3.3.0/24 is directly connected, Loopback0
L 100.3.3.3/32 is directly connected, Loopback0
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, Ethernet0/1
L 192.168.2.2/32 is directly connected, Ethernet0/1
RTC#ping 100.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
從上述現象發(fā)現,完全STUB區域內設備能訪(fǎng)問(wèn)外部網(wǎng)段。
配置和顯示信息如下:
RTB(config-router)#no area 1 stub
RTB(config-router)#area 1 nssa //將area1配置成NSSA區域
RTC(config-router)#no area 1 stub
RTC(config-router)#area 1 nssa
RTC#show ip ospf database
OSPF Router with ID (3.3.3.3) (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 61 0x80000031 0x004DB9 1
3.3.3.3 3.3.3.3 60 0x8000002D 0x000EF6 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.2 3.3.3.3 60 0x8000001E 0x009FE9
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.1.0 2.2.2.2 86 0x80000002 0x009821
從上述現象發(fā)現,NSSA區域中R2過(guò)濾了4/5類(lèi)LSA,但未自動(dòng)下發(fā)0.0.0.0/0LSA。
RTB(config-router)#area 1 nssa default-information-originate //手工下發(fā)默認路由
RTC#show ip ospf database
OSPF Router with ID (3.3.3.3) (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 208 0x80000031 0x004DB9 1
3.3.3.3 3.3.3.3 207 0x8000002D 0x000EF6 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.2 3.3.3.3 207 0x8000001E 0x009FE9
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.1.0 2.2.2.2 234 0x80000002 0x009821
Type-7 AS External Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 2.2.2.2 43 0x80000001 0x00D0D8 0
從上述現象發(fā)現,NSSA區域中R2手工下發(fā)7類(lèi)0.0.0.0/0LSA
RTC#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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is 192.168.2.1 to network 0.0.0.0
O*N2 0.0.0.0/0 [110/1] via 192.168.2.1, 00:01:45, Ethernet0/1
100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 100.3.3.0/24 is directly connected, Loopback0
L 100.3.3.3/32 is directly connected, Loopback0
O IA 192.168.1.0/24 [110/20] via 192.168.2.1, 00:04:28, Ethernet0/1
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, Ethernet0/1
L 192.168.2.2/32 is directly connected, Ethernet0/1
RTC#ping 100.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
從上述現象發(fā)現,NSSA區域內設備能訪(fǎng)問(wèn)外部網(wǎng)段。
配置和顯示信息如下:
RTB(config-router)#area 1 nssa no-summary //配置成完全NSSA區域
RTC#show ip ospf database
OSPF Router with ID (3.3.3.3) (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 159 0x80000034 0x0047BC 1
3.3.3.3 3.3.3.3 561 0x8000002D 0x000EF6 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.2 3.3.3.3 561 0x8000001E 0x009FE9
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 66 0x80000001 0x00FC31
從上述現象發(fā)現,完全NSSA區域中R2過(guò)濾了3/4/5類(lèi)LSA,并自動(dòng)下發(fā)3類(lèi)0.0.0.0/0LSA。
RTC#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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is 192.168.2.1 to network 0.0.0.0
O*IA 0.0.0.0/0 [110/11] via 192.168.2.1, 00:02:30, Ethernet0/1
100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 100.3.3.0/24 is directly connected, Loopback0
L 100.3.3.3/32 is directly connected, Loopback0
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, Ethernet0/1
L 192.168.2.2/32 is directly connected, Ethernet0/1
RTC#ping 100.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
從上述現象發(fā)現,完全NSSA區域內設備能訪(fǎng)問(wèn)外部網(wǎng)段。