OSPF多区域配置与汇总

合集下载

OSPF区域与汇总

OSPF区域与汇总

OSPF区域与汇总OSPF(Open Shortest Path First)是一种用于互联网协议(IP)网络中的动态路由协议。

它使用链路状态路由算法来计算网络中最短路径,以便有效地转发数据包。

OSPF使用区域和汇总来优化网络性能和管理。

首先,让我们了解OSPF区域。

OSPF网络可以被分割成多个区域,每个区域的路由器只负责该区域内的路由计算。

这种分割减少了OSPF网络的复杂性,并提高了网络性能。

每个区域都有一个区域边界路由器(Area Border Router,ABR)用于连接不同区域。

ABR负责在区域之间转发路由信息,以便找到最佳路径。

每个区域都有一个唯一的区域号,并用32位IP地址表示。

1.减少路由器交换的路由信息数量,降低了网络开销,提高了网络性能。

2.提高网络可伸缩性。

当网络扩展时,可以简单地添加新的区域而不影响现有区域。

3.提供了更好的管理和维护。

每个区域内的路由器只需要关心本区域的路由计算,简化了网络管理和故障排除。

接下来,让我们了解OSPF的汇总功能。

在大规模的网络中,有时需要合并网段以减少路由表中的项目数量。

这可以通过汇总来实现。

OSPF提供了几种汇总方式,包括汇总路由、包含汇总和默认汇总。

1.汇总路由:将一组连续的网络合并成一个路由项目。

这样可以减少路由表中的项目数量,提高路由查询的速度。

例如,将子网192.168.1.0/24、192.168.2.0/24和192.168.3.0/24汇总成192.168.0.0/162.包含汇总:将多个网络合并到一个较长的网络范围内。

这个较长的网络范围包含所有要汇总的网络。

例如,将子网192.168.1.0/24和192.168.2.0/24包含汇总到192.168.0.0/223.默认汇总:将所有未知目的地汇总到一个默认路由上。

这样做可以减少对未知目的地的路由计算。

默认汇总通常由边界路由器执行。

例如,将所有从区域内部到外部的流量汇总到默认路由上。

OSPF区域与汇总

OSPF区域与汇总

OSPF的区域结构意义在于:1)减小SPF算法的运算量,使SPF运算只涉及Area内的链路,减少CPU和内存的负荷。

2)缩小LSA的洪泛区域,有效利用带宽3)在边界易于做流量控制,比如汇总和过滤。

OSPF要求所有普通区域(Regular Area)都要与骨干区域(Transmit Area)直连,也就意味着Area间的流量都必须经过Area 0,这样一方面便于进行流量控制,另一方面也是出于避免环路的考虑。

因为虽然OSPF是一种链路状态路由协议,但是仍然运用距离矢量的算法来查找Area间路由,Area 0 内的路由器收到ABR通告的一条网络汇总LSA,并不进行SPF运算,只是简单的加上自己到ABR的路径开销,就记录进路由表,这是典型的Distance Vectors行为。

由此可以总结出这样的观点:OSPF路由器对自己所属Area的了解是“链路和拓扑”,而对其他Area的了解仅仅是“可达的路由”,ABR比较特殊,同属两个Area,所以对两个Area的拓扑都了解,但是对其他Area也是仅仅知道路由而已。

OSPF有两种汇总:Area间路由汇总(Area summary)在ABR执行:area 1 range address mask 外部路由汇总(AS summary)(指重发布进OSPF的路由)在ASBR上执行:summary-address address mask。

OSPF的汇总一定要精确,如果有交叉,比如Area间的路由汇总包含了外部路由的明细条目,这样会出现LSA 5通告的转发地址不可达的现象。

而另外要注意的是,当一个Area存在冗余的ABR,ABR之间应该有直连链路,并将该链路通告到骨干区域中使其得到充分利用。

Virtual-link是在网络设计有误或出现故障的情况下,Area 0本身出现分离或者有区域没和Area 0直连,通过Virtual-link来进行补救,再就是出于冗余链路的考虑使用。

多区OSPF完整配置

多区OSPF完整配置

(一)基本配置一、交换部分说明: 本部分包括SW35-1和SW35-2上VLAN规划、STP、HSRP的实现,及SW65-1和SW65-2上的相关配置。

1. sw29-1的配置hostname sw29-1interface Vlan1ip address 172.16.10.1 255.255.255.0no ip routingip default-gateway 172.16.10.199 10.201 10.200 用于网络测试说明:本处将SW29-1模拟一个节点,进行测试。

第一步,将SW29-1网关设为10.199, SW29-2网关设为30.199, 进行测试。

通!第二步,将SW29-1网关设为10.201, SW29-2网关设为30.201, 进行测试。

通!第三步,将SW29-1网关设为10.200, SW29-2网关设为30.200, 进行测试。

不一定通,这是本虚拟机自身的一个问题。

只要SW35-1成为VLAN10,20的主网关,SW35-2成为VLAN30,40的主网关就行了。

