基本OSPF配置实验
- 格式:doc
- 大小:61.00 KB
- 文档页数:4
OSPF单区域1 实验目的:能够在单区域环境中配置OSPF路由协议。
2 网络拓扑3 试验环境:网络中计算机和路由器的IP地址已经如图配置完成。
4 试验要求✓在Area0配置OSPF。
✓查看路由表。
✓检查OSPF协议的收敛速度。
5 基本配置步骤5.1在Router2上Router>enRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#router ospf 1Router(config-router)#network 192.168.0.0 0.0.0.3 area 0Router(config-router)#network 172.16.0.0 0.0.255.255 area 0Router(config-router)#ORRouter(config)#router ospf 1Router(config-router)#network 192.168.0.1 0.0.0.0 area 0Router(config-router)#network 172.16.0.1 0.0.0.0 area 0Router(config-router)#5.2在Route0上Router>enRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#router ospf 1Router(config-router)#network 192.168.0.0 0.0.0.3 area 0Router(config-router)#network 192.168.0.4 0.0.0.3 area 0Router(config-router)#network 192.168.0.12 0.0.0.3 area 0Router(config-router)#ex5.3在Router1上Router>enRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#router ospf 1Router(config-router)#network 192.168.0.0 0.0.0.255 area 05.4在Router4上Router>enRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#router ospf 1Router(config-router)#network 192.168.0.0 0.0.0.255 area 0Router(config-router)#network 172.18.0.0 0.0.255.255 area 05.5在Router3上Router>enRouter#config tRouter(config)#router ospf 1Router(config-router)#network 192.168.0.0 0.0.0.255 area 0Router(config-router)#network 172.17.0.0 0.0.255.255 area 0Router(config-router)#6 检查路由表6.1在Router3上Router#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setO 172.16.0.0/16 [110/1563] via 192.168.0.13, 00:01:15, Serial2/0C 172.17.0.0/16 is directly connected, FastEthernet0/0O 172.18.0.0/16 [110/782] via 192.168.0.17, 00:01:15, Serial3/0192.168.0.0/30 is subnetted, 5 subnetsO 192.168.0.0 [110/1562] via 192.168.0.13, 00:01:15, Serial2/0O 192.168.0.4 [110/1562] via 192.168.0.13, 00:01:15, Serial2/0O 192.168.0.8 [110/1562] via 192.168.0.17, 00:01:15, Serial3/0C 192.168.0.12 is directly connected, Serial2/0C 192.168.0.16 is directly connected, Serial3/0Router#6.2查看OSPF邻居Router#show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface 192.168.0.13 1 FULL/- 00:00:39 192.168.0.13 Serial2/0 192.168.0.17 1 FULL/- 00:00:35 192.168.0.17 Serial3/0 Router#6.3查看OSPF数据Router#show ip ospf databaseOSPF Router with ID (192.168.0.18) (Process ID 1)Router Link States (Area 0)Link ID ADV Router Age Seq# Checksum Link count192.168.0.1 192.168.0.1 673 0x80000005 0x0082b6 3 192.168.0.9 192.168.0.9 317 0x80000004 0x004015 4 192.168.0.17 192.168.0.17 219 0x80000005 0x00dc82 5 192.168.0.13 192.168.0.13 214 0x80000006 0x00fbd0 6 192.168.0.18 192.168.0.18 200 0x80000005 0x0093be 5 7 测试OSPF收敛速度7.1在PC0上PC>tracert 172.17.0.2Tracing route to 172.17.0.2 over a maximum of 30 hops:1 6 ms 8 ms 7 ms 172.16.0.12 12 ms 11 ms 11 ms 192.168.0.23 13 ms 18 ms 15 ms 192.168.0.144 25 ms 28 ms 29 ms 172.17.0.2Trace complete.PC>可以看到数据包是通过Router2→Router0→Router37.2在Router3上Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#interface serial 2/0Router(config-if)#shutdown7.3在PC0上PC>tracert 172.17.0.2Tracing route to 172.17.0.2 over a maximum of 30 hops:1 9 ms 6 ms 7 ms 172.16.0.12 15 ms 11 ms 13 ms 192.168.0.23 14 ms 14 ms 16 ms 192.168.0.64 19 ms 22 ms 15 ms 192.168.0.105 26 ms 25 ms 29 ms 192.168.0.186 29 ms 30 ms 36 ms 172.17.0.2Trace complete.你可以看到数据包途径Router2→Router0→Router1→Router4→Router3。
安徽工业经济职业技术学院实验报告课程名:《网络互连技术与项目实践》题目:ofps 单区域配置实验姓名:yzzs班级:31715学号:1703012**一、实验目的掌握OSPF单区域配置二、实验设备PC(三台)、路由器(三台)、交叉线(三条)Dec串口线(两台)三、实验内容及步骤实验拓扑图首先我们为PC配饰IP地址和子网掩码和默认网关分别为PC1:10.10.10.1 255.255.255.0 10.10.10.254PC2:20.20.20.1 255.255.255.0 20.20.20.254PC3:50.50.50.1 255.255.255.0 50.50.50.254为方便实验我们将路由器的名称设为R1、R2、R3设置方法Continue with configuration dialog? [yes/no]: no Router>enable (进入特权视图)Router#config terminal (进入全局视图)Router(config)#hostname R1 (修改主机名)R1(config)#接下来配置路由器每个端口的IP地址R1(config)#interface f0/0(进入端口视图)R1(config-if)#ip address 10.10.10.254 255.255.255.0R1(config-if)#no shutdown (使配置生效)同理R1(config)#interface f0/1R1(config-if)#ip address 20.20.20.254 255.255.255.0 R1(config-if)#no shutdown (使配置生效)R1(config)#interface s1/1R1(config-if)#ip address 30.30.30.1 255.255.255.0R1(config-if)#no shutdown (使配置生效)R1(config-if)#clock rate 64000 ——配置时钟频率R1(config-if)#no shutdown同理其他两个路由器R2Continue with configuration dialog? [yes/no]: no Router>enable (进入特权视图)Router#config terminal (进入全局视图)Router(config)#hostname R2 (修改主机名)R2(config)#R2(config)#interface s1/0(进入端口视图)R2(config-if)#ip address 30.30.30.2 255.255.255.0R2(config-if)#clock rate 64000 ——配置时钟频率R2(config-if)#no shutdownR2(config-if)#no shutdown (使配置生效)R2(config)#interface s1/1R2(config-if)#ip address 40.40.40.1 255.255.255.0R2(config-if)#no shutdown (使配置生效)R3Continue with configuration dialog? [yes/no]: no Router>enable (进入特权视图)Router#config terminal (进入全局视图)Router(config)#hostname R3(修改主机名)R3(config)#R3(config)#interface s1/0(进入端口视图)R3(config-if)#ip address 40.40.40.2 255.255.255.0R3(config-if)#no shutdown (使配置生效)R3(config)#interface s1/1R3(config-if)#ip address 50.50.50.254 255.255.255.0R3(config-if)#no shutdown (使配置生效)R1配置:R1(config)#router ospf 1 ——配置OSPF协议R1(config-router)#network 10.10.10.0 0.0.0.255 area 1R1(config-router)#network 20.20.20.0 0.0.0.255 area 1R1(config-router)#network 30.30.30.0 0.0.0.255 area 1R2配置:R2(config)#router ospf 1R2(config-router)#network 30.30.30.00.0.0.255 area 1R2(config-router)#network 40.40.40.00.0.0.255 area 1R3配置:R2(config)#router ospf 1R2(config-router)#network 40.40.40.00.0.0.255 area 1R2(config-router)#network 50.50.50.00.0.0.255 area 1四、实验总结通过配置ospf协议,实现网络互连互通,减低了区域内每个路由器的压力。
OSPF动态路由配置一、实验名称:OSPF动态路由配置二、实验目的1、掌握OSPF动态路由的配置2、知道什么情况下适合使用OSPF动态路由三、网络拓朴四、实验设备1、四台路由器(每台配置4个以太网接口)2、四台安装有 windows 98/xp/2000操作系统的主机3、若干直连、交叉网线五、实验过程1、选择2811路由器2台。
每台添加WIC-1T模块一个。
2、将路由器、主机根据如上图示进行连接。
3、设置主机的IP地址、子网掩码和默认网关4、三层交换机S3560接口配置Switch>enSwitch#conf tSwitch(config)#hostname S3560Enter configuration commands, one per line. End with CNTL/Z.S3560(config)#vlan 10S3560(config-vlan)#exitS3560(config)#vlan 20S3560(config-vlan)#exitS3560(config)#int f0/10S3560(config-if)#switchport access vlan 10S3560(config-if)#exitS3560(config)#int f0/20S3560(config-if)#switchport access vlan 20S3560(config-if)#exitS3560(config)#ip routing //启用三层交换机路由功能S3560(config)#interface vlan 10S3560(config-if)#ip address 192.168.1.2 255.255.255.0 S3560(config-if)#no shutdownS3560(config-if)#exitS3560(config)#interface vlan 20S3560(config-if)#ip address 192.168.3.1 255.255.255.0 S3560(config-if)#no shutdownS3560(config-if)#exit5、路由器R1接口配置Router>enRouter#conf tRouter(config)#hostname R1R1(config)#interface f0/0R1(config-if)#ip address 192.168.3.2 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#interface s0/2/0R1(config-if)#clock rate 64000R1(config-if)#ip address 192.168.4.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exit6、路由器R2接口配置Router>enRouter#conf tRouter(config)#hostname R2R2(config)#interface f0/0R2(config-if)#ip address 192.168.2.1 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR2(config)#interface s0/2/0R2(config-if)#ip address 192.168.4.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exit7、三层交换机的OSPF的配置S3560(config)#router ospf 1 //启用OSPF协议S3560(config-router)#log-adjacency-changes //令可用来激活路由协议邻接关系变化日志的功能(例如ospf或者ISIS等)S3560(config-router)#network 192.168.1.0 0.0.0.255 area 0S3560(config-router)#network 192.168.3.0 0.0.0.255 area 08、路由器R1的RIP的配置R1(config)#router ospf 1 //启用OSPF协议R1(config-router)#log-adjacency-changes //令可用来激活路由协议邻接关系变化日志的功能(例如ospf或者ISIS等)R1(config-router)#network 192.168.3.0 0.0.0.255 area 0R1(config-router)#network 192.168.4.0 0.0.0.255 area 09、路由器R2的RIP的配置R2(config)#router ospf 1 //启用OSPF协议R2(config-router)#log-adjacency-changes //令可用来激活路由协议邻接关系变化日志的功能(例如ospf或者ISIS等)R2(config-router)#network 192.168.4.0 0.0.0.255 area 0R2(config-router)#network 192.168.2.0 0.0.0.255 area 010、查看三层交换机S3560路由表信息S3560#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.1.0/24 is directly connected, Vlan10O 192.168.2.0/24 [110/66] via 192.168.3.2, 00:04:35, Vlan20C 192.168.3.0/24 is directly connected, Vlan20O 192.168.4.0/24 [110/65] via 192.168.3.2, 00:04:35, Vlan2011、查看路由器R1路由表信息R1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setO 192.168.1.0/24 [110/2] via 192.168.3.1, 00:02:12, FastEthernet0/0O 192.168.2.0/24 [110/65] via 192.168.4.2, 00:15:39, Serial0/2/0C 192.168.3.0/24 is directly connected, FastEthernet0/0C 192.168.4.0/24 is directly connected, Serial0/2/012、查看路由器R2路由表信息R2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setO 192.168.1.0/24 [110/66] via 192.168.4.1, 00:02:40, Serial0/2/0C 192.168.2.0/24 is directly connected, FastEthernet0/0O 192.168.3.0/24 [110/65] via 192.168.4.1, 00:02:50, Serial0/2/0C 192.168.4.0/24 is directly connected, Serial0/2/013、其他查看配置信息命令Router#show ip route //查看路由器的路由表Router#show ip route rip //查看路由表中通过RIP路由协议学习到的路由Router#show ip protocol //查看路由器开启的路由协议Router#show ip ospf neighbor //查看与本路由器是“邻居”关系的路由器Router#show ip ospf interface //查看区域号和与此相关的信息Router#show ip ospf database //查看前路由器ospf的数据库信息Router#clear ip route * //清除路由表中通过路由协议学习到的路由14、进行主机间ping测试15、跟踪PC1 PC2的数据包转发过程PC> tracert 192.168.2.2。
一、实验目的本次实验旨在通过华为网络设备,掌握网络配置的基本技能,熟悉华为设备的配置界面和命令,并能够独立完成以下任务:1. 配置IP地址2. 宣告OSPF3. 引入默认路由4. 路由汇总5. 配置完全Stub区域6. 修改接口Cost实现合理分流,确保来回路径一致7. 修改网络类型,加快收敛8. 配置出口NAT,实现外网连通性9. 增强安全性二、实验环境1. 华为交换机:S5700-28P2. 华为路由器:AR22003. 实验软件:华为eNSP(企业网络仿真器)三、实验步骤1. 配置IP地址- 在交换机上配置VLAN,并为其分配Access接口。
- 为路由器接口配置IP地址。
2. 宣告OSPF- 在路由器上启用OSPF协议。
- 配置OSPF进程ID。
- 宣告OSPF网络。
3. 引入默认路由- 在路由器上配置默认路由,指向下一跳路由器。
4. 路由汇总- 配置路由汇总,减少路由表项。
5. 配置完全Stub区域- 在OSPF区域中配置完全Stub区域,禁止区域内的路由器学习其他区域的路由信息。
6. 修改接口Cost实现合理分流- 根据网络流量需求,修改接口Cost值,实现合理分流。
7. 修改网络类型,加快收敛- 根据网络需求,修改OSPF网络类型,加快收敛速度。
8. 配置出口NAT,实现外网连通性- 配置NAT地址转换,实现内网设备访问外网。
9. 增强安全性- 配置访问控制列表(ACL),限制对网络设备的访问。
- 配置IPsec VPN,保障数据传输安全。
四、实验结果与分析1. 成功配置了IP地址、OSPF、默认路由、路由汇总、完全Stub区域等。
2. 修改接口Cost值,实现了合理分流。
3. 修改网络类型,加快了收敛速度。
4. 配置出口NAT,实现了外网连通性。
5. 增强了网络设备的安全性。
五、实验总结通过本次实验,我们掌握了以下技能:1. 华为设备的配置界面和命令。
2. 网络配置的基本技能。
3. OSPF多区域配置的规划和实施。
OSPF综合实验一、实验拓扑图,如图1.1所示:图1.1 ospf综合实验拓扑图二、实验要求:1.要求全网互通2.R1、R5之间链路断开后,全网仍能互通3.R2永远为DR4.区域34为NSSA区域5.在区域0中仅出现2.2.0.0/22 的汇总路由6.除R3之外,所有路由仅有3.3.0.0/22的路由7.区域0中所有接口及虚链路做密文认证,认证密钥为cisco8.在R5上产生默认路由三、实验配置:1.预配置://R1上的预配置R1(config)#int lo 0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config-if)#int s3/0R1(config-if)#ip add 123.0.0.1 255.255.255.0R1(config-if)#no shR1(config-if)#int s2/2R1(config-if)#ip add 15.0.0.1 255.255.255.0R1(config-if)#no sh//R2上的预配置R2(config)#int lo 0R2(config-if)#ip add 2.2.0.2 255.255.255.0 R2(config-if)#int lo 1R2(config-if)#ip add 2.2.1.2 255.255.255.0 R2(config-if)#int lo 2R2(config-if)#ip add 2.2.2.2 255.255.255.0 R2(config-if)#int lo 3R2(config-if)#ip add 2.2.3.2 255.255.255.0 R2(config-if)#int s3/0R2(config-if)#ip add 123.0.0.2 255.255.255.0 R2(config-if)#no shR2(config-if)#int f0/0R2(config-if)#ip add 25.0.0.2 255.255.255.0 R2(config-if)#no sh//R3上的预配置R3(config)#int lo 0R3(config-if)#ip add 3.3.0.3 255.255.255.0 R3(config-if)#int lo 1R3(config-if)#ip add 3.3.1.3 255.255.255.0 R3(config-if)#int lo 2R3(config-if)#ip add 3.3.2.3 255.255.255.0 R3(config-if)#int lo 3R3(config-if)#ip add 3.3.3.3 255.255.255.0 R3(config-if)#int s3/0R3(config-if)#ip add 123.0.0.3 255.255.255.0 R3(config-if)#no shR3(config-if)#int s2/2R3(config-if)#ip add 34.0.0.3 255.255.255.0 R3(config-if)#no sh//R4上的预配置R4(config)#int lo 0R4(config-if)#ip add 4.4.4.4 255.255.255.0 R4(config-if)#int f0/0R4(config-if)#ip add 25.0.0.4 255.255.255.0 R4(config-if)#no shR4(config-if)#int s2/1R4(config-if)#ip add 34.0.0.4 255.255.255.0 R4(config-if)#no sh//R5上的预配置R5(config)#int lo 0R5(config-if)#ip add 5.5.5.5 255.255.255.0 R5(config-if)#int lo 1R5(config-if)#ip add 10.0.0.1 255.255.255.0R5(config-if)#int f0/0R5(config-if)#ip add 25.0.0.5 255.255.255.0R5(config-if)#no shR5(config-if)#int s2/1R5(config-if)#ip add 15.0.0.5 255.255.255.0R5(config-if)#no sh2.各路由器的上的具体配置://R1上的具体配置R1(config)#interface Loopback0R1(config-if)# ip ospf authentication message-digest //启用链路MD5认证R1(config-if)# ip ospf message-digest-key 1 md5 cisco //配置key ID及密匙R1(config-if)#interface Serial2/2R1(config-if)# ip ospf authentication message-digestR1(config-if)# ip ospf message-digest-key 1 md5 ciscoR1(config-if)#interface Serial3/0R1(config-if)# encapsulation frame-relay //帧中继封装R1(config-if)# frame-relay map ip 123.0.0.2 102 broadcast //帧中继类型配置为广播R1(config-if)# no arp frame-relay //关闭ARPR1(config-if)# no frame-relay inverse-arp//关闭inverse-arpR1(config-if)# ip ospf network broadcast //配置OSPF网络位broadcastR1(config-if)# ip ospf priority 0 //S3/0的DR/BDR的选举权R1(config-if)#router ospf 1R1(config-router)# router-id 1.1.1.1R1(config-router)# area 123 range 2.2.0.0 255.255.252.0//配置虚链路且开启md5认证R1(config-router)#$irtual-link 2.2.2.2 message-digest-key 1 md5 ciscoR1(config-router)# network 1.1.1.1 0.0.0.0 area 0R1(config-router)# network 15.0.0.1 0.0.0.0 area 0R1(config-router)# network 123.0.0.1 0.0.0.0 area 123//R2上的具体配置R2(config-if)#interface Serial3/0R2(config-if)# encapsulation frame-relayR2(config-if)# ip ospf network broadcastR2(config-if)# ip ospf priority 10R2(config-if)# no arp frame-relayR2(config-if)# frame-relay map ip 123.0.0.1 201 broadcastR2(config-if)# frame-relay map ip 123.0.0.3 203 broadcastR2(config-if)# no frame-relay inverse-arpR2(config-if)#router ospf 1R2(config-router)# router-id 2.2.2.2R2(config-router)#$rtual-link 5.5.5.5 message-digest-key 1 md5 ciscoR2(config-router)# area 123 range 2.2.0.0 255.255.252.0//手动汇总R2(config-router)#$irtual-link 1.1.1.1 message-digest-key 1 md5 ciscoR2(config-router)# network 2.2.0.0 0.0.255.255 area 123R2(config-router)# network 25.0.0.2 0.0.0.0 area 25R2(config-router)# network 123.0.0.2 0.0.0.0 area 123//R3上的具体配置R3(config)#interface Serial3/0R3(config-if)# encapsulation frame-relayR3(config-if)# ip ospf network broadcastR3(config-if)# ip ospf priority 0R3(config-if)# no arp frame-relayR3(config-if)# frame-relay map ip 123.0.0.2 302 broadcastR3(config-if)# no frame-relay inverse-arpR3(config-if)#router eigrp 1R3(config-router)# network 3.3.0.0 0.0.255.255R3(config-router)# no auto-summaryR3(config-router)#router ospf 1R3(config-router)# router-id 3.3.3.3R3(config-router)# area 34 nssaR3(config-router)# summary-address 3.3.0.0 255.255.252.0//域间汇总R3(config-router)# redistribute eigrp 1 subnets //重分布eigrp路由进ospf R3(config-router)# network 34.0.0.3 0.0.0.0 area 34R3(config-router)# network 123.0.0.3 0.0.0.0 area 123//R4上的具体配置R4(config-router)#router rip//开启rip进程R4(config-router)# version 2R4(config-router)# network 4.0.0.0R4(config-if)#router ospf 1R4(config-router)# router-id 4.4.4.4R4(config-router)#$rtual-link 5.5.5.5 message-digest-key 1 md5 ciscoR4(config-router)# area 34 nssaR4(config-router)# redistribute rip subnets//重分布rip进ospfR4(config-router)# network 25.0.0.4 0.0.0.0 area 25R4(config-router)# network 34.0.0.4 0.0.0.0 area 34//R5上的具体配置R5(config)#interface Loopback0R5(config-if)# ip ospf authentication message-digestR5(config-if)# ip ospf message-digest-key 1 md5 ciscoR5(config-if)#interface Serial2/1R5(config-if)# ip ospf authentication message-digestR5(config-if)# ip ospf message-digest-key 1 md5 ciscoR5(config-if)#router ospf 1R5(config-router)# router-id 5.5.5.5R5(config-router)#$rtual-link 4.4.4.4 message-digest-key 1 md5 ciscoR5(config-router)#$rtual-link 2.2.2.2 message-digest-key 1 md5 ciscoR5(config-router)# network 5.5.5.5 0.0.0.0 area 0R5(config-router)# network 15.0.0.5 0.0.0.0 area 0R5(config-router)# network 25.0.0.5 0.0.0.0 area 25R5(config-router)# default-information originate always //产生默认路由四、实验调试:1.查看R1上的路由表R1(config-line)#do sh ip routCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 15.0.0.5 to network 0.0.0.034.0.0.0/24 is subnetted, 1 subnetsO IA 34.0.0.0 [110/129] via 15.0.0.5, 00:40:45, Serial2/21.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback02.0.0.0/8 is variably subnetted, 5 subnets, 2 masksO 2.2.2.2/32 [110/65] via 123.0.0.2, 00:40:45, Serial3/0O 2.2.0.0/22 is a summary, 00:40:45, Null0O 2.2.3.2/32 [110/65] via 123.0.0.2, 00:40:45, Serial3/0O 2.2.0.2/32 [110/65] via 123.0.0.2, 00:40:45, Serial3/0O 2.2.1.2/32 [110/65] via 123.0.0.2, 00:40:45, Serial3/03.0.0.0/22 is subnetted, 1 subnetsO E2 3.3.0.0 [110/20] via 123.0.0.3, 00:40:45, Serial3/04.0.0.0/24 is subnetted, 1 subnetsO E2 4.4.4.0 [110/20] via 15.0.0.5, 00:40:46, Serial2/25.0.0.0/32 is subnetted, 1 subnetsO 5.5.5.5 [110/65] via 15.0.0.5, 00:40:46, Serial2/225.0.0.0/24 is subnetted, 1 subnetsO IA 25.0.0.0 [110/65] via 123.0.0.2, 00:40:46, Serial3/0[110/65] via 15.0.0.5, 00:40:46, Serial2/2123.0.0.0/24 is subnetted, 1 subnetsC 123.0.0.0 is directly connected, Serial3/015.0.0.0/24 is subnetted, 1 subnetsC 15.0.0.0 is directly connected, Serial2/2O*E2 0.0.0.0/0 [110/1] via 15.0.0.5, 00:40:46, Serial2/2以上输出表明,R1上已经可以全网访问,收敛已完成。
竭诚为您提供优质文档/双击可除ospf实验心得篇一:ospF配置技巧实验报告-何荣贤集美大学计算机工程学院实验报告课程名称实验名称日期班级组号计算机网络实验7ospF配置技巧实验地点老师组长陆大0316耿少峰何荣贤20XX/6/5计算1013D一、学习目的完成本实验后,您将能够:?按照指定要求创建有效的VLsm设计?为接口分配适当的地址并记录下来?根据拓扑图完成网络电缆连接?删除路由器启动配置并将其重新加载到默认状态?在路由器上配置ospF及其它设置?配置并传播静态默认路由?检验ospF的运行情况?测试和检完全连通性?思考网络实施并整理成文档二、实验拓扑及场景场景在本实验练习中,将为您指定一个网络地址,您必须使用VLsm来为该网络划分子网,从而根据拓扑图完成网络地址分配。
将需要组合使用ospF路由和静态路由,以使网络中未直接连接的主机能相互通信。
在所有ospF配置中将使用0作为ospF区域ID,采用1作为进程ID。
任务1:为地址空间划分子网。
步骤1:检查网络要求。
具有下列网络地址要求:?必须为网络172.20.0.0/16划分子网,从而为LAn串行链路提供地址。
ohQLAn需要8000个地址obranch1LAn需要4000个地址obranch2LAn需要2000个地址o路由器之间的每条链路需要两个地址?代表路由器hQ和Isp之间链路的环回地址将使用网络10.10.10.0/30。
步骤2:创建网络设计时请考虑下列问题。
需要为网络172.20.0.0/16划分多少个子网?__6_____ 网络172.20.0.0/16总共需要提供多少个Ip地址?__14006______hQLAn子网将使用什么子网掩码?___/19_____此子网内可用的最大主机地址数是多少?__8192______branch1LAn子网将使用什么子网掩码?__/20______此子网内可用的最大主机地址数是多少?__4094______branch2LAn子网将使用什么子网掩码?__/21______此子网内可用的最大主机地址数是多少?__2046______这三台路由器间的链路将使用什么子网掩码?___/30_______________这些子网中的每个子网内可用的最大主机地址数是多少?___2_____步骤3:为拓扑图分配子网地址。
【网络拓扑结构图】【实验步骤】步骤1.(1)在GNS3中按照上图把网络拓扑图配置好(2)配置路由器模块右键点击路由器(west)图标,选中“配置”→“插槽”,进行如下图设置后,点击“OK”右键点击路由器(east)图标,选中“配置”→“插槽”,进行如下图设置后,点击“OK”右键点击路由器(R1)图标,选中“配置”→“插槽”,进行如下图设置后,点击“OK”右键点击路由器(R2)图标,选中“配置”→“插槽”,进行如下图设置后,点击“OK”(3)配置各PC机网络接口(PC1与PC2的配置方法一样,但是端口不一样)右键点击PC1图标,选中“配置”→“NIO UDP”,进行如下图设置后,点击“添加”后再点击“OK”。
(4)连接设备按下表把设备的端口连接好步骤2:(1)点击“开始”按钮,运行所有机器。
右键点击路由器(west)图标,选中“console”,等待路由器初始化后,开始进行如(2)查看配置好的路由器接口信息,显示如下图:(3)查看配置好的ospf步骤3:右键点击路由器(east)图标,选中“console”,等待路由器初始化后,开始进行如下配置:查看配置好的路由器接口信息,显示如下图:查看配置好的ospf 200信息,显示如下图:步骤4:右键点击路由器(R1)图标,选中“console”,等待路由器初始化后,开始进行如下配置:查看配置好的路由器接口信息,显示如下图:步骤5:右键点击路由器(R2)图标,选中“console”,等待路由器初始化后,开始进行如下配置:查看配置好的路由器接口信息,显示如下图:步骤6:检查路由器(R1)中的生成的路由信息,显示如下图:检查路由器(west)中的生成的路由信息,显示如下图:检查路由器(R2)中的生成的路由信息,,显示如下图:检查路由器(east)中的生成的路由信息.步骤7:通过VPCS虚拟机,为每个PC机配置IP地址和网关参数步骤8:检查主机间的通信,PC1和PC2可以互相ping通,显示如下图:用主机PC2 去ping各个网段,可以ping通,显示如下图:用路由器(R2)去ping各个网段也可以ping通,其他路由器同理。
1.实验目的1.掌握OSPF协议的基本原理和配置;2.熟悉DR的选举原理和配置;3.了解多区域OSPF的原理和配置;4.尝试根据协议原理设计实验过程;5.利用现有的链接完成图示的物理链接2.实验环境(软件条件、硬件条件等)3台MSR3040路由器、一台MSR5060路由器、3台S3610交换机、12台pc;3.实验原理与方法(架构图、流程图等)【OSPF协议】OSPF(Open Shortest Path First开放式最短路径优先)[1]是一个内部网关协议(Interior Gateway Protocol,简称IGP),用于在单一自治系统(autonomous system,AS)内决策路由。
OSPF路由协议是一种典型的链路状态(Link-state)的路由协议,一般用于同一个路由域内。
在这里,路由域是指一个自治系统(Autonomous System),即AS,它是指一组通过统一的路由政策或路由协议互相交换路由信息的网络。
在这个AS中,所有的OSPF路由器都维护一个相同的描述这个AS结构的数据库,该数据库中存放的是路由域中相应链路的状态信息,OSPF路由器正是通过这个数据库计算出其OSPF路由表的。
作为一种链路状态的路由协议,OSPF将链路状态广播数据包LSA(Link State Advertisement)传送给在某一区域内的所有路由器,这一点与距离矢量路由协议不同。
运行距离矢量路由协议的路由器是将部分或全部的路由表传递给与其相邻的路由器。
【OSPF邻居关系】邻接关系建立的4个阶段:1.邻居发现阶段2.双向通信阶段:Hello报文都列出了对方的RID,则BC完成.3.数据库同步阶段:4.完全邻接阶段: full adjacency邻居关系的建立和维持都是靠Hello包完成的,在一般的网络类型中,Hello包是每经过1个HelloInterval发送一次,有1个例外:在NBMA网络中,路由器每经过一个PollInterval 周期发送Hello包给状态为down的邻居(其他类型的网络是不会把Hello包发送给状态为down的路由器的).Cisco路由器上PollInterval默认60s Hello Packet以组播的方式发送给224.0.0.5,在NBMA类型,点到多点和虚链路类型网络,以单播发送给邻居路由器。
基本 OSPF 配置实验 在路由器 R1 上配置 OSPF R1(config)#router ospf 1 R1(config-router)#
R1(config-router)#network 172.16.1.16 0.0.0.15 area 0 R1(config-router)# network 192.168.10.0 0.0.0.3 area 0 R1(config-router)# network 192.168.10.4 0.0.0.3 area 0 R1(config-router)#end R2(config)#router ospf 1 R2(config-router)#
R2(config-router)#network 10.10.10.0 0.0.0.255 area 0 R2(config-router)#network 192.168.10.0 0.0.0.3
R2(config-router)#network 192.168.10.8 0.0.0.3 area 0 R2(config-router)#end
R3(config)#router ospf 1 R3(config-router)#network 172.16.1.32 0.0.0.7 area 0 R3(config-router)#network 192.168.10.4 0.0.0.3 area 0 R3(config-router)#network 192.168.10.8 0.0.0.3 area 0 R3(config-router)#end
R1(config)#interface loopback 0 R1(config-if)#ip address 10.1.1.1 255.255.255.255
R2(config)#interface loopback 0 R2(config-if)#ip address 10.2.2.2 255.255.255.255
R3(config)#interface loopback 0 R3(config-if)#ip address 10.3.3.3 255.255.255.255
R1(config)#router ospf 1 R1(config-router)#router-id 10.4.4.4
R1#(config-router)#end R1# clear ip ospf process Reset ALL OSPF processes?[no]:yes
使用 router-id 命令的 no 形式删除所配置的路由器 ID。 R1(config)#router ospf 1 R1(config-router)#router-id 10.4.4.4 Reload or use “clear ip ospf process” command, for this to take effect
使用 clear ip ospf process 命令重新启动 OSPF 进程。 重新启动 OSPF 进程会强制路由器使用 Loopback 0 接口上所配置的 IP 地址作为路由器 ID。 R1(config-router)#end R1# clear ip ospf process Reset ALL OSPF processes? [no]:yes
在路由器 R1 和 R2 上使用 bandwidth 命令将串行接口的带宽更改为实际带宽 64 kbps。 路由器 R1: R1(config)#interface serial0/0/0 R1(config-if)#bandwidth 64 R1(config-if)#interface serial0/0/1 路由器 R2: R2(config)#interface serial0/0/0 R2(config-if)#bandwidth 64 R2(config)#interface serial0/0/1 R2(config-if)#bandwidth 64
在路由器 R3 上使用 ip ospf cost 命令配置 OSPF 开销。 R3(config)#interface serial0/0/0 R3(config-if)#ip ospf cost 1562 R3(config-if)#interface serial0/0/1 R3(config-if)#ip ospf cost 1562
任务 10:重新分配 OSPF 默认路由 步骤 1:在路由器 R1 上配置一个环回接口,以模拟通向 ISP 的链路。 R1(config)#interface loopback1 R1(config-if)#ip address 172.30.1.1 255.255.255.252 步骤 2:在路由器 R1 上配置一条静态默认路由。 使用已配置的用于模拟通向 ISP 的链路的环回地址作为出口接口。 R1(config)#ip route 0.0.0.0 0.0.0.0 loopback1 R1(config)#
步骤 3:使用 default-information originate 命令将该静态路由包括在从路由器 R1 发出 的 OSPF 更新中。
R1(config)#router ospf 1 R1(config-router)#default-information originate
R1(config-router)# 任务 11:配置其它 OSPF 功能 步骤 1:使用 auto-cost reference-bandwidth 命令调整参考带宽值。 将参考带宽增大到 10000 以模拟 10GigE 的速度。在 OSPF 路由域内的所有路由器上配置此命令。
R1(config-router)#auto-cost reference-bandwidth 10000 R2(config-router)#auto-cost reference-bandwidth 10000 R3(config-router)#auto-cost reference-bandwidth 10000
步骤 2:在路由器 R1 上检查路由表以验证 OSPF 开销度量所发生的变化。 步骤 3:在 R1 上使用 show ip ospf neighbor 命令查看 Dead 间隔。 Dead 间隔正在从默认的 40 秒钟开始倒计时。
R1#show ip ospf neighbor 步骤 4:配置 OSPF Hello 间隔和 Dead 间隔。 可分别使用 ip ospf hello-interval 和 ip ospf dead-interval 接口命令手动修改 OSPF Hello 间隔和 Dead 间隔。在路由器 R1 的 Serial 0/0/0 接口上使用这些命令将 hello 间隔和 Dead 间隔分别更改为 5 秒和 20 秒。
R1(config)#interface serial0/0/0 R1(config-if)#ip ospf hello-interval 5 R1(config-if)#ip ospf dead-interval 20 R1(config-if)#
步骤 5:修改 Dead 计时器和 Hello 计时器。 在路由器 R2 的 Serial 0/0/0 接口上修改 Dead 计时器和 Hello 计时器,使其分别匹配 R1 的 Serial 0/0/0 接口上所配置的相应间隔。 R2(config)#interface serial0/0/0 R2(config-if)#ip ospf hello-interval 5 R2(config-if)#ip ospf dead-interval 20
R2(config-if)# 步骤 5:使用 show ip ospf interface serial0/0/0 命令验证是否已修改 Hello 计时器和 Dead 计时器。
R2#show ip ospf interface serial0/0/0 步骤 6:在 R1 上使用 show ip ospf neighbor 命令验证与 R2 的相邻关系是否已恢复。 请注意,Serial 0/0/0 接口的 Dead 间隔现在低得多了,因为它现在从 20 秒钟而非默认的 40 秒钟 开始倒计时。Serial 0/0/1 仍然使用默认计时器工作。
R1#show ip ospf neighbo 场景 B:在多路访问网络上配置 OSPF
任务 4:在 DR 路由器上配置 OSPF 步骤 1:在路由器 R3 上,在全局配置模式下使用 router ospf 命令启用 OSPF。 R3(config)#router ospf 1 R3(config-router)#network 192.168.1.0 0.0.0.255 area 0 R3(config-router)#end
任务 5:在 BDR 路由器上配置 OSPF 步骤 1:在路由器 R2 上,在全局配置模式下使用 router ospf 命令启用 OSPF。 R2(config)#router ospf 1 R2(config-router)#network 192.168.1.0 0.0.0.255 area 0 R2(config-router)#end
步骤 2:使用 show ip ospf interface 命令验证是否已正确配置 OSPF 以及 R2 是否为BDR。 R2#show ip ospf interface R2# 步骤 3:使用 show ip ospf neighbors 命令查看与该 OSPF 区域内的其它路由器相关的信息。
请注意,R3 为 DR。 R2#show ip ospf neighbor 任务 6:在 DRother 路由器上配置 OSPF
步骤 1:在路由器 R1 上,在全局配置模式下使用 router ospf 命令启用 OSPF。 R1(config)#router ospf 1 R1(config-router)#network 192.168.1.0 0.0.0.255 area 0 R1(config-router)#end
步骤 2:使用 show ip ospf interface 命令验证是否已正确配置 OSPF 以及 R1 是否为 DRother。
R1#show ip ospf interface 步骤 3:使用 show ip ospf neighbors 命令查看与该 OSPF 区域内的其它路由器相关的信息。