日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

计算机网络配置——路由器的配置

發布時間:2024/3/12 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 计算机网络配置——路由器的配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

?一、實驗目的和任務

  • 學習路由器的基本工作原理;
  • 進行路由器命令的操作練習;
  • 進行路由策略的設置。
  • 二、實驗原理介紹

    重點:路由器和交換機的區別;

    ?? 路由器功能——實現網絡互連,包括存儲、轉發、尋徑;

    1、路由器的工作過程

    ?

    2、路由器的配置模式

    ?? 1)普通用戶模式;

    ?? 2)特權用戶模式;

    ?? 3)全局配置模式;

    ?? 4)接口配置模式;

    ?? 5)路由協議配置模式;

    二、路由器的基本配置

    實現如下圖所示的網絡拓撲配置:

    三、設計代碼(或原理圖)、仿真波形及分析

    網絡拓撲結構如下圖所示:

    PC0&PC1地址配置,網關配置如圖中標記所示

    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 //進入以太網接口 R2(config-if)#ip add 192.168.1.1 255.255.255.0 //給接口fa0/0設置網關 子網掩碼 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 //設置波特率(路由器沒鎖定時可自由設置) This command applies only to DCE interfaces R2(config-if)#ip add 192.168.6.1 255.255.255.0 //給接口s0/0/0設置網關 子網掩碼 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 //設置靜態路由 R2(config)#end //配置結束 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會[自動]執行下面部分指令*****// 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執行下面命令,即可到靜態路由表*********// 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 //前面地址為目的網絡,后面Fa...為通往目的網絡的接口 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表示靜態路由;R表示RIP協議生成;O表示OPSF協議生成。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 out

    R3配置如下:(解釋類同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:

    四、實驗結論與心得

    • 注意

    由于新加入的路由器沒有串行接口,故需要手動添加,步驟如下:

    1.先把路由器的電源關掉。

    2.把物理串口拖動到路由器接口處。

    3.啟動步驟1中的電源,然后進入CLI配置頁面,等待初始化完成,點擊確定即可。

    • 路由器配置文件保存類似交換機,在這里不作介紹,可參考文章:計算機網絡配置——交換機的配置

    總結

    以上是生活随笔為你收集整理的计算机网络配置——路由器的配置的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。