2. sw29-2的配置hostname sw29-2vtp domain richvtp pass ciscovtp mode clientint range f1/1 - 2sw trunk encap dot1qsw mode trunkinterface Vlan30ip address 172.16.30.2 255.255.255.0no ip routingip default-gateway 172.16.30.199 30.201 30.200 用于网络测试说明:由于用SW29-2来模拟一个主机进行测试,因此只能设置一个IP(路由器可以设多个),这里把它作为VLAN30的一个主机30.2, 网关设为30.199 。

3. sw35-1的配置hostname sw35-1no ip domain lookupvtp domain richvtp pass ciscovtp mode servervlan 10vlan 20vlan 30vlan 40exitspanning-tree vlan 10 priority 4096 spanning-tree vlan 20 priority 4096 spanning-tree vlan 30 priority 8192 spanning-tree vlan 40 priority 8192interface Port-channel1switchport mode trunkinterface FastEthernet1/1no switchportip address 192.168.1.1 255.255.255.0interface FastEthernet1/2no switchportip address 192.168.2.1 255.255.255.0interface FastEthernet1/3switchport mode trunkchannel-group 1 mode oninterface FastEthernet1/4switchport mode trunkchannel-group 1 mode oninterface FastEthernet1/5switchport mode trunkinterface FastEthernet1/6switchport access vlan 10interface Vlan10ip address 172.16.10.199 255.255.255.0 standby 1 ip 172.16.10.200standby 1 priority 150standby 1 preemptstandby 1 authentication 123standby 1 track FastEthernet1/1 30 standby 1 track FastEthernet1/2 30interface Vlan20ip address 172.16.20.199 255.255.255.0 standby 2 ip 172.16.20.200standby 2 priority 150standby 2 preemptstandby 2 authentication 123standby 2 track FastEthernet1/1 30 standby 2 track FastEthernet1/2 30interface Vlan30ip address 172.16.30.199 255.255.255.0 standby 3 ip 172.16.30.200standby 3 preemptstandby 3 authentication 123interface Vlan40ip address 172.16.40.199 255.255.255.0 standby 4 ip 172.16.40.200standby 4 preemptstandby 4 authentication 123line con 0exec-timeout 0 0logging synchronous4. sw35-2的配置hostname sw35-2no ip domain lookupvtp domain richvtp pass ciscovtp mode clientspanning-tree vlan 10 priority 8192 spanning-tree vlan 20 priority 8192 spanning-tree vlan 30 priority 4096 spanning-tree vlan 40 priority 4096interface Port-channel1switchport mode trunkinterface FastEthernet1/1no switchportip address 192.168.4.1 255.255.255.0interface FastEthernet1/2no switchportip address 192.168.3.1 255.255.255.0interface FastEthernet1/3switchport mode trunkchannel-group 1 mode oninterface FastEthernet1/4switchport mode trunkchannel-group 1 mode oninterface FastEthernet1/5switchport access vlan 10interface FastEthernet1/6switchport mode trunkinterface Vlan10ip address 172.16.10.201 255.255.255.0 standby 1 ip 172.16.10.200standby 1 preemptstandby 1 authentication 123interface Vlan20ip address 172.16.20.201 255.255.255.0 standby 2 ip 172.16.20.200standby 2 preemptstandby 2 authentication 123interface Vlan30ip address 172.16.30.201 255.255.255.0 standby 3 ip 172.16.30.200standby 3 priority 150standby 3 preemptstandby 3 authentication 123standby 3 track FastEthernet1/1 30standby 3 track FastEthernet1/2 30interface Vlan40ip address 172.16.40.201 255.255.255.0standby 4 ip 172.16.40.200standby 4 priority 150standby 4 preemptstandby 4 authentication 123standby 4 track FastEthernet1/1 30standby 4 track FastEthernet1/2 30line con 0exec-timeout 0 0logging synchronous5. sw65-1的配置说明: 在实际网络应用中SW65-1和SW65-2上应划分VLAN50、60、70、80, 并配置HSRP来实现网关冗余,配置方法同SW35-1和SW35-2. 这里做了简化,用loopback接口来模拟。

OSPF 手工汇总:区域间汇总、外部路由汇总

OSPF 手工汇总:区域间汇总、外部路由汇总

OSPF 手工汇总:区域间汇总、外部路由汇总1.实验目的通过本实验可以掌握:(1)路由汇总的目的(2)区域间路由汇总(3)外部自治系统路由汇总2.实验拓扑本实验的拓扑结构如图7-3 所示。

图7-3 OSPF 手工汇总路由器R1、R2 和R3 之间运行OSPF,路由器R3 和R4 之间运行RIPv2,路由器R1 上的四个环回接口是为在路由器R2 上做区域间路由汇总准备的,路由器R4 上的四个环回接口是为在路由器R3 上做外部路由汇总准备的。

由于路由器R3 是边界路由器,所以要完成双向重分布。

