Try   HackMD

電腦網路實習LAB2

CNM不要再縮寫了,按個TAB行不行

這個實驗在幹嘛

這份實習文件是一個網絡設定的指南,涉及於設置路由器和網絡協議來建立一個互連的網絡。主要的步驟包括設定IP地址、啟用路由信息協議(RIP),設置靜態路由和默認路由,以及進行網絡連通性的測試。以下是各部分的詳細說明:

  1. 設定IP地址

    • 涉及四台路由器(標記為Router 0到Router 3),並為它們在不同的介面上配置不同的IP地址。
    • IP地址被設定以建立特定的子網,例如192.168.1.0、192.168.2.0、和192.168.3.0。
    • 每個路由器的配置都涉及進入命令行界面(CLI),進行必要的配置以設置IP地址並啟動介面。
  2. 設置RIP(路由信息協議)

    • 在Router 1和Router 2上啟用RIP。RIP是一種動態路由協議,用於在路由器之間自動交換路由信息。
    • 配置各路由器以宣告它們所連接的網絡,使得路由器能學習到達其他網絡的路由。
  3. 設置靜態路由

    • 在Router 0(即A路由器)設置靜態路由以達到192.168.2.0和192.168.3.0網絡。
    • 這允許從Router 0發起到達這些網絡的數據包有明確的路由路徑。
    • 進行ping操作來測試路由設置是否正確,即數據包能否成功到達目標網絡。
  4. 設置默認路由

    • 在Router 3(即D路由器)設置一個默認路由,使得所有不明確路由的流量都通過一個指定的路由。
    • 進行ping操作以測試Router 3是否能夠到達192.168.1.0網絡,這是測試默認路由是否正確設置的一種方法。

總之,這次實習的目的是通過具體的配置命令來教學生如何在實際環境中設定和管理路由器,理解動態和靜態路由如何工作,以及如何進行基本的網絡故障排查。这些技能是計算機網絡領域中的基本技能。

程式碼

1. Setup IP addresses on all routers. A-B 192.168.1.0, B-C: 192.168.2.0, C-D: 192.168.3.0

Go into router 0 and open CLI

​​​​Router>enable
​​​​Router#configure terminal
​​​​Router(config)#interface fa0/0
​​​​Router(config-if)#ip address 192.168.1.1 255.255.255.0	
​​​​Router(config-if)#no shutdown

exit router 0
Go into router 1 and open CLI

​​​​Router>enable
​​​​Router#congfigure terminal
​​​​Router(config)#interface fa0/0
​​​​Router(config-if)#ip addr 192.168.1.2 255.255.255.0
​​​​Router(config-if)#no sh	  
​​​​Router(config-if)#exit
​​​​Router(config)#interface fa0/1
​​​​Router(config-if)#ip addr 192.168.2.1 255.255.255.0
​​​​Router(config-if)#no sh

exit router 1
Go into router 2 and open CLI

​​​​Router>enable
​​​​Router#conf t    // congfigure terminal will work the same
​​​​Router(config)#interface fa0/0
​​​​Router(config-if)#ip addr 192.168.2.2 255.255.255.0
​​​​Router(config-if)#no sh	  
​​​​Router(config-if)#exit
​​​​Router(config)#interface fa0/1
​​​​Router(config-if)#ip addr 192.168.3.1 255.255.255.0
​​​​Router(config-if)#no sh

exit router 2
Go into router 3 and open CLI

​​​​Router>enable
​​​​Router#conf t    // congfigure terminal will work the same
​​​​Router(config)#interface fa0/0
​​​​Router(config-if)#ip addr 192.168.3.2 255.255.255.0
​​​​Router(config-if)#no sh	  

2. Setup RIP(Routing information Protocol) at Router 1 & 2.

go into router 1

​​​​Router(config)#router rip  // make sure it is Router(config)#
​​​​Router(config-router)#network 192.168.1.0
​​​​Router(config-router)#network 192.168.2.0
​​​​
​​​​check for setup ip
​​​​Router#sh ip ro  // R    192.168.3.0/24 [120/1] via 192.168.2.2, 00:00:25, FastEthernet0/1  will appear

go into router 2

​​​​Router(config)#router rip  // make sure it is Router(config)#
​​​​Router(config-router)#network 192.168.2.0
​​​​Router(config-router)#network 192.168.3.0
​​​​
​​​​check for setup ip
​​​​Router#sh ip ro  // R    192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:03, FastEthernet0/0  will appear

3. Setup a static route at A to 192.168.3.0, and ping it at A.

go into router 0

​​​​Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.1.2  // make sure its Router(config)#
​​​​Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.1.2
​​​​Router(config)#exit
​​​​Router#ping 192.168.3.0

4. Setup a default route at router D, ping 192.168.1.0 at D.

go into router 3

​​​​Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1
​​​​Router(config)#exit
​​​​Router#ping 192.168.1.0

BC看ip route
AD看ping