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

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

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

课程名称:计算机网络工程年级:2013国培计算机班上机实践成绩:

指导教师:陆刚、强志成姓名:黄嘉懿创新实践成绩:

实验名称:三层交换机静态路由配置学号:50071200103 上机实践日期:2014-6-11

座位编号:3组号:4上机实践时间:学时

一、实验目的

1. 学会计算机和路由器、交换机的连接

2. 掌握IP地址的分配和划分子网的方法

3. 掌握路由器/交换机的命令行配置

二、实验设备

1. PC机4台

2. 3560三层交换机1台

3. 2811路由器1台

4. 平行双绞线4根、交叉双绞线1根

三、实验原理

网络拓扑图如下:

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

第 1 页共4 页

四、实验步骤

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

A:192.168.10.2 255.255.255.0 192.168.10.1

B:192.168.20.2 255.255.255.0 192.168.20.1

C:192.168.30.2 255.255.255.0 192.168.30.1

D:192.168.40.2 255.255.255.0 192.168.40.1

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

R(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1

3、配置三层交换机

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

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 页

相关文档
最新文档