3.实验步骤(1)步骤1:配置路由器R1R1(config)#router ospf 1R1(config-router)#router-id 1.1.1.1R1(config-router)#network 1.1.4.0 0.0.0.255 area 1R1(config-router)#network 1.1.5.0 0.0.0.255 area 1R1(config-router)#network 1.1.6.0 0.0.0.255 area 1R1(config-router)#network 1.1.7.0 0.0.0.255 area 1R1(config-router)#network 192.168.12.0 0.0.0.255 area 1(2)步骤2:配置路由器R2R2(config)#router ospf 1R2(config-router)#router-id 2.2.2.2R2(config-router)#network 192.168.12.0 0.0.0.255 area 1R2(config-router)#network 192.168.23.0 0.0.0.255 area 0R2(config-router)#network 2.2.2.0 0.0.0.255 area 0R2(config-router)#area 1 range 1.1.4.0 255.255.252.0 //配置区域间路由汇总(3)步骤3:配置路由器R3R3(config)#router ospf 1R3(config-router)#router-id 3.3.3.3R3(config-router)#network 3.3.3.0 0.0.0.255 area 0R3(config-router)#network 192.168.23.0 0.0.0.255 area 0R3(config-router)#summary-address 4.4.0.0 255.255.252.0//配置外部自治系统路由汇总R3(config-router)#redistribute rip subnets //将RIP 路由重分布到OSPF 中R3(config)#router ripR3(config-router)#version 2R3(config-router)#no auto-summaryR3(config-router)#network 192.168.34.0R3(config-router)#redistribute ospf 1 metric 2 //将OSPF 路由重分布到RIP 中(4)步骤4:配置路由器R4R4(config)#router ripR4(config-router)#version 2R4(config-router)#no auto-summaryR4(config-router)#network 4.0.0.0R4(config-router)#network 192.168.34.0【技术要点】(1)区域间路由汇总必须在ABR 上完成;(2)外部路由汇总必须在ASBR 上完成。

OSPF实验4OSPF多区域配置

OSPF实验4OSPF多区域配置

OSPF实验四OSPF多区域配置
一、实验目的
配置OSPF的多区域并进行路由汇总。

应用场景:作为使用最为广泛的动态路由协议,OSPF的使用一般都要划分区域并在ABR上针对路由进行汇总。

二、实验设备
四台Cisco 7206 VXR 中由器、IOS版本V ersion 12.3(5)。

三、实验拓普
四、实验步骤
基本配置:
1、设备命名。

2、用Ping命令测试总部和分部链路的连通性。

3、按照拓扑图配置好接口IP和接口描述信息。

OSPF配置:
4、启动OSPF进程并配置Router-ID。

5、把相关接口放入OSPF进程并绑定特定的区域。

6、在ABR上做路由汇总。

五、配置命令
六、测试结果
七、实验思考
1、单区域OSPF能看到OSPF的路由是什么路由?在LSDB中能看到哪些LAS?多区
域?
2、OSPF划分区域的目的是什么?划分区域后什么配置是必须做的?为此在分配地址
时必须注意什么?
3、如何划分多区域?骨干区域的作用是什么?设计拓扑证明骨干区域的作用(有、无
骨干区域)?
4、针对区域间路由在哪个设备做汇总?路由汇总针对的是哪种LSA?
5、这种拓扑有什么问题?实际部署时如何解决?
6、不希望其他区域看到本区域的设备及链路IP,如何实现?
7、LSA1、LSA2、LSA3分别是哪个设备产生的?作用是什么?各自的关系是什么?查看LSA具体的内容?并尝试读解。

标准的OSPF多区域配置

标准的OSPF多区域配置

