当前位置:文档之家› 26.路由单区域OSPF协议的配置方法

26.路由单区域OSPF协议的配置方法

将路由器连接起来如下图:接下来是为路由器添加模块(注意要关电添加):下面配置路由器A的接口IP:Router#Router#configConfiguring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Router(config)#inRouter(config)#interface seRouter(config)#interface serial 1/1Router(config-if)#ip adRouter(config-if)#ip address 192.168.1.1 255.255.255.0 Router(config-if)#coRouter(config-if)#clRouter(config-if)#clock ?rate Configure serial interface clock speedRouter(config-if)#clock raRouter(config-if)#clock rate 64000Router(config-if)#no shRouter(config-if)#no shutdown%LINK-5-CHANGED: Interface Serial1/1, changed state to down Router(config-if)#%LINK-5-CHANGED: Interface Serial1/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up00:14:54: %OSPF-5-ADJCHG: Process 2, Nbr 10.10.11.1 on Serial1/1 from LOADING to FULL, Loading DoneRouter(config-if)#下面配置路由器B的接口IP:Router#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#inRouter(config)#interface se 1/0Router(config-if)#ip adRouter(config-if)#ip address 192.168.1.2 255.255.255.0Router(config-if)#no shRouter(config-if)#no shutdown%LINK-5-CHANGED: Interface Serial1/0, changed state to upRouter(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up01:07:29: %OSPF-5-ADJCHG: Process 2, Nbr 10.10.10.1 on Serial1/0 from LOADING to FULL, Loading DoneRouter(config-if)#接下来进行路由器A环回接口的配置:Router>enRouter#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#inRouter(config)#interface loRouter(config)#interface loopback ?<0-2147483647> Loopback interface numberRouter(config)#interface loopback 0%LINK-5-CHANGED: Interface Loopback0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to upRouter(config-if)#ip adRouter(config-if)#ip address 10.10.10.1 255.255.255.0Router(config-if)#下一步进行路由器B环回接口的配置:Router>enRouter#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#in lo 0%LINK-5-CHANGED: Interface Loopback0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up Router(config-if)#ip add 10.10.11.1 255.255.255.0Router(config-if)#验证路由器A的接口配置:Router#sh interfaces loopback 0Loopback0 is up, line protocol is up (connected)Hardware is LoopbackInternet address is 10.10.10.1/24MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation LOOPBACK, loopback not setLast input never, output never, output hang neverLast clearing of "show interface" counters neverQueueing strategy: fifoOutput queue 0/0, 0 drops; input queue 0/75, 0 drops5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec0 packets input, 0 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort0 input packets with dribble condition detected0 packets output, 0 bytes, 0 underruns0 output errors, 0 collisions, 0 interface resets0 babbles, 0 late collision, 0 deferred0 lost carrier, 0 no carrier0 output buffer failures, 0 output buffers swapped outRouter#验证路由器B的接口配置:Router#sh interfaces loopback 0Loopback0 is up, line protocol is up (connected)Hardware is LoopbackInternet address is 10.10.11.1/24MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation LOOPBACK, loopback not setLast input never, output never, output hang neverLast clearing of "show interface" counters neverQueueing strategy: fifoOutput queue 0/0, 0 drops; input queue 0/75, 0 drops5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec0 packets input, 0 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort0 input packets with dribble condition detected0 packets output, 0 bytes, 0 underruns0 output errors, 0 collisions, 0 interface resets0 babbles, 0 late collision, 0 deferred0 lost carrier, 0 no carrier0 output buffer failures, 0 output buffers swapped outRouter#继续进行路由器A的OSPF的配置:Router#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z. Router(config)#roRouter(config)#router osfRouter(config)#router osRouter(config)#router ospf ?<1-65535> Process IDRouter(config)#router ospf 2Router(config-router)#netRouter(config-router)#network 10.10.10.0 0.0.0.255 arRouter(config-router)#network 10.10.10.0 0.0.0.255 area 0Router(config-router)#network 192.168.1.0 0.0.0.255 area 0Router(config-router)#继续进行路由器B的OSPF的配置:Router#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z. Router(config)#roRouter(config)#router osRouter(config)#router ospf% Incomplete command.Router(config)#router ospf 2Router(config-router)#net 10.10.10.11 0.0.0.255 area 0Router(config-router)#net 192.168.1.0 0.0.0.255 area 0Router(config-router)#查看路由器A的路由表:Router#sh ip roCodes: 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 set10.0.0.0/24 is subnetted, 1 subnetsC 10.10.10.0 is directly connected, Loopback0C 192.168.1.0/24 is directly connected, Serial1/1Router#查看路由器B的路由表:Router#sh ip roCodes: 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 set10.0.0.0/8 is variably subnetted, 2 subnets, 2 masksO 10.10.10.1/32 [110/782] via 192.168.1.1, 00:04:25, Serial1/0 C 10.10.11.0/24 is directly connected, Loopback0C 192.168.1.0/24 is directly connected, Serial1/0路由器Aping路由器B:通。

相关主题