计算机网络配置——路由器的配置
生活随笔
收集整理的這篇文章主要介紹了
计算机网络配置——路由器的配置
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
?一、實驗目的和任務
二、實驗原理介紹
重點:路由器和交換機的區(qū)別;
?? 路由器功能——實現(xiàn)網(wǎng)絡(luò)互連,包括存儲、轉(zhuǎn)發(fā)、尋徑;
1、路由器的工作過程
?
2、路由器的配置模式
?? 1)普通用戶模式;
?? 2)特權(quán)用戶模式;
?? 3)全局配置模式;
?? 4)接口配置模式;
?? 5)路由協(xié)議配置模式;
二、路由器的基本配置
實現(xiàn)如下圖所示的網(wǎng)絡(luò)拓撲配置:
三、設(shè)計代碼(或原理圖)、仿真波形及分析
網(wǎng)絡(luò)拓撲結(jié)構(gòu)如下圖所示:
PC0&PC1地址配置,網(wǎng)關(guān)配置如圖中標記所示R2配置如下:(有解釋)
Would you like to enter the initial configuration dialog? [yes/no]: nPress RETURN to get started!Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R2 //命名 R2(config)#int f0/0 //進入以太網(wǎng)接口 R2(config-if)#ip add 192.168.1.1 255.255.255.0 //給接口fa0/0設(shè)置網(wǎng)關(guān) 子網(wǎng)掩碼 R2(config-if)#no shutdown //激活接口R2(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upR2(config-if)#ex R2(config)#int s0/0/0 //串行接口 R2(config-if)#clock rate 64000 //設(shè)置波特率(路由器沒鎖定時可自由設(shè)置) This command applies only to DCE interfaces R2(config-if)#ip add 192.168.6.1 255.255.255.0 //給接口s0/0/0設(shè)置網(wǎng)關(guān) 子網(wǎng)掩碼 R2(config-if)#no shutdown%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down R2(config-if)#ex R2(config)#ip route 192.168.2.0 255.255.255.0 192.168.6.2 //設(shè)置靜態(tài)路由 R2(config)#end //配置結(jié)束 R2# %SYS-5-CONFIG_I: Configured from console by consoleR2#sh ip int brief //查看接口配置 Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.1 YES manual up up FastEthernet0/1 unassigned YES unset administratively down down Serial0/0/0 192.168.6.1 YES manual down down Serial0/0/1 unassigned YES unset administratively down down Vlan1 unassigned YES unset administratively down downR2#sh ip route Codes: 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, FastEthernet0/0//*******在配置R3時,R2會[自動]執(zhí)行下面部分指令*****// R2# R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#interface Serial0/0/0 R2(config-if)# R2(config-if)#exit R2(config)#interface FastEthernet0/1 R2(config-if)# R2(config-if)#exit R2(config)#interface Serial0/0/1 R2(config-if)# R2(config-if)#exit R2(config)#interface Serial0/0/0 R2(config-if)# %LINK-5-CHANGED: Interface Serial0/0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to upR2(config-if)#end R2(config-if)#end R2# %SYS-5-CONFIG_I: Configured from console by console//******配置完R3后,回到R2執(zhí)行下面命令,即可到靜態(tài)路由表*********// R2#sh ip route //查看路由表 Codes: 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, FastEthernet0/0 //前面地址為目的網(wǎng)絡(luò),后面Fa...為通往目的網(wǎng)絡(luò)的接口 S 192.168.2.0/24 [1/0] via 192.168.6.2 C 192.168.6.0/24 is directly connected, Serial0/0/0R2# //Codes表示路由項生成的方式,C表示直連路由;S表示靜態(tài)路由;R表示RIP協(xié)議生成;O表示OPSF協(xié)議生成。R2>en R2#sh int f0/0 //查看具體接口的信息 FastEthernet0/0 is up, line protocol is up (connected)Hardware is Lance, address is 0010.11e0.9d01 (bia 0010.11e0.9d01) //接口物理地址Internet address is 192.168.1.1/24 //接口IP地址MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, //BW為帶寬;DLY為延時reliability 255/255, txload 1/255, rxload 1/255Encapsulation ARPA, loopback not setFull-duplex, 100Mb/s, media type is RJ45ARP type: ARPA, ARP Timeout 04:00:00, Last input 00:00:08, output 00:00:05, output hang neverLast clearing of "show interface" counters neverInput queue: 0/75/0 (size/max/drops); Total output drops: 0Queueing strategy: fifoOutput queue :0/40 (size/max)5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 5 bits/sec, 0 packets/sec12 packets input, 1536 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 detected12 packets output, 1212 bytes, 0 underruns0 output errors, 0 collisions, 1 interface resets0 babbles, 0 late collision, 0 deferred0 lost carrier, 0 no carrier0 output buffer failures, 0 output buffers swapped outR3配置如下:(解釋類同R2)
Would you like to enter the initial configuration dialog? [yes/no]: nPress RETURN to get started!Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R2 R2(config)#hostname R3 R3(config)#int f0/0 R3(config-if)#ip addr 192.168.2.1 255.255.255.0 R3(config-if)#no shutdownR3(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upR3(config-if)#int s0/0/0 R3(config-if)#ip addr 192.168.6.2 255.255.255.0 R3(config-if)#no shutdownR3(config-if)# %LINK-5-CHANGED: Interface Serial0/0/0, changed state to upR3(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to upR3(config-if)#ex R3(config)#ip route 192.168.1.0 255.255.255.0 192.168.6.1 R3(config)#end R3# %SYS-5-CONFIG_I: Configured from console by consoleR3#sh ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.2.1 YES manual up up FastEthernet0/1 unassigned YES unset administratively down down Serial0/0/0 192.168.6.2 YES manual up up Serial0/0/1 unassigned YES unset administratively down down Vlan1 unassigned YES unset administratively down down R3#sh ip route Codes: 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 setS 192.168.1.0/24 [1/0] via 192.168.6.1 C 192.168.2.0/24 is directly connected, FastEthernet0/0 C 192.168.6.0/24 is directly connected, Serial0/0/0R3#PC0連接PC1:
PC1連接PC0:
四、實驗結(jié)論與心得
- 注意
由于新加入的路由器沒有串行接口,故需要手動添加,步驟如下:
1.先把路由器的電源關(guān)掉。
2.把物理串口拖動到路由器接口處。
3.啟動步驟1中的電源,然后進入CLI配置頁面,等待初始化完成,點擊確定即可。
- 路由器配置文件保存類似交換機,在這里不作介紹,可參考文章:計算機網(wǎng)絡(luò)配置——交換機的配置
總結(jié)
以上是生活随笔為你收集整理的计算机网络配置——路由器的配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python爬取知乎热榜了解时事
- 下一篇: 使用“已知明文攻击”破解加密