实验报告配置标准的ospf多区域一.实验目的1.使运行ospf路由协议的路由器能够学习到域内,域间的路由条目2.进行路由汇总简化路由条目3.通过向全网ospf路由器公布默认路由,并设置ISP实现对外部网络的访问二.实验拓扑三.实验步骤1.配置路由器的ip地址R1(config)#int s0/0R1(config-if)#ip add 192.168.1.2 255.255.255.0R1(config-if)#clock rate 64000R1(config-if)#no shutR1(config)#int s0/1R1(config-if)#ip add 192.168.224.1 255.255.255.252R1(config-if)#clock rate 64000R1(config-if)#no shutR1(config)#int loopback 0R1(config-if)#ip add 192.168.2.1 255.255.255.0R1(config-if)#no shutR2(config)#int s0/0R2(config-if)#ip add 192.168.1.1 255.255.255.0R2(config-if)#clock rate 64000R2(config-if)#no shutR2(config-if)#int loopback 0R2(config-if)#ip add 192.168.64.1 255.255.240.0R2(config-if)#no shutR3(config)#int s0/0R3(config-if)#ip add 192.168.224.2 255.255.255.252R3(config-if)#clock rate 64000R3(config-if)#no shut2.启用OSPF路由协议(配置OSPF时需要每个接口的Area id的不同)R1(config-if)#router ospf 1R1(config-router)#network 192.168.3.0 0.0.0.255 area 0R1(config-router)#network 192.168.1.0 0.0.0.255 area 0R1(config-router)#network 192.168.224.0 0.0.0.3 area 51R1#sh ip rouGateway of last resort is not set192.168.224.0/30 is subnetted, 1 subnetsC 192.168.224.0 is directly connected, Serial0/1192.168.64.0/32 is subnetted, 1 subnetsO IA 192.168.64.1 [110/65] via 192.168.1.1, 00:00:08, Serial0/0192.168.80.0/32 is subnetted, 1 subnetsO IA 192.168.80.1 [110/65] via 192.168.1.1, 00:00:08, Serial0/0192.168.96.0/32 is subnetted, 1 subnetsO IA 192.168.96.1 [110/65] via 192.168.1.1, 00:00:08, Serial0/0192.168.112.0/32 is subnetted, 1 subnetsO IA 192.168.112.1 [110/65] via 192.168.1.1, 00:00:08, Serial0/0192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksO 192.168.1.0/30 [110/128] via 192.168.1.1, 00:01:21, Serial0/0C 192.168.1.0/24 is directly connected, Serial0/0C 192.168.3.0/24 is directly connected, Loopback0R2(config-if)#router ospf 1R2(config-router)#network 192.168.1.0 0.0.0.255 area 0R2(config-router)#network 192.168.64.0 0.0.240.255 area 1R2(config-router)#network 192.168.80.0 0.0.240.255 area 1R2(config-router)#network 192.168.96.0 0.0.240.255 area 1R2(config-router)#network 192.168.112.0 0.0.240.255 area 1R2#sh ip rouGateway of last resort is not set192.168.224.0/30 is subnetted, 1 subnetsO IA 192.168.224.0 [110/128] via 192.168.1.2, 01:41:45, Serial0/0192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksO 192.168.1.0/24 [110/128] via 192.168.1.2, 01:41:45, Serial0/0C 192.168.1.0/30 is directly connected, Serial0/0192.168.3.0/32 is subnetted, 1 subnetsO 192.168.3.1 [110/65] via 192.168.1.2, 01:41:45, Serial0/0C 192.168.64.0/20 is directly connected, Loopback0C 192.168.80.0/20 is directly connected, Loopback1C 192.168.96.0/20 is directly connected, Loopback2C 192.168.112.0/20 is directly connected, Loopback3R3(config-if)#router ospf 1R3(config-router)#network 192.168.224.0 0.0.0.3 area 51R3#sh ip rouGateway of last resort is not set192.168.224.0/30 is subnetted, 1 subnetsC 192.168.224.0 is directly connected, Serial0/0192.168.64.0/32 is subnetted, 1 subnetsO IA 192.168.64.1 [110/129] via 192.168.224.1, 01:44:32, Serial0/0 192.168.80.0/32 is subnetted, 1 subnetsO IA 192.168.80.1 [110/129] via 192.168.224.1, 01:44:32, Serial0/0 192.168.96.0/32 is subnetted, 1 subnetsO IA 192.168.96.1 [110/129] via 192.168.224.1, 01:44:32, Serial0/0 192.168.112.0/32 is subnetted, 1 subnetsO IA 192.168.112.1 [110/129] via 192.168.224.1, 01:44:32, Serial0/0 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksO IA 192.168.1.0/30 [110/192] via 192.168.224.1, 01:44:32, Serial0/0 O IA 192.168.1.0/24 [110/128] via 192.168.224.1, 01:44:32, Serial0/0 192.168.3.0/32 is subnetted, 1 subnetsO IA 192.168.3.1 [110/65] via 192.168.224.1, 01:44:33, Serial0/0 注:“O”表示域内路由条目“O IA”表示的域间路由条目2.加入外部地址,在R3上添加静态路由(注意路由表中的蓝色条目)R3(config)#ip route 10.10.8.0 255.255.255.0 null 0R3(config)#ip route 10.10.9.0 255.255.255.0 null 0R3(config)#ip route 10.10.10.0 255.255.255.0 null 0R3(config)#ip route 10.10.11.0 255.255.255.0 null 0R3#sh ip rouGateway of last resort is not set192.168.224.0/30 is subnetted, 1 subnetsC 192.168.224.0 is directly connected, Serial0/0192.168.64.0/32 is subnetted, 1 subnetsO IA 192.168.64.1 [110/129] via 192.168.224.1, 01:56:40, Serial0/0 192.168.80.0/32 is subnetted, 1 subnetsO IA 192.168.80.1 [110/129] via 192.168.224.1, 01:56:40, Serial0/010.0.0.0/24 is subnetted, 4 subnetsS 10.10.8.0 is directly connected, Null0S 10.10.9.0 is directly connected, Null0S 10.10.10.0 is directly connected, Null0S 10.10.11.0 is directly connected, Null0192.168.96.0/32 is subnetted, 1 subnetsO IA 192.168.96.1 [110/129] via 192.168.224.1, 01:56:40, Serial0/0 192.168.112.0/32 is subnetted, 1 subnetsO IA 192.168.112.1 [110/129] via 192.168.224.1, 01:56:41, Serial0/0 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksO IA 192.168.1.0/30 [110/192] via 192.168.224.1, 01:56:41, Serial0/0 O IA 192.168.1.0/24 [110/128] via 192.168.224.1, 01:56:41, Serial0/0 192.168.3.0/32 is subnetted, 1 subnetsO IA 192.168.3.1 [110/65] via 192.168.224.1, 01:56:41, Serial0/0R3(config)#router ospf 1R3(config-router)#redistribute static subnets(此命令是对R3上所添加的静态路由进行重发布)R3#sh ip rou (R3路由表条目不会有变化)3.在R1,R2上sh ip router(注意路由表中的红色条目)R1#sh ip rouGateway of last resort is not set192.168.224.0/30 is subnetted, 1 subnetsC 192.168.224.0 is directly connected, Serial0/1192.168.64.0/32 is subnetted, 1 subnetsO IA 192.168.64.1 [110/65] via 192.168.1.1, 00:00:23, Serial0/0192.168.80.0/32 is subnetted, 1 subnetsO IA 192.168.80.1 [110/65] via 192.168.1.1, 00:00:23, Serial0/010.0.0.0/24 is subnetted, 4 subnetsO E2 10.10.8.0 [110/20] via 192.168.224.2, 00:00:23, Serial0/1O E2 10.10.9.0 [110/20] via 192.168.224.2, 00:00:23, Serial0/1O E2 10.10.10.0 [110/20] via 192.168.224.2, 00:00:23, Serial0/1O E2 10.10.11.0 [110/20] via 192.168.224.2, 00:00:23, Serial0/1192.168.96.0/32 is subnetted, 1 subnetsO IA 192.168.96.1 [110/65] via 192.168.1.1, 00:00:23, Serial0/0192.168.112.0/32 is subnetted, 1 subnetsO IA 192.168.112.1 [110/65] via 192.168.1.1, 00:00:23, Serial0/0192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksO 192.168.1.0/30 [110/128] via 192.168.1.1, 01:59:24, Serial0/0C 192.168.1.0/24 is directly connected, Serial0/0C 192.168.3.0/24 is directly connected, Loopback0R2#sh ip rouGateway of last resort is not set192.168.224.0/30 is subnetted, 1 subnetsO IA 192.168.224.0 [110/128] via 192.168.1.2, 01:58:59, Serial0/010.0.0.0/24 is subnetted, 4 subnetsO E2 10.10.8.0 [110/20] via 192.168.1.2, 00:00:08, Serial0/0O E2 10.10.9.0 [110/20] via 192.168.1.2, 00:00:08, Serial0/0O E2 10.10.10.0 [110/20] via 192.168.1.2, 00:00:08, Serial0/0O E2 10.10.11.0 [110/20] via 192.168.1.2, 00:00:08, Serial0/0192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksO 192.168.1.0/24 [110/128] via 192.168.1.2, 01:58:59, Serial0/0C 192.168.1.0/30 is directly connected, Serial0/0192.168.3.0/32 is subnetted, 1 subnetsO 192.168.3.1 [110/65] via 192.168.1.2, 01:58:59, Serial0/0C 192.168.64.0/20 is directly connected, Loopback0C 192.168.80.0/20 is directly connected, Loopback1C 192.168.96.0/20 is directly connected, Loopback2C 192.168.112.0/20 is directly connected, Loopback3注意:IA 表示域间;E2表示域内,路由重发布后,R1,R2上将学习到R3上的静态路由条目。

