網絡工程實驗4.3 交換機和路由器互聯設計

 

[實驗目的]
1.根據拓撲結構劃分子網並分配IP地址;
2.根據交換機和路由器的基本配置命令實現互連互通;
3.掌握靜態路由和動態路由的配置方法。
[實驗步驟]
1.打開Packet Tracer5.3窗口,按如下步驟拖動3臺Cisco2621路由器、2臺2960交換機和4臺主機到主窗口中。每臺路由器都增加一個“WIC-2T”模塊,構建圖10-74拓撲。
 

圖10-74 交換路由互連拓撲結構
2.按下表所示分配IP地址:

接口名稱
IP地址
接口名稱
IP地址
PC0
192.168.10.2
PC1
192.168.10.3
R0-fa0/0
192.168.10.1
R0-Se0/0
192.168.20.1
R1-Se0/1
192.168.20.2
R1-Se0/0
192.168.30.1
R2-Se0/1
192.168.30.2
R2-fa0/0
192.168.40.1
PC2
192.168.40.2
PC3
192.168.40.3
3.分別在四臺主機上配置IP地址和缺省網關,交換機不用配置。
4.查看設備類型,選擇R0,進入特權模式:
R0#show controller serial0/0
如果有“DCE V.35字樣,說明serial0/0是DCE(接口圖上有一個小鐘)。否則,就是DTE設備,如R1和R2的serial0/1。爲了通信同步,DCE需要配置時鐘頻率,DTE不需要。
5.配置三臺路由器接口的IP地址和時鐘等參數:
(1)配置路由器R0:
Router>en
Router#config t
Router(config)#hostname R0
R0(config)#int f0/0                              ;進入路由器接口
R0(config-if)#ip address 192.168.10.1 255.255.255.0   ;配置IP地址和掩碼
R0(config-if)#no shut                            ;啓用接口
R0(config-if)#int se0/0
R0(config-if)#ip address 192.168.20.1 255.255.255.0
R0(config-if)#clock rate 64000                     ;配置時鐘頻率爲64kbps
R0(config-if)#no shut
(2)配置路由器R1:
Router>en
Router#config t
Router(config)#hostname R1
R1(config)#int se0/1
R1(config-if)#ip address 192.168.20.2 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int se0/0
R1(config-if)#ip address 192.168.30.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shut
(3)配置路由器R2:
R2(config)#int f0/0
R2(config-if)#ip address 192.168.40.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int se0/1
R2(config-if)#ip address 192.168.30.2 255.255.255.0
R2(config-if)#no shut
6.在每一個路由器命令窗口中退出到特權模式下保存路由器和交換機配置。
R2#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
7.在“文件”菜單中選擇“保存”和“另存爲”分別將剛建立的拓撲文件保存爲lab10.2.pkt、lab10.2_static.pkt、lab10.2_rip.pkt和lab10.2_ospf.pkt等四個文件,分別實現三種不同的路由。
8.打開lab10.2_static.pkt文件,在全局配置模式下配置靜態路由。
命令格式爲:ip route 目的網絡 掩碼 下一跳|接口
(1)R0路由器:
R0>en
R0#config t
R0(config)#ip route 192.168.30.0 255.255.255.0 192.168.20.2 ;配置靜態路由
R0(config)#ip route 192.168.40.0 255.255.255.0 192.168.20.2 ;配置靜態路由
(2)R1路由器:
R1(config)#ip route 192.168.10.0 255.255.255.0 192.168.20.1 ;配置靜態路由
R1(config)#ip route 192.168.40.0 255.255.255.0 192.168.30.2 ;配置靜態路由
(3)R2路由器:
R2(config)#ip route 192.168.10.0 255.255.255.0 192.168.30.1 ;配置靜態路由
R2(config)#ip route 192.168.20.0 255.255.255.0 192.168.30.1 ;配置靜態路由
R2(config)#exit
R2#show ip route                   ;察看路由表項,顯示信息如下
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route
 
Gateway of last resort is not set
;已生成四條路由表,2條靜態路由,2條直連路由,每個子網1條
S    192.168.10.0/24 [1/0] via 192.168.30.1
S    192.168.20.0/24 [1/0] via 192.168.30.1
C    192.168.30.0/24 is directly connected, Serial0/1
C    192.168.40.0/24 is directly connected, FastEthernet0/0
9.測試所有主機之間的連通性,如果能從PC0 ping通所有主機,說明實驗成功。
10.打開lab10.2_rip.pkt文件,在全局配置模式下配置RIP協議動態路由。
(1)R0路由器:
R0(config)#router rip                                   ;啓用RIP路由協議
R0(config-router)#version 2                              ;版本號爲2
R0(config-router)#network 192.168.10.0                   ;添加直連網段
R0(config-router)#network 192.168.20.0                   ;添加直連網段
(2)R1路由器:
R1(config)#router rip                                   ;啓用RIP路由協議
R1(config-router)#version 2                              ;版本號爲2
R1(config-router)#network 192.168.20.0                   ;添加直連網段
R1(config-router)#network 192.168.30.0                   ;添加直連網段
(3)R2路由器:
R2(config)#router rip                                   ;啓用RIP路由協議
R2(config-router)#version 2                              ;版本號爲2
R2(config-router)#network 192.168.30.0                   ;添加直連網段
R2(config-router)#network 192.168.40.0                   ;添加直連網段
R2(config-router)#end                                  ;立即退出到特權模式
R2#show ip route                                      ;察看路由表
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route
 
Gateway of last resort is not set
;產生四個子網的路由表,其中2條爲直連路由,兩條爲RIP協議路由
R    192.168.10.0/24 [120/2] via 192.168.30.1, 00:00:09, Serial0/1
R    192.168.20.0/24 [120/1] via 192.168.30.1, 00:00:09, Serial0/1
C    192.168.30.0/24 is directly connected, Serial0/1
C    192.168.40.0/24 is directly connected, FastEthernet0/0
11.診斷RIP路由。在特權模式下輸入如下命令察看RIP協議的診斷信息。
R1#debug ip rip         ;顯示RIP路由選擇操作的信息
R1#debug ip routing      ;顯示路由表更新情況
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章