实验报告三层交换机静态路由配置

更新时间:2023-12-09 08:47:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

华东师范大学计算机科学技术系实验报告

华东师范大学计算机科学技术系上机实践报告

课程名称:计算机网络工程 指导教师: 陆刚、强志成 座位编号:3 年级:2013国培计算机班 姓名:黄嘉懿 组号:4

上机实践成绩: 创新实践成绩:

上机实践日期:2014-6-11 上机实践时间: 学时

实验名称:三层交换机静态路由配置 学号:50071200103

一、

1. 2. 3.

实验目的

学会计算机和路由器、交换机的连接 掌握IP地址的分配和划分子网的方法 掌握路由器/交换机的命令行配置 实验设备 PC机4台

3560三层交换机1台 2811路由器1台

平行双绞线4根、交叉双绞线1根 实验原理

网络拓扑图如下:

二、

1. 2. 3. 4.

三、

通过路由器实现各不同Vlan之间的通信,路由器工作在OSI模型中的第三层,即网络层。路由器利用网络层定义的“逻辑”上的网络地址(即IP地址)来区别不同的网络,实现网络的互连和隔离,保持各个网络的独立性。路由器不转发广播消息,而把广播消息限制在各自的网络内部。发送到其他网络的数据先被送到路由器,再由路由器转发出去。同一个子网内的主机可以自由通信,不同子网间的主机不能直接通信。

第 1 页 共 4 页

第几次实验 实验名称 学号 姓名

四、

实验步骤 A:192.168.10.2 B:192.168.20.2 C:192.168.30.2 D:192.168.40.2 Router>en Router#conf t

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R R(config)#int f0/1 R(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up R(config-if)#ip addr 192.168.30.1 255.255.255.0 R(config-if)#exit R(config)#int f0/0 R(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R(config-if)#ip addr 10.0.0.2 255.255.255.0

255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0

192.168.10.1 192.168.20.1 192.168.30.1 192.168.40.1

1、配置各PC的IP地址和子网掩码及默认网关:

2、配置路由器

R(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1 Switch>en Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname Swi Swi(config)#vlan 10 Swi(config-vlan)#exit Swi(config)#vlan 20 Swi(config-vlan)#exit Swi(config)#vlan 30 Swi(config-vlan)#exit Swi(config)#int f0/10

Swi(config-if)#switchport mode access Swi(config-if)#switchport access vlan 10 Swi(config-if)#exit Swi(config)#int f0/20

Swi(config-if)#switchport mode access

3、配置三层交换机

华东师范大学计算机科学技术系实验报告

Swi(config-if)#switchport access vlan 20 Swi(config-if)#exit Swi(config)#int f0/15

Swi(config-if)#switchport mode access Swi(config-if)#switchport access vlan 30 Swi(config-if)#exit

Swi(config)#interface vlan 10

%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up Swi(config-if)#ip addr 192.168.10.1 255.255.255.0 Swi(config-if)#exit

Swi(config)#interface vlan 20

%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up Swi(config-if)#ip addr 192.168.20.1 255.255.255.0 Swi(config-if)#exit Swi(config)#int vlan 30

%LINK-5-CHANGED: Interface Vlan30, changed state to up Swi(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up ip addr 192.168.40.1 255.255.255.0 Swi(config-if)#exit Swi(config)#int f0/24 Swi(config-if)#no switchport

Swi(config-if)#ip addr 10.0.0.1 255.255.255.0 Swi(config-if)# no shutdown Swi(config-if)#exit

Swi(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.2 Swi(config)#ip routing

4、测试各个Vlan是否连通,结果如下:

(1)C PING A

PC>ping 192.168.10.2

Pinging 192.168.10.2 with 32 bytes of data: Request timed out.

Reply from 192.168.10.2: bytes=32 time=12ms TTL=126 Reply from 192.168.10.2: bytes=32 time=13ms TTL=126 Reply from 192.168.10.2: bytes=32 time=13ms TTL=126

第 3 页 共 4 页

第几次实验 实验名称 学号 姓名

Ping statistics for 192.168.10.2:

Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),

Approximate round trip times in milli-seconds: Minimum = 12ms, Maximum = 13ms, Average = 12ms (2)C PING B

PC>ping 192.168.20.2

Pinging 192.168.20.2 with 32 bytes of data: Reply from 192.168.20.2: bytes=32 time=13ms TTL=126 Reply from 192.168.20.2: bytes=32 time=9ms TTL=126 Reply from 192.168.20.2: bytes=32 time=13ms TTL=126 Reply from 192.168.20.2: bytes=32 time=11ms TTL=126 Ping statistics for 192.168.20.2:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 9ms, Maximum = 13ms, Average = 11ms (3)C PING D

PC>ping 192.168.40.2

Pinging 192.168.40.2 with 32 bytes of data: Reply from 192.168.40.2: bytes=32 time=13ms TTL=126 Reply from 192.168.40.2: bytes=32 time=12ms TTL=126 Reply from 192.168.40.2: bytes=32 time=10ms TTL=126 Reply from 192.168.40.2: bytes=32 time=12ms TTL=126 Ping statistics for 192.168.40.2:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 10ms, Maximum = 13ms, Average = 11ms 实验结果表明无论是否在同一Vlan中,都可以ping通。

五、

实验结果总结

1、 实现不同网络间主机的通信必须通过路由器才可以实现,其原理是路由器具有不同网络间的寻路

功能。

2、 在同一个子网内的交换机不需要进行配置,通过交换机可以实现同一个子网内的主机之间的通信。

思考问题:

1. 对配置命令的不熟悉

本文来源:https://www.bwwdw.com/article/rxy5.html

Top