OSPF高级配置(ABR ASBR、多区域、路由汇总、特殊区域)

配置命令:r1(config)#router ospf 110r1(config-router)#router-id 1.1.1.1r1(config-router)#net 1.1.1.1 0.0.0.0 area 0r1(config-router)#net 192.168.13.0 0.0.0.255 area 0r1(config-router)#net 192.168.12.0 0.0.0.255 area 0r2(config-router)#router ospf 110r2(config-router)#router-id 2.2.2.2r2(config-router)#network 2.2.2.2 0.0.0.0 area 1r2(config-router)#network 192.168.12.0 0.0.0.255 area 0r2(config-router)#network 192.168.24.0 0.0.0.255 area 1r2(config-router)#area 1 stub no-summaryr2(config-router)#area 1 default-cost 10r3(config-router)#router ospf 110r3(config-router)#router-id 3.3.3.3r3(config-router)#network 3.3.3.3 0.0.0.0 area 2r3(config-router)#network 30.1.1.1 0.0.0.0 area 0r3(config-router)#network 192.168.13.0 0.0.0.255 area 0r3(config-router)#network 192.168.35.0 0.0.0.255 area 2r3(config-router)#area 0 range 30.0.0.0 255.0.0.0r3(config-router)#area 2 nssa no-redistribution default-information-originate r4(config-router)#router ospf 110r4(config-router)#router-id 4.4.4.4r4(config-router)#network 4.4.4.4 0.0.0.0 area 1r4(config-router)#network 192.168.24.0 0.0.0.255 area 1r4(config-router)#area 1 stub no-summaryr4(config-router)#area 1 default-cost 10r5(config-router)#router ospf 110r5(config-router)#router-id 5.5.5.5r5(config-router)#network 50.1.1.1 0.0.0.0 area 2r5(config-router)#network 192.168.35.0 0.0.0.255 area 2r5(config-router)#area 2 nssar5(config-router)#summary-address 50.0.0.0 255.0.0.0 not-advertiser5(config-router)#redistribute connected metric-type 1 subnets查看配置:#sh ip ospf 查看ospf所有进程信息#Sh ip ospf 1 (process-id) 查看OSPF 1 进程信息#sh ip ospf border-routers 查看边界路由器#Sh ip ospf neighbor 查看邻居表;#Sh ip ospf interface 查看ospf接口信息#Sh ip ospf database 查看ospf数据库#Sh ip ospf database database-summary查看ospf数据库总结信息#Sh ip route ospf 查看ospf路由表#Clear ip ospf process 刷新OSPF进程#debug ip ospf adj 查看ospf邻居关系的建立过程(注: 刷新OSPF进程后即可看到输出信息)。

