6.ospf单区域.doc_第1页
6.ospf单区域.doc_第2页
6.ospf单区域.doc_第3页
6.ospf单区域.doc_第4页
6.ospf单区域.doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

OSPF:Open Shortest Path First 开放最短路径优先协议拓扑图如下:(点对点多路访问型)接口连接:Router1 S0/0 Router2 S0/0 Router3 S0/1 Router2 S0/1 Router3 F1/0 Router2 F1/0路由器参考配置如下:路由器R1的配置:Router /用户模式Routerenable /从用户模式进入到特权模式Router#configure terminal /从特权模式进入到全局模式Router(config)#hostname R1 /给路由器从命名为R1R1(config)#no ip domain lookup /关闭域名查找R1(config)#line console 0 /进入控制口R1(config-line)#logging synchronous /光标跟随R1(config-line)#exec-timeout 0 0 /关闭延迟R1(config-line)#exitR1(config)#interface loopback 0 /配置回环接口的ip地址R1(config-if)#ip address R1(config-if)#interface s0/0 /配置串口的ip地址R1(config-if)#ip address R1(config-if)#no shutdown /激活物理接口R1(config-if)#endR1#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 routeGateway of last resort is not set /24 is subnetted, 1 subnetsC is directly connected, Loopback0C /24 is directly connected, Serial0/0R1#configure terminal /进入全局配置模式R1(config)#router ospf 1 /启用ospf协议加进程号(进程号可不同)R1(config-router)#network area 2 /宣告ip、反向掩码和区域号R1(config-router)#network area 2 /区域号要相同R1(config-router)#endR1#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 routeGateway of last resort is not set/110/65:管理距离110;成本(度量值)65 /24 is subnetted, 1 subnetsC is directly connected, Loopback0 /32 is subnetted, 1 subnetsO 110/65 via , 00:02:22, Serial0/0 /32 is subnetted, 1 subnetsO 110/129 via , 00:02:22, Serial0/0O /24 110/128 via , 00:02:22, Serial0/0C /24 is directly connected, Serial0/0O /24 110/128 via , 00:02:22, Serial0/0路由器R2的配置:(详细配置)Router /用户模式Routerenable /从用户模式进入到特权模式Router#configure terminal /从特权模式进入到全局模式Router(config)#hostname R2 /给路由器从命名为R2R2(config)#no ip domain lookup /关闭域名查找R2(config)#line console 0 /进入控制口R2(config-line)#logging synchronous /光标跟随R2(config-line)#exec-timeout 0 0 /关闭延迟R2(config-line)#exitR2(config)#interface loopback 0 /配置回环接口的ip地址R2(config-if)#ip address R2(config-if)#interface s0/0 /配置串口的ip地址R2(config-if)#ip address R2(config-if)#no shutdown R2(config-if)#interface s0/1 R2(config-if)#ip address R2(config-if)#no shutdown R2(config-if)#interface f1/0R2(config-if)#ip address R2(config-if)#no shutdown R2(config-if)#endR2#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 routeGateway of last resort is not set /24 is subnetted, 1 subnetsC is directly connected, Loopback0C /24 is directly connected, Serial0/0C /24 is directly connected, FastEthernet1/0R2#configure terminal /进入全局配置模式R2(config)#router ospf 2 /启用ospf协议加进程号(进程号可不同)R2(config-router)#network area 2R2(config-router)#network area 2R2(config-router)#network area 2R2(config-router)#network area 2R2(config-router)#endR2#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 routeGateway of last resort is not set/110/65:管理距离110;成本(度量值)65 /32 is subnetted, 1 subnetsO 110/65 via , 00:00:16, Serial0/0 /24 is subnetted, 1 subnetsC is directly connected, Loopback0 /32 is subnetted, 1 subnets /两条路只走以太口O 110/2 via , 00:00:16, FastEthernet1/0C /24 is directly connected, Serial0/1C /24 is directly connected, Serial0/0C /24 is directly connected, FastEthernet1/0R2#show ip protocols /查看使用的协议Routing Protocol is ospf 2 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID /路由ID号 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: area 2 area 2 area 2 area 2 Reference bandwidth unit is 100 mbps Routing Information Sources: Gateway Distance Last Update 110 00:02:21 110 00:02:21 Distance: (default is 110) /管理距离110R2#configure terminalR2(config)#router ospf 2R2(config-router)#router-id /修改路由的ID号为R2(config-router)#endR2#clear ip ospf process /清除ospf协议的进程Reset ALL OSPF processes? no: yR2#show ip protocols /查看使用的协议Routing Protocol is ospf 2 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID /修改后的路由ID号 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: area 2 area 2 area 2 area 2 Reference bandwidth unit is 100 mbps Routing Information Sources: Gateway Distance Last Update 110 00:02:20 110 00:02:20 Distance: (default is 110)R2#show ip ospf interface f1/0 /查看接口上的信息FastEthernet1/0 is up, line protocol is up Internet Address /24, Area 2 /成本为1 Process ID 2, Router ID , Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) , Interface address Backup Designated router (ID) , Interface address Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:03 Supports Link-local Signaling (LLS) Index 4/4, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 4 msec, maximum is 4 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor (Designated Router) Suppress hello for 0 neighbor(s)R2#show ip ospf interface s0/1 /查看接口上的信息Serial0/1 is up, line protocol is up Internet Address /24, Area 2 /成本为64 Process ID 2, Router ID , Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:09 Supports Link-local Signaling (LLS) Index 3/3, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor Suppress hello for 0 neighbor(s)R2#configure terminalR2(config)#interface f1/0 R2(config-if)#ip ospf cost 64 /修改路由的成本R2(config-if)#endR2#show ip ospf interface f1/0 /查看接口上的信息FastEthernet1/0 is up, line protocol is up Internet Address /24, Area 2 /修改后成本为64 Process ID 2, Router ID , Network Type BROADCAST, Cost: 64 Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) , Interface address Backup Designated router (ID) , Interface address Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:03 Supports Link-local Signaling (LLS) Index 4/4, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 4 msec, maximum is 4 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor (Designated Router) Suppress hello for 0 neighbor(s)R2#show ip routeCodes: 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 routeGateway of last resort is not set /32 is subnetted, 1 subnetsO 110/65 via , 00:00:14, Serial0/0 /24 is subnetted, 1 subnetsC is directly connected, Loopback0 /32 is subnetted, 1 subnets /两条路的成本相同后向个方向走O 110/65 via , 00:00:14, FastEthernet1/0 110/65 via , 00:00:14, Serial0/1C /24 is directly connected, Serial0/1C /24 is directly connected, Serial0/0C /24 is directly connected, FastEthernet1/0R2#show ip ospf neighbor /查看邻居的情况Neighbor ID Pri State Dead Time Address Interface 1 FULL/DR 00:00:30 FastEthernet1/0 0 FULL/ - 00:00:30 Serial0/ 0 FULL/ - 00:00:38 Serial0/0R2#show running-config /查看运行配置信息Building configuration.Current configuration : 1061 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R2 /路由器的名称为R2!boot-start-markerboot-end-marker!no aaa new-modelmemory-size iomem 5!ip cef!no ip domain lookup /关闭域名查找! !interface Loopback0 /回环接口的ip地址 ip address !interface Serial0/0 /串口的ip地址 ip address serial restart-delay 0!interface Serial0/1 ip address ip ospf cost 64 /成本为64 serial restart-delay 0!interface Serial0/2 no ip address shutdown serial restart-delay 0!interface Serial0/3 no ip address shutdown serial restart-delay 0!interface FastEthernet1/0 ip address ip ospf cost 64 /成本为64 duplex auto speed auto!router ospf 2 /使用ospf协议 router-id /路由ID为 log-adjacency-changes network area 2 /宣告ip地址 network area 2 network area 2 network area 2!ip http server!control-plane!line con 0 exec-timeout 0 0 logging synchronousline aux 0line vty 0 4!endR2#ping source /ping目标地址 原ip地址Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:Packet sent with a source address of !Success rate is 100 percent (5/5), round-trip min/avg/max = 48/92/152 msR2#路由器R3的配置:RouterRouterenableRouter#configure terminalRouter(config)#hostname R3R3(config)#no ip domain lookupR3(config)#line console 0R3(config-line)#logging synchronousR3(config-line)#exec-timeout 0 0R3(config-line)#exitR3(config)#interface loopback 0R3(config-if)#ip address R3(config)#interface s0/1R3(config-if)#ip address R3(config-if)#no shutdown R3(config-if)#interface f1/0R3(config-if)#ip address R3(config-if)#no shutdownR3(config-if)#endR3#show ip routeCodes: 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 routeGateway of last resort is not set /24 is subnetted, 1 subnetsC is directly connected, Loopback0C /24 is directly connected, Serial0/1C /24 is directly connected, FastEthernet1/0R3#configure terminalR3(config)#router ospf 3R3(config-router)#network area 2R3(config-router)#network area 2R3(config-router)#network area 2R3(config-router)#endR3#show ip routeCodes: 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 routeGateway of last resort is not set /32 is subnetted, 1 subnetsO 110/66 via , 00:00:23, FastEthernet1/0 /32 is subnetted, 1 subnetsO 110/2 via , 00:00:23, FastEthernet1/0 /24 is subnetted, 1 subnetsC is directly connected, Loopback0C /24 is directly connected, Serial0/1O /24 110/65 via , 00:00:23, FastEthernet1/0C /24 is directly connected, FastEthernet1/0R3#configure terminalR3(config)#interface f1/0 /以太口的成本默认是1R3(config-if)#ip ospf cost 64/把以太口的成本改为64,和串口的默认成本64相同R3(config-if)#endR3#show ip routeCodes: C - connected, S - static,

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论