实验名称:ospf多区域配置
实验原理:OSPF路由协议是一种典型分布式的链路状态路由协议,一般用于同一个自治系统AS内。在AS中,所有的OSPF路由器都维护一个相同的描述这个AS结构的数据库,该数据库中存放的是所有路由器的链路状态信息
OSPF能够适用于大规模网络结构,它可以将一个自治系统划分为若干个小区域
骨干区域:它是连接所有其它区域的核心域,相当于交换网络的汇聚层。即所有其它区域的通信量都必须要经过骨干区域。(area0)
普通区域:除骨干区域外,所有为特殊设置的区域
末节区域:(stub)可以降低区域内LSDB的规模,降低区域内部路由选择表的大小,并较少区域内部路由器对存储器的需求
特点:区域内所有路由器都应该配置成端路由器。因为端区的路由器通过hello包中的标志位识别区域类型,如果路由器不能达成一致,则不能形成邻居。
2)其ABR阻止类型LAS4、LSA5。即端区内没有到达外部的路由,但有到达其他区域的路由。
完全末节区域:(totally)减少OSPF数据库和路由表的规模。
特点:1)每个路由器都要配置成完全端区;
2)只存在区域内部的路由,拒绝了类型LSA3、LSA4、LSA5;
3)自动生成缺省路由。(通过特殊的LSA3进去的)
NSSA 1)普通NSSA: (config-router)#area area-id nssa
特点:缺省路由不是自动生成的;拒绝了类型LSA4、LSA5。
2)完全NSSA: (config-router)#area area-id nssa no-summary
特点:自动生成缺省路由;拒绝了类型LSA3、LSA4、LSA5。
NSSA使用环境:当区域位于ASBR和ABR之间,且ASBR连接到非OSPF协议网络,ABR连接到OSPF网络骨干区域时就使用NSSA.。
实验目的:掌握ospf多区域配置 末节区域配置 完全末节区域配置 次末节区域配置(NSSA)
实验环境:
图1
实验步骤:1根据实验环境拓朴图(图1)配置ospf多区域 sh ip rou sh ip ospf data查看
2将步骤1稍做修改,配置末节区域 sh ip rou sh ip ospf data查看
3将步骤2稍做修改,配置完全末节区域 sh ip rou sh ip ospf data查看
4将步骤3稍做修改,配置次末节区域 sh ip rou sh ip ospf data查看
5配置ospf路由汇总
实验内容:
A ospf多区域配置
实验原理:OSPF路由协议是一种典型分布式的链路状态路由协议,一般用于同一个自治系统AS内。在AS中,所有的OSPF路由器都维护一个相同的描述这个AS结构的数据库,该数据库中存放的是所有路由器的链路状态信息
OSPF能够适用于大规模网络结构,它可以将一个自治系统划分为若干个小区域
骨干区域:它是连接所有其它区域的核心域,相当于交换网络的汇聚层。即所有其它区域的通信量都必须要经过骨干区域。(area0)
普通区域:除骨干区域外,所有为特殊设置的区域
末节区域:(stub)可以降低区域内LSDB的规模,降低区域内部路由选择表的大小,并较少区域内部路由器对存储器的需求
特点:区域内所有路由器都应该配置成端路由器。因为端区的路由器通过hello包中的标志位识别区域类型,如果路由器不能达成一致,则不能形成邻居。
2)其ABR阻止类型LAS4、LSA5。即端区内没有到达外部的路由,但有到达其他区域的路由。
完全末节区域:(totally)减少OSPF数据库和路由表的规模。
特点:1)每个路由器都要配置成完全端区;
2)只存在区域内部的路由,拒绝了类型LSA3、LSA4、LSA5;
3)自动生成缺省路由。(通过特殊的LSA3进去的)
NSSA 1)普通NSSA: (config-router)#area area-id nssa
特点:缺省路由不是自动生成的;拒绝了类型LSA4、LSA5。
2)完全NSSA: (config-router)#area area-id nssa no-summary
特点:自动生成缺省路由;拒绝了类型LSA3、LSA4、LSA5。
NSSA使用环境:当区域位于ASBR和ABR之间,且ASBR连接到非OSPF协议网络,ABR连接到OSPF网络骨干区域时就使用NSSA.。
实验目的:掌握ospf多区域配置 末节区域配置 完全末节区域配置 次末节区域配置(NSSA)
实验环境:
图1
实验步骤:1根据实验环境拓朴图(图1)配置ospf多区域 sh ip rou sh ip ospf data查看
2将步骤1稍做修改,配置末节区域 sh ip rou sh ip ospf data查看
3将步骤2稍做修改,配置完全末节区域 sh ip rou sh ip ospf data查看
4将步骤3稍做修改,配置次末节区域 sh ip rou sh ip ospf data查看
5配置ospf路由汇总
实验内容:
A ospf多区域配置
R1 #ospf发布自己的网络
r1(config)#router ospf 10
r1(config-router)#network 192.168.1.0 0.0.0.255 area 1
r1(config-router)#network 172.17.16.0 0.0.0.7 area 1
r1(config-router)#network 172.17.24.0 0.0.0.7 area 1
r1(config-router)#network 172.17.32.0 0.0.0.7 area 1
r1(config-router)#exit
R2 # ospf发布自己的网络 与r1相连接口在area1 与r3相连接口在area0
r2(config)#router ospf 10
r2(config-router)#network 192.168.1.0 0.0.0.255 area 1
r2(config-router)#network 192.168.2.0 0.0.0.255 area 0
r2(config-router)#exit
R3 # ospf发布自己的网络 与r2相连接口在area0 与r4相连接口在area2
r3(config)#router ospf 10
r3(config-router)#network 192.168.2.0 0.0.0.255 area 0
r3(config-router)#network 192.168.3.0 0.0.0.255 area 2
r3(config-router)#exit
R4 # ospf发布自己的网络 与r3相连接口在area0 rip-v2 loopback.并关闭自动汇总
r4(config)#router ospf 10
r4(config-router)#network 192.168.3.0 0.0.0.255 area 2
r4(config-router)#redistribute rip subnets #在ospf里重发布rip
% Only classful networks will be redistributed
r4(config-router)#exit
r4(config)#router rip
r4(config-router)#version 2
r4(config-router)#network 172.16.16.0
r4(config-router)#network 172.16.24.0
r4(config-router)#network 172.16.32.0
r4(config-router)#no auto-summary #并关闭自动汇总
实验结果:用sh ip rou sh ip ospf data查看
r1#sh ip rou
172.17.0.0/21 is subnetted, 3 subnets
C 172.17.32.0 is directly connected, Loopback2
C 172.17.24.0 is directly connected, Loopback1
C 172.17.16.0 is directly connected, Loopback0
172.16.0.0/21 is subnetted, 3 subnets
O E2 172.16.32.0 [110/20] via 192.168.1.2, 00:25:51, Serial1/1
O E2 172.16.24.0 [110/20] via 192.168.1.2, 00:25:51, Serial1/1
O E2 172.16.16.0 [110/20] via 192.168.1.2, 00:25:51, Serial1/1
C 192.168.1.0/24 is directly connected, Serial1/1
O IA 192.168.2.0/24 [110/128] via 192.168.1.2, 01:03:44, Serial1/1
O IA 192.168.3.0/24 [110/192] via 192.168.1.2, 01:01:23, Serial1/1
r1#sh ip ospf data
OSPF Router with ID (172.17.32.1) (Process ID 10)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
172.17.32.1 172.17.32.1 166 0x80000009 0x00B82C 5
192.168.2.1 192.168.2.1 2009 0x80000004 0x00A76A 2
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.0 192.168.2.1 2009 0x80000002 0x002202
192.168.3.0 192.168.2.1 2009 0x80000002 0x009949
Summary ASB Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
172.16.32.1 192.168.2.1 480 0x80000002 0x006D03
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.16.0 172.16.32.1 1680 0x80000001 0x0015E7 0
172.16.24.0 172.16.32.1 1682 0x80000001 0x00BC38 0
172.16.32.0 172.16.32.1 1682 0x80000001 0x006488 0
r2#sh ip rou
172.17.0.0/32 is subnetted, 3 subnets
O 172.17.32.1 [110/65] via 192.168.1.1, 00:58:55, Serial1/0
O 172.17.24.1 [110/65] via 192.168.1.1, 00:58:55, Serial1/0
O 172.17.16.1 [110/65] via 192.168.1.1, 00:58:55, Serial1/0
172.16.0.0/21 is subnetted, 3 subnets
O E2 172.16.32.0 [110/20] via 192.168.2.2, 00:21:02, Serial1/1
O E2 172.16.24.0 [110/20] via 192.168.2.2, 00:21:02, Serial1/1
O E2 172.16.16.0 [110/20] via 192.168.2.2, 00:21:02, Serial1/1
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/1
O IA 192.168.3.0/24 [110/128] via 192.168.2.2, 00:56:34, Serial1/1
r2#sh ip ospf database
OSPF Router with ID (192.168.2.1) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.2.1 192.168.2.1 1040 0x80000003 0x000182 2
192.168.3.1 192.168.3.1 928 0x80000004 0x00F18E 2
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.17.16.1 192.168.2.1 1040 0x80000002 0x00A718
172.17.24.1 192.168.2.1 1040 0x80000002 0x004F68
172.17.32.1 192.168.2.1 1040 0x80000002 0x00F6B8
192.168.1.0 192.168.2.1 1040 0x80000002 0x002DF7
192.168.3.0 192.168.3.1 928 0x80000002 0x001012
Summary ASB Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.32.1 192.168.3.1 1575 0x80000003 0x00E1CC
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
172.17.32.1 172.17.32.1 1225 0x80000008 0x00BA2B 5
192.168.2.1 192.168.2.1 1042 0x80000004 0x00A76A 2
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.0 192.168.2.1 1042 0x80000002 0x002202
192.168.3.0 192.168.2.1 1042 0x80000002 0x009949
Summary ASB Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
172.16.32.1 192.168.2.1 1577 0x80000001 0x006F02
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.16.0 172.16.32.1 714 0x80000001 0x0015E7 0
172.16.24.0 172.16.32.1 714 0x80000001 0x00BC38 0
172.16.32.0 172.16.32.1 714 0x80000001 0x006488 0
B将上述配置稍做修改,把area1配置成末节区域(stub)
r1(config-router)#area 1 stub
r2(config-router)#area 1 stub
r1#sh ip rou
Gateway of last resort is 192.168.1.2 to network 0.0.0.0
172.17.0.0/21 is subnetted, 3 subnets
C 172.17.32.0 is directly connected, Loopback2
C 172.17.24.0 is directly connected, Loopback1
C 172.17.16.0 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Serial1/1
O IA 192.168.2.0/24 [110/128] via 192.168.1.2, 00:00:38, Serial1/1
O IA 192.168.3.0/24 [110/192] via 192.168.1.2, 00:00:38, Serial1/1
O*IA 0.0.0.0/0 [110/65] via 192.168.1.2, 00:00:38, Serial1/1
r1#sh ip ospf da
OSPF Router with ID (172.17.32.1) (Process ID 10)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
172.17.32.1 172.17.32.1 261 0x8000000B 0x00D212 5
192.168.2.1 192.168.2.1 260 0x80000007 0x00BF51 2
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 192.168.2.1 265 0x80000001 0x009140
192.168.2.0 192.168.2.1 265 0x80000004 0x003CE7
192.168.3.0 192.168.2.1 265 0x80000004 0x00B32F
总结:配置成末节区域后sh ip ospf data 没有类型LAS4、LSA5 由于端区内没有到达外部的路由,所以学不到r4上rip 发布的网络
C将上述配置再做修改area1配置成完全末节区域
r1(config-router)#area 1 stub no-summary
r2(config-router)#area 1 stub no-summary
r1#sh ip rou
Gateway of last resort is 192.168.1.2 to network 0.0.0.0
172.17.0.0/21 is subnetted, 3 subnets
C 172.17.32.0 is directly connected, Loopback2
C 172.17.24.0 is directly connected, Loopback1
C 172.17.16.0 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Serial1/1
O*IA 0.0.0.0/0 [110/65] via 192.168.1.2, 00:04:16, Serial1/1
r1#sh ip ospf da
OSPF Router with ID (172.17.32.1) (Process ID 10)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
172.17.32.1 172.17.32.1 364 0x8000000F 0x00CA16 5
192.168.2.1 192.168.2.1 364 0x8000000B 0x00B755 2
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 192.168.2.1 371 0x80000001 0x009140
总结:由于完全末节区域拒绝了类型LSA3、LSA4、LSA5;自动生成缺省路由。(通过特殊的LSA3进去)所以配置完成后sh ip ospf data sh ip rou会出现如上结果。
D1将上述配置再做修改,把are2配置成NSSA区域
r3(config-router)#area 2 nssa default-information-originate
r4(config-router)#area 2 nssa
r1#sh ip rou
172.17.0.0/21 is subnetted, 3 subnets
C 172.17.32.0 is directly connected, Loopback2
C 172.17.24.0 is directly connected, Loopback1
C 172.17.16.0 is directly connected, Loopback0
172.16.0.0/21 is subnetted, 3 subnets
O E2 172.16.32.0 [110/20] via 192.168.1.2, 00:00:11, Serial1/1
O E2 172.16.24.0 [110/20] via 192.168.1.2, 00:00:11, Serial1/1
O E2 172.16.16.0 [110/20] via 192.168.1.2, 00:00:11, Serial1/1
C 192.168.1.0/24 is directly connected, Serial1/1
O IA 192.168.2.0/24 [110/128] via 192.168.1.2, 00:00:11, Serial1/1
O IA 192.168.3.0/24 [110/192] via 192.168.1.2, 00:00:11, Serial1/1
r3#sh ip rou
Gateway of last resort is not set
r1(config)#router ospf 10
r1(config-router)#network 192.168.1.0 0.0.0.255 area 1
r1(config-router)#network 172.17.16.0 0.0.0.7 area 1
r1(config-router)#network 172.17.24.0 0.0.0.7 area 1
r1(config-router)#network 172.17.32.0 0.0.0.7 area 1
r1(config-router)#exit
R2 # ospf发布自己的网络 与r1相连接口在area1 与r3相连接口在area0
r2(config)#router ospf 10
r2(config-router)#network 192.168.1.0 0.0.0.255 area 1
r2(config-router)#network 192.168.2.0 0.0.0.255 area 0
r2(config-router)#exit
R3 # ospf发布自己的网络 与r2相连接口在area0 与r4相连接口在area2
r3(config)#router ospf 10
r3(config-router)#network 192.168.2.0 0.0.0.255 area 0
r3(config-router)#network 192.168.3.0 0.0.0.255 area 2
r3(config-router)#exit
R4 # ospf发布自己的网络 与r3相连接口在area0 rip-v2 loopback.并关闭自动汇总
r4(config)#router ospf 10
r4(config-router)#network 192.168.3.0 0.0.0.255 area 2
r4(config-router)#redistribute rip subnets #在ospf里重发布rip
% Only classful networks will be redistributed
r4(config-router)#exit
r4(config)#router rip
r4(config-router)#version 2
r4(config-router)#network 172.16.16.0
r4(config-router)#network 172.16.24.0
r4(config-router)#network 172.16.32.0
r4(config-router)#no auto-summary #并关闭自动汇总
实验结果:用sh ip rou sh ip ospf data查看
r1#sh ip rou
172.17.0.0/21 is subnetted, 3 subnets
C 172.17.32.0 is directly connected, Loopback2
C 172.17.24.0 is directly connected, Loopback1
C 172.17.16.0 is directly connected, Loopback0
172.16.0.0/21 is subnetted, 3 subnets
O E2 172.16.32.0 [110/20] via 192.168.1.2, 00:25:51, Serial1/1
O E2 172.16.24.0 [110/20] via 192.168.1.2, 00:25:51, Serial1/1
O E2 172.16.16.0 [110/20] via 192.168.1.2, 00:25:51, Serial1/1
C 192.168.1.0/24 is directly connected, Serial1/1
O IA 192.168.2.0/24 [110/128] via 192.168.1.2, 01:03:44, Serial1/1
O IA 192.168.3.0/24 [110/192] via 192.168.1.2, 01:01:23, Serial1/1
r1#sh ip ospf data
OSPF Router with ID (172.17.32.1) (Process ID 10)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
172.17.32.1 172.17.32.1 166 0x80000009 0x00B82C 5
192.168.2.1 192.168.2.1 2009 0x80000004 0x00A76A 2
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.0 192.168.2.1 2009 0x80000002 0x002202
192.168.3.0 192.168.2.1 2009 0x80000002 0x009949
Summary ASB Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
172.16.32.1 192.168.2.1 480 0x80000002 0x006D03
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.16.0 172.16.32.1 1680 0x80000001 0x0015E7 0
172.16.24.0 172.16.32.1 1682 0x80000001 0x00BC38 0
172.16.32.0 172.16.32.1 1682 0x80000001 0x006488 0
r2#sh ip rou
172.17.0.0/32 is subnetted, 3 subnets
O 172.17.32.1 [110/65] via 192.168.1.1, 00:58:55, Serial1/0
O 172.17.24.1 [110/65] via 192.168.1.1, 00:58:55, Serial1/0
O 172.17.16.1 [110/65] via 192.168.1.1, 00:58:55, Serial1/0
172.16.0.0/21 is subnetted, 3 subnets
O E2 172.16.32.0 [110/20] via 192.168.2.2, 00:21:02, Serial1/1
O E2 172.16.24.0 [110/20] via 192.168.2.2, 00:21:02, Serial1/1
O E2 172.16.16.0 [110/20] via 192.168.2.2, 00:21:02, Serial1/1
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/1
O IA 192.168.3.0/24 [110/128] via 192.168.2.2, 00:56:34, Serial1/1
r2#sh ip ospf database
OSPF Router with ID (192.168.2.1) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.2.1 192.168.2.1 1040 0x80000003 0x000182 2
192.168.3.1 192.168.3.1 928 0x80000004 0x00F18E 2
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.17.16.1 192.168.2.1 1040 0x80000002 0x00A718
172.17.24.1 192.168.2.1 1040 0x80000002 0x004F68
172.17.32.1 192.168.2.1 1040 0x80000002 0x00F6B8
192.168.1.0 192.168.2.1 1040 0x80000002 0x002DF7
192.168.3.0 192.168.3.1 928 0x80000002 0x001012
Summary ASB Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.32.1 192.168.3.1 1575 0x80000003 0x00E1CC
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
172.17.32.1 172.17.32.1 1225 0x80000008 0x00BA2B 5
192.168.2.1 192.168.2.1 1042 0x80000004 0x00A76A 2
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.2.0 192.168.2.1 1042 0x80000002 0x002202
192.168.3.0 192.168.2.1 1042 0x80000002 0x009949
Summary ASB Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
172.16.32.1 192.168.2.1 1577 0x80000001 0x006F02
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.16.0 172.16.32.1 714 0x80000001 0x0015E7 0
172.16.24.0 172.16.32.1 714 0x80000001 0x00BC38 0
172.16.32.0 172.16.32.1 714 0x80000001 0x006488 0
B将上述配置稍做修改,把area1配置成末节区域(stub)
r1(config-router)#area 1 stub
r2(config-router)#area 1 stub
r1#sh ip rou
Gateway of last resort is 192.168.1.2 to network 0.0.0.0
172.17.0.0/21 is subnetted, 3 subnets
C 172.17.32.0 is directly connected, Loopback2
C 172.17.24.0 is directly connected, Loopback1
C 172.17.16.0 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Serial1/1
O IA 192.168.2.0/24 [110/128] via 192.168.1.2, 00:00:38, Serial1/1
O IA 192.168.3.0/24 [110/192] via 192.168.1.2, 00:00:38, Serial1/1
O*IA 0.0.0.0/0 [110/65] via 192.168.1.2, 00:00:38, Serial1/1
r1#sh ip ospf da
OSPF Router with ID (172.17.32.1) (Process ID 10)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
172.17.32.1 172.17.32.1 261 0x8000000B 0x00D212 5
192.168.2.1 192.168.2.1 260 0x80000007 0x00BF51 2
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 192.168.2.1 265 0x80000001 0x009140
192.168.2.0 192.168.2.1 265 0x80000004 0x003CE7
192.168.3.0 192.168.2.1 265 0x80000004 0x00B32F
总结:配置成末节区域后sh ip ospf data 没有类型LAS4、LSA5 由于端区内没有到达外部的路由,所以学不到r4上rip 发布的网络
C将上述配置再做修改area1配置成完全末节区域
r1(config-router)#area 1 stub no-summary
r2(config-router)#area 1 stub no-summary
r1#sh ip rou
Gateway of last resort is 192.168.1.2 to network 0.0.0.0
172.17.0.0/21 is subnetted, 3 subnets
C 172.17.32.0 is directly connected, Loopback2
C 172.17.24.0 is directly connected, Loopback1
C 172.17.16.0 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Serial1/1
O*IA 0.0.0.0/0 [110/65] via 192.168.1.2, 00:04:16, Serial1/1
r1#sh ip ospf da
OSPF Router with ID (172.17.32.1) (Process ID 10)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
172.17.32.1 172.17.32.1 364 0x8000000F 0x00CA16 5
192.168.2.1 192.168.2.1 364 0x8000000B 0x00B755 2
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 192.168.2.1 371 0x80000001 0x009140
总结:由于完全末节区域拒绝了类型LSA3、LSA4、LSA5;自动生成缺省路由。(通过特殊的LSA3进去)所以配置完成后sh ip ospf data sh ip rou会出现如上结果。
D1将上述配置再做修改,把are2配置成NSSA区域
r3(config-router)#area 2 nssa default-information-originate
r4(config-router)#area 2 nssa
r1#sh ip rou
172.17.0.0/21 is subnetted, 3 subnets
C 172.17.32.0 is directly connected, Loopback2
C 172.17.24.0 is directly connected, Loopback1
C 172.17.16.0 is directly connected, Loopback0
172.16.0.0/21 is subnetted, 3 subnets
O E2 172.16.32.0 [110/20] via 192.168.1.2, 00:00:11, Serial1/1
O E2 172.16.24.0 [110/20] via 192.168.1.2, 00:00:11, Serial1/1
O E2 172.16.16.0 [110/20] via 192.168.1.2, 00:00:11, Serial1/1
C 192.168.1.0/24 is directly connected, Serial1/1
O IA 192.168.2.0/24 [110/128] via 192.168.1.2, 00:00:11, Serial1/1
O IA 192.168.3.0/24 [110/192] via 192.168.1.2, 00:00:11, Serial1/1
r3#sh ip rou
Gateway of last resort is not set
172.17.0.0/32 is subnetted, 3 subnets
O IA 172.17.32.1 [110/129] via 192.168.2.1, 00:02:53, Serial1/0
O IA 172.17.24.1 [110/129] via 192.168.2.1, 00:02:53, Serial1/0
O IA 172.17.16.1 [110/129] via 192.168.2.1, 00:02:53, Serial1/0
172.16.0.0/21 is subnetted, 3 subnets
O N2 172.16.32.0 [110/20] via 192.168.3.2, 00:02:53, Serial1/1
O N2 172.16.24.0 [110/20] via 192.168.3.2, 00:02:53, Serial1/1
O N2 172.16.16.0 [110/20] via 192.168.3.2, 00:02:53, Serial1/1
O IA 192.168.1.0/24 [110/128] via 192.168.2.1, 00:02:53, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/0
C 192.168.3.0/24 is directly connected, Serial1/1
r3#sh ip ospf da
OSPF Router with ID (192.168.3.1) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.2.1 192.168.2.1 1758 0x80000005 0x00FC84 2
192.168.3.1 192.168.3.1 320 0x80000007 0x00F189 2
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.17.16.1 192.168.2.1 1626 0x80000001 0x00A917
172.17.24.1 192.168.2.1 1626 0x80000001 0x005167
172.17.32.1 192.168.2.1 1626 0x80000001 0x00F8B7
192.168.1.0 192.168.2.1 1758 0x80000004 0x0029F9
192.168.3.0 192.168.3.1 1640 0x80000004 0x000C14
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
172.16.32.1 172.16.32.1 266 0x8000000B 0x00513D 2
192.168.3.1 192.168.3.1 266 0x80000009 0x00659B 2
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
172.17.16.1 192.168.3.1 320 0x80000002 0x00C8AF
172.17.24.1 192.168.3.1 322 0x80000002 0x0070FF
172.17.32.1 192.168.3.1 322 0x80000002 0x001850
192.168.1.0 192.168.3.1 322 0x80000005 0x004892
192.168.2.0 192.168.3.1 322 0x80000005 0x00BA5F
Type-7 AS External Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 192.168.3.1 322 0x80000001 0x004B8B 0
172.16.16.0 172.16.32.1 272 0x80000001 0x00F390 0
172.16.24.0 172.16.32.1 272 0x80000001 0x009BE0 0
172.16.32.0 172.16.32.1 272 0x80000001 0x004331 0
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.16.0 192.168.3.1 252 0x80000001 0x00DA24 0
172.16.24.0 192.168.3.1 252 0x80000001 0x008274 0
172.16.32.0 192.168.3.1 252 0x80000001 0x002AC4 0
r4#sh ip rou
172.17.0.0/32 is subnetted, 3 subnets
O IA 172.17.32.1 [110/193] via 192.168.3.1, 00:05:37, Serial1/0
O IA 172.17.24.1 [110/193] via 192.168.3.1, 00:05:37, Serial1/0
O IA 172.17.16.1 [110/193] via 192.168.3.1, 00:05:37, Serial1/0
172.16.0.0/21 is subnetted, 3 subnets
C 172.16.32.0 is directly connected, Loopback2
C 172.16.24.0 is directly connected, Loopback1
C 172.16.16.0 is directly connected, Loopback0
O IA 192.168.1.0/24 [110/192] via 192.168.3.1, 00:05:37, Serial1/0
O IA 192.168.2.0/24 [110/128] via 192.168.3.1, 00:05:37, Serial1/0
C 192.168.3.0/24 is directly connected, Serial1/0
O*N2 0.0.0.0/0 [110/1] via 192.168.3.1, 00:05:37, Serial1/0
r4#sh ip ospf da
OSPF Router with ID (172.16.32.1) (Process ID 10)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
172.16.32.1 172.16.32.1 446 0x8000000B 0x00513D 2
192.168.3.1 192.168.3.1 446 0x80000009 0x00659B 2
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
172.17.16.1 192.168.3.1 500 0x80000002 0x00C8AF
172.17.24.1 192.168.3.1 500 0x80000002 0x0070FF
172.17.32.1 192.168.3.1 500 0x80000002 0x001850
192.168.1.0 192.168.3.1 500 0x80000005 0x004892
192.168.2.0 192.168.3.1 500 0x80000005 0x00BA5F
Type-7 AS External Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 192.168.3.1 500 0x80000001 0x004B8B 0
172.16.16.0 172.16.32.1 449 0x80000001 0x00F390 0
172.16.24.0 172.16.32.1 449 0x80000001 0x009BE0 0
172.16.32.0 172.16.32.1 452 0x80000001 0x004331 0
D2 r3(config-router)#area 2 nssa no-summary
r4(config-router)#area 2 nssa no-summary
r4#sh ip rou
Gateway of last resort is 192.168.3.1 to network 0.0.0.0
172.16.0.0/21 is subnetted, 3 subnets
C 172.16.32.0 is directly connected, Loopback2
C 172.16.24.0 is directly connected, Loopback1
C 172.16.16.0 is directly connected, Loopback0
C 192.168.3.0/24 is directly connected, Serial1/0
O*IA 0.0.0.0/0 [110/65] via 192.168.3.1, 00:00:29, Serial1/0
总结:普通NSSA:须加default-information-originate参数创建一条area0到NSSA的默认路由 nssa no-summary自动生成缺省路由;拒绝了类型LSA3、LSA4、LSA5。
area1可以学习到R4的外AS的路由条目O E2 表示 R3学习到R4的路由条目后用O N2 表示 同时R4也可以学习到其他区域的路由条目并多一条默认路由。
E 配置ospf路由汇总 #????
ASBR summary-address 172.16.16.0 255.255.248.0
ABR area 1 range 172.17.16.0 255.255.255.0
r2(config-router)#area 1 range 172.17.0.0 255.255.0.0
r4(config-router)#summary-address 172.16.0.0 255.255.0.0
r3#sh ip rou
Gateway of last resort is not set
O IA 172.17.0.0/16 [110/129] via 192.168.2.1, 00:00:20, Serial1/0
O N2 172.16.0.0/16 [110/20] via 192.168.3.2, 00:00:02, Serial1/1
O IA 192.168.1.0/24 [110/128] via 192.168.2.1, 01:09:03, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/0
C 192.168.3.0/24 is directly connected, Serial1/1
O IA 172.17.32.1 [110/129] via 192.168.2.1, 00:02:53, Serial1/0
O IA 172.17.24.1 [110/129] via 192.168.2.1, 00:02:53, Serial1/0
O IA 172.17.16.1 [110/129] via 192.168.2.1, 00:02:53, Serial1/0
172.16.0.0/21 is subnetted, 3 subnets
O N2 172.16.32.0 [110/20] via 192.168.3.2, 00:02:53, Serial1/1
O N2 172.16.24.0 [110/20] via 192.168.3.2, 00:02:53, Serial1/1
O N2 172.16.16.0 [110/20] via 192.168.3.2, 00:02:53, Serial1/1
O IA 192.168.1.0/24 [110/128] via 192.168.2.1, 00:02:53, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/0
C 192.168.3.0/24 is directly connected, Serial1/1
r3#sh ip ospf da
OSPF Router with ID (192.168.3.1) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.2.1 192.168.2.1 1758 0x80000005 0x00FC84 2
192.168.3.1 192.168.3.1 320 0x80000007 0x00F189 2
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.17.16.1 192.168.2.1 1626 0x80000001 0x00A917
172.17.24.1 192.168.2.1 1626 0x80000001 0x005167
172.17.32.1 192.168.2.1 1626 0x80000001 0x00F8B7
192.168.1.0 192.168.2.1 1758 0x80000004 0x0029F9
192.168.3.0 192.168.3.1 1640 0x80000004 0x000C14
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
172.16.32.1 172.16.32.1 266 0x8000000B 0x00513D 2
192.168.3.1 192.168.3.1 266 0x80000009 0x00659B 2
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
172.17.16.1 192.168.3.1 320 0x80000002 0x00C8AF
172.17.24.1 192.168.3.1 322 0x80000002 0x0070FF
172.17.32.1 192.168.3.1 322 0x80000002 0x001850
192.168.1.0 192.168.3.1 322 0x80000005 0x004892
192.168.2.0 192.168.3.1 322 0x80000005 0x00BA5F
Type-7 AS External Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 192.168.3.1 322 0x80000001 0x004B8B 0
172.16.16.0 172.16.32.1 272 0x80000001 0x00F390 0
172.16.24.0 172.16.32.1 272 0x80000001 0x009BE0 0
172.16.32.0 172.16.32.1 272 0x80000001 0x004331 0
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.16.0 192.168.3.1 252 0x80000001 0x00DA24 0
172.16.24.0 192.168.3.1 252 0x80000001 0x008274 0
172.16.32.0 192.168.3.1 252 0x80000001 0x002AC4 0
r4#sh ip rou
172.17.0.0/32 is subnetted, 3 subnets
O IA 172.17.32.1 [110/193] via 192.168.3.1, 00:05:37, Serial1/0
O IA 172.17.24.1 [110/193] via 192.168.3.1, 00:05:37, Serial1/0
O IA 172.17.16.1 [110/193] via 192.168.3.1, 00:05:37, Serial1/0
172.16.0.0/21 is subnetted, 3 subnets
C 172.16.32.0 is directly connected, Loopback2
C 172.16.24.0 is directly connected, Loopback1
C 172.16.16.0 is directly connected, Loopback0
O IA 192.168.1.0/24 [110/192] via 192.168.3.1, 00:05:37, Serial1/0
O IA 192.168.2.0/24 [110/128] via 192.168.3.1, 00:05:37, Serial1/0
C 192.168.3.0/24 is directly connected, Serial1/0
O*N2 0.0.0.0/0 [110/1] via 192.168.3.1, 00:05:37, Serial1/0
r4#sh ip ospf da
OSPF Router with ID (172.16.32.1) (Process ID 10)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
172.16.32.1 172.16.32.1 446 0x8000000B 0x00513D 2
192.168.3.1 192.168.3.1 446 0x80000009 0x00659B 2
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
172.17.16.1 192.168.3.1 500 0x80000002 0x00C8AF
172.17.24.1 192.168.3.1 500 0x80000002 0x0070FF
172.17.32.1 192.168.3.1 500 0x80000002 0x001850
192.168.1.0 192.168.3.1 500 0x80000005 0x004892
192.168.2.0 192.168.3.1 500 0x80000005 0x00BA5F
Type-7 AS External Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 192.168.3.1 500 0x80000001 0x004B8B 0
172.16.16.0 172.16.32.1 449 0x80000001 0x00F390 0
172.16.24.0 172.16.32.1 449 0x80000001 0x009BE0 0
172.16.32.0 172.16.32.1 452 0x80000001 0x004331 0
D2 r3(config-router)#area 2 nssa no-summary
r4(config-router)#area 2 nssa no-summary
r4#sh ip rou
Gateway of last resort is 192.168.3.1 to network 0.0.0.0
172.16.0.0/21 is subnetted, 3 subnets
C 172.16.32.0 is directly connected, Loopback2
C 172.16.24.0 is directly connected, Loopback1
C 172.16.16.0 is directly connected, Loopback0
C 192.168.3.0/24 is directly connected, Serial1/0
O*IA 0.0.0.0/0 [110/65] via 192.168.3.1, 00:00:29, Serial1/0
总结:普通NSSA:须加default-information-originate参数创建一条area0到NSSA的默认路由 nssa no-summary自动生成缺省路由;拒绝了类型LSA3、LSA4、LSA5。
area1可以学习到R4的外AS的路由条目O E2 表示 R3学习到R4的路由条目后用O N2 表示 同时R4也可以学习到其他区域的路由条目并多一条默认路由。
E 配置ospf路由汇总 #????
ASBR summary-address 172.16.16.0 255.255.248.0
ABR area 1 range 172.17.16.0 255.255.255.0
r2(config-router)#area 1 range 172.17.0.0 255.255.0.0
r4(config-router)#summary-address 172.16.0.0 255.255.0.0
r3#sh ip rou
Gateway of last resort is not set
O IA 172.17.0.0/16 [110/129] via 192.168.2.1, 00:00:20, Serial1/0
O N2 172.16.0.0/16 [110/20] via 192.168.3.2, 00:00:02, Serial1/1
O IA 192.168.1.0/24 [110/128] via 192.168.2.1, 01:09:03, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/0
C 192.168.3.0/24 is directly connected, Serial1/1
转载于:https://blog.51cto.com/jianweiit/360644