OSPF协议多区域配置实验

实验名称:实验十一:OSPF协议多区域配置实验实验目的在本实验中,我们将要完成OSPF多区域的OSPF路由协议的配置过程。

练习使用OSPF 协议的相关命令的使用。

复习与回顾常用动态路由协议的配置过程。

实验内容一、实验环境说明。

1、本次实验将通过Packet Tracer 模拟器软件来完成。

2、在本节中将练习使用以命令:二、实验项目1:配置多区域OSPF协议验证实验。

网络的拓扑结构如下图所示,加载:OSPF协议多区域配置.pkt,拓扑图中各路由器端口属性,已经配置好,请自己查看。

1、请根据以下操作步骤完成OPSP多区域配置。

R1路由器:R1(config)#router ospf 1R1(config-router)#network 10.0.0.0 0.0.0.255 area 1R1(config-router)#network 11.0.0.0 0.0.0.255 area 1R1(config-router)#network 172.16.0.0 0.0.0.255 area 1R1(config-router)#network 172.16.1.0 0.0.0.255 area 1R1(config-router)#network 172.16.2.0 0.0.0.255 area 1R1(config-router)#network 172.16.3.0 0.0.0.255 area 1R1(config-router)#endR1#copy running-config startup-configR2路由器:R2#con tR2(config)#router ospf 1R2(config-router)#network 11.0.0.0 0.0.0.255 area 1R2(config-router)#network 12.0.0.0 0.0.0.255 area 0R2(config-router)#endR2#copy running-config startup-configR3路由器:R3#con tR3(config)#router ospf 1R3(config-router)#network 12.0.0.0 0.0.0.255 area 0R3(config-router)#network 13.0.0.0 0.0.0.255 area 2R3(config-router)#endR3#copy running-config startup-configR4路由器:R4#con tR4(config)#router ospf 1R4(config-router)#network 13.0.0.0 0.0.0.255 area 2R4(config-router)#network 14.0.0.0 0.0.0.255 area 2R4(config-router)#endR4#copy running-config startup-config2、在完成上述配置后,在R2路由器上运行show ip rotue 命令来查看其路由表。

第9_OSPF多区综合配置

OSPF多区综合配置1.路由重分发完成标准:每个路由器都学到了10条路由2.Stub区域的配置完成标准:在stub区域的路由器R1只保留6条路由和1条缺省路由3.Totally stub区域的配置完成标准:在stub区域的路由器R1只保留3条路由和1条缺省路由1.路由重分发的配置R1的配置:Router> enRouter# config tRouter(config)# host R1R1(config)# int e0/0R1(config-if)# ip add 192.168.1.1 255.255.255.0R1(config-if)# no shutR1(config-if)# int e0/1R1(config-if)# ip add 192.168.2.1 255.255.255.0R1(config-if)# no shutR1(config-if)# int loop 0R1(config-if)# ip add 172.16.1.1 255.255.255.0R1(config-if)# no shutR1(config-if)# exitR1(config)# router ospf 10R1(config-router)# net 192.168.1.0 0.0.0.255 a 1R1(config-router)# net 192.168.2.0 0.0.0.255 a 1R1(config-router)# net 172.16.1.0 0.0.0.255 a 1R1(config-router)# endR1#R2的配置Router> enRouter# config tRouter(config)# host R2R2(config)# int e0/1R2(config-if)# ip add 192.168.2.2 255.255.255.0 R2(config-if)# no shutR2(config-if)# int e0/2R2(config-if)# ip add 192.168.3.1 255.255.255.0 R2(config-if)# no shutR2(config-if)# int loop 0R2(config-if)# ip add 172.17.1.1 255.255.255.0R2(config-if)# no shutR2(config-if)# exitR2(config)# router ospf 10R2(config-router)# net 192.168.2.0 0.0.0.255 a 1 R2(config-router)# net 192.168.3.0 0.0.0.255 a 0 R2(config-router)# net 172.17.1.0 0.0.0.255 a 0 R2(config-router)# endR2#R3的配置Router> enRouter# config tRouter(config)# host R3R3(config)# int e0/2R3(config-if)# ip add 192.168.3.2 255.255.255.0 R3(config-if)# no shutR3(config-if)# int e0/3R3(config-if)# ip add 192.168.4.1 255.255.255.0 R3(config-if)# no shutR3(config-if)# int loop 0R3(config-if)# ip add 172.18.1.0 255.255.255.0R3(config-if)# no shutR3(config-if)# exitR3(config)# router ospf 10R3(config-router)# net 192.168.3.0 0.0.0.255 a 0 R3(config-router)# net 172.18.1.1 0.0.0.255 a 0 R3(config-router)# redistribution rip metric 100R3(config-router)# exitR3(config)# router ripR3(config-router)# net 192.168.4.0R3(config-router)# redistribution ospf 10 metric 5R3(config-router)#endR3#R4的配置Router> enRouter# config tRouter(config)# host R4R4(config)# int e0/3R4(config-if)# ip add 192.168.4.2 255.255.255.0R4(config-if)# no shutR4(config-if)# int e0/0R4(config-if)# ip add 192.168.50.1 255.255.255.0R4(config-if)# no shutR4(config-if)# int e0/1R4(config-if)# ip add 192.168.100.1 255.255.255.0R4(config-if)# no shutR4(config-if)# int e0/2R4(config-if)# ip add 192.168.150.1 255.255.255.0R4(config-if)# no shutR4(config-if)# exitR4(config)# router ripR4(config-router)# net 192.168.4.0R4(config-router)# net 192.168.50.0R4(config-router)# net 192.168.100.0R4(config-router)# net 192.168.150.0R4(config-router)#endR4#完成标准:在任意一台路由器上用show ip route来查看路由表,都能看到10条路由。

多区OSPF完整配置

(一)交换部分enconf tno ip domain-lookupline con 0logg synexec-time 0 0exit一、基本配置本部分包括VLAN规划和VLAN间的通信。

1. sw29-1的配置hostname sw29-1vtp domain richvtp pass ciscovtp mode clientint range f1/1 - 2sw trunk encap dot1qsw mode trunksw tr all vlan 1,10interface Vlan1ip address 172.16.1.201 255.255.255.0interface Vlan10ip address 172.16.10.201 255.255.255.0no ip routingip default-gateway 172.16.10.251 10.252 10.254 (HSRP)说明:这里用SW29-1的vlan10来模拟一个主机进行VLAN间通信测试。

2. sw29-5的配置hostname sw29-5vtp domain richvtp pass ciscovtp mode clientint range f1/1 - 2sw trunk encap dot1qsw mode trunkinterface Vlan1ip address 172.16.1.205 255.255.255.0interface Vlan30ip address 172.16.30.205 255.255.255.0no ip routingip default-gateway 172.16.30.251 30.252 30.254 (HSRP)说明:这里用SW29-5的vlan30来模拟一个主机进行VLAN间通信测试。

3. sw35-1的配置hostname sw35-1no ip domain lookupvtp domain richvtp pass ciscovtp mode servervlan 10vlan 20vlan 30vlan 40exitinterface Port-channel1switchport mode trunkinterface FastEthernet1/1no switchportip address 192.168.1.1 255.255.255.0interface FastEthernet1/2no switchportip address 192.168.2.1 255.255.255.0interface FastEthernet1/3sw trunk encapsulation dot1q switchport mode trunkchannel-group 1 mode on interface FastEthernet1/4sw trunk encapsulation dot1q switchport mode trunkchannel-group 1 mode onshutdowninterface FastEthernet1/5sw trunk encapsulation dot1q switchport mode trunkinterface FastEthernet1/6sw trunk encapsulation dot1q switchport mode trunkinterface Vlan1ip address 172.16.1.251 255.255.255.0 no shutinterface Vlan10ip address 172.16.10.251 255.255.255.0interface Vlan20ip address 172.16.20.251 255.255.255.0interface Vlan30ip address 172.16.30.251 255.255.255.0interface Vlan40ip address 172.16.40.251 255.255.255.0line con 0exec-timeout 0 0logging synchronous4. sw35-2的配置hostname sw35-2no ip domain lookupvtp domain richvtp pass ciscovtp mode clientinterface Port-channel1switchport mode trunkinterface FastEthernet1/1no switchportip address 192.168.4.1 255.255.255.0interface FastEthernet1/2no switchportip address 192.168.3.1 255.255.255.0interface FastEthernet1/3sw trunk encapsulation dot1q switchport mode trunkchannel-group 1 mode oninterface FastEthernet1/4sw trunk encapsulation dot1q switchport mode trunkchannel-group 1 mode on shutdowninterface FastEthernet1/5sw trunk encapsulation dot1qswitchport mode trunkinterface FastEthernet1/6sw trunk encapsulation dot1q switchport mode trunkinterface Vlan1ip address 172.16.1.252 255.255.255.0 no shutinterface Vlan10ip address 172.16.10.252 255.255.255.0interface Vlan20ip address 172.16.20.252 255.255.255.0interface Vlan30ip address 172.16.30.252 255.255.255.0interface Vlan40ip address 172.16.40.252 255.255.255.0line con 0exec-timeout 0 0logging synchronous二、配置STP,防止二层环路,并实现不同VLAN流量的负载均衡。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

R1的详细配置
Router>en Router#conf t Router(config)#int lo0
Router(config-if)#ip add 1.1.1.1 255.255.255.0 Router(config-if)#exit Router(config)#int s0/0
Router(config-if)#ip add 12.12.12.1 255.255.255.0 Router(config-if)#no shut
Router(config-if)#clock rate 64000 Router(config-if)#clock rate 64000
S0/0 S0/0 S0/1 S0/1 S0/0 S0/0
12.12..12.0/24 23.23.23.0/24
34.34.34.0/24
R1
R2
R4 R3
1 2 2 3 3 4 Area 0
Area 1
Lo0:2.2.2.2/24
Lo0:3.3.3.3/24
R4:
Lo0:4.4.4.4/24 Lo10:10.1.0.4/24 Lo11:10.1.1.4/24 Lo12:10.1.2.4/24 Lo13:10.1.3.4/24
R1:
Lo0:1.1.1.1/24 Lo10:172.16.0.1/24 Lo11:172.16.1.1/24 Lo12:172.16.2.1/24 Lo13:172.16.3.1/24
Router(config)#int lo1
Router(config-if)#ip add 172.16.1.1 255.255.255.0 Router(config-if)#exit
Router(config)#int lo2
Router(config-if)#ip add 172.16.2.1 255.255.255.0 Router(config-if)#exit
Router(config)#int lo3
Router(config-if)#ip add 172.16.3.1 255.255.255.0 Router(config-if)#exit
Router(config)#int lo4
Router(config-if)#ip add 172.16.4.1 255.255.255.0 Router(config-if)#exit
Router#conf t
Router(config)#router ospf 1
Router(config-router)#exit
Router(config)#router rip
Router(config-router)#ve
Router(config-router)#version 2
Router(config-router)#no au
Router(config-router)#no auto-summary
Router(config-router)#net 12.0.0.0
Router(config-router)#net 172.16.0.0
Router(config-router)#end
R2的详细配置
Router>en
Router#conf t
Router(config)#int lo0
Router(config-if)#ip add 2.2.2.2 255.255.255.0 Router(config-if)#exit
Router(config)#int s0/0
Router(config-if)#ip add 12.12.12.2 255.255.255.0 Router(config-if)#no shut
Router(config-if)#exit
Router(config)#int s0/1
Router(config-if)#ip add 23.23.23.1 255.255.255.0 Router(config-if)#no shut
Router(config-if)#clock rate 64000
Router(config-if)#exit
Router(config)#router rip
Router(config-router)#no auto-summary
Router(config-router)#net 12.0.0.0
Router(config-router)#exit
Router(config)#router ospf 1
Router(config-router)#net 23.23.23.0 0.0.0.255 a 0
Router(config-router)#net 2.2.2.0 0.0.0.255 a 0
Router(config-router)#redistribute rip subnets metric-type 1 Router(config-router)#summary-address 172.16.0.0 255.255.252.0
R3的详细配置
Router>en
Router(config)#int lo0
Router(config-if)#ip add 3.3.3.3 255.255.255.0
Router(config-if)#int s0/0
Router(config-if)#ip add 23.23.23.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#int s 0/1
Router(config-if)#ip add 34.34.34.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#clock rate 64000
Router(config-if)#exit
Router(config)#router ospf 1
Router(config-router)#net 23.23.23.0 0.0.0.255 a 0 Router(config-router)#net 3.3.3.0 0.0.0.255 a 0 Router(config-router)#net 34.34.34.0 0.0.0.255 a 1 Router(config-router)#area 1 range 10.1.0.0 255.255.252.0 Router(config-router)#end
R4的详细配置
Router>en
Router#conf t
Router(config)#int lo0
Router(config-if)#ip add 4.4.4.4 255.255.255.0
Router(config-if)#exit
Router(config)#int s0/0
Router(config-if)#ip add 34.34.34.2 255.255.255.0 Router(config-if)#no shut
Router(config-if)#clock rate 64000
Router(config-if)#end
Router#
Router#conf t
Router(config)#int lo1
Router(config-if)#ip add 10.1.1.1 255.255.255.0
Router(config-if)#exit
Router(config)#int lo2
Router(config-if)#ip add 10.1.2.1 255.255.255.0
Router(config-if)#exit
Router(config)#int lo3
Router(config-if)#ip add 10.1.3.1 255.255.255.0
Router(config-if)#exit
Router(config)#int lo4
Router(config-if)#ip add 10.1.4.1 255.255.255.0
Router(config-if)#exit
Router(config)#router ospf 1
Router(config-router)#net 34.34.34.0 0.0.0.255 a 1
Router(config-router)#net 4.4.4.0 0.0.0.255 a 1
Router(config-router)#net 10.1.0.0 0.0.3.255 a 1
Router(config-router)#end
各个路由器的基本配置完成
使用show ip rou 和show ip ospf database查看各路由器如下R1的
R2的
R3的
R4的
. .。

相关文档
最新文档