1、实验报告课程名称:计算机网络基础学 院:计算机科学与工程专 业:计算机科学与技术学生姓名:郭小明学 号:2011060100010实验成绩:日 期:2013 年 6 月 7 日电 子 科 技 大 学实 验 报 告实验一:交换机的基本配置 一、实验室:软件工程实验室 实验日期:6 月 7 日二、实验目的:掌握交换机命令行各种操作模式的区别,能够使用各种帮助信息,以及用命令进行基本的配置。3、实验原理:交换机的管理方式基本分为两种:带内管理和带外管理。通过交换机的 Console口管理交换机属于带外管理,不占用交换机的网络接口,其特点是需要使用配置线缆,近距离配置。第一次配置交换机时必须利用 Co
2、nsole 端口进行配置。交换机的命令行操作模式,主要包括:用户模式、特权模式、全局配置模式、端口模式等几种。四、实验器材:PC + Cisco Packet Tracer 5.3.1五、实验步骤:在模拟软件上建立交换机,然后进行配置操作。(1)进入特权模式,配置主机名和每日提示信息,依次执行下面的操作SwitchenableSwitch#configure terminalSwitch(config)#hostname 2011060100010-sw2011060100010-sw(config)#banner motd $Enter TEXT message. End with the
3、character $.Welcome to 2011060100010-sw. Please do your experiments follow your teachers advice.Thank you!$(2)配置接口状态(配置的是接口 5)2011060100010-swenable2011060100010-sw#configure terminalEnter configuration commands, one per line. End with CNTL/Z.2011060100010-sw(config-if)#interface fastEthernet 0/5201
4、1060100010-sw(config-if)#speed 102011060100010-sw(config-if)#duplex half2011060100010-sw(config-if)#no shutdown2011060100010-sw(config-if)#description “This is accessport,thank you“2011060100010-sw(config-if)#end(3)保存配置2011060100010-sw#copy running-config startup-config2011060100010-sw#write memory2
5、011060100010-sw#write六、实验数据及结果分析:(配置的是接口 5)2011060100010-sw#show running-configBuilding configuration.Current configuration : 1197 bytes!version 12.1no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname 2011060100010-sw!interface Fast
6、Ethernet0/1!interface FastEthernet0/2!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5description “This is accessport,thank you“duplex halfspeed 10!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEther
7、net0/10!interface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet
8、0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface GigabitEthernet1/1!interface GigabitEthernet1/2!interface Vlan1no ip addressshutdown!banner motd CWelcome to 2011060100010-sw. Please do your experiments follow your teachers advice.Thank you!C!line con 0
9、!line vty 0 4loginline vty 5 15login!end实验 2 跨交换机实现 VLAN 一、实验室名称: 软件工程实验室 实验时间: 6 月 7 日 二、实验目的:掌握如何在交换机上划分基于端口的 VLAN、如何给 VLAN 内添加端口,理解跨交换机之间 VLAN 的特点。三、实验原理:VLAN(Virtual Local Area Network,虚拟局域网)是指在一个物理网段内,进行逻辑的划分,划分成若干个虚拟局域网。VLAN 最大的特性是不受物理位置的限制,可以进行灵活的划分。VLAN 具备了一个物理网段所具备的特性。相同 VLAN 内的主机可以互相直接访问,不
10、同 VLAN 间的主机之间互相访问必须经由路由设备进行转发。广播数据包只可以在本 VLAN 内进行传播,不能传输到其他VLAN 中。四、实验内容:假设某企业有两个主要部门:销售部和技术部,其中销售部门的个人计算机系统连接在不同的交换机上,他们之间需要相互进行通信,但为了数据安全起见,销售部和技术部需要进行相互隔离,现要在交换机上做适当配置来实现这一目标。通过划分 Port VLAN 实现交换机的端口隔离,然后使在同一 VLAN 里的计算机系统能跨交换机进行相互通信,而在不同 VLAN 里的计算机系统不能进行相互通信。五、实验器材(设备、元器件):PC + Cisco Packet Tracer
11、 5.3.1六、实验步骤:第一步:配置两台交换机的主机名SwitchenableSwitch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname Two-SWTwo-SW(config)#SwitchenableSwitch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname Three-SWT
12、hree-SW(config)#第二步:在三层交换机上划分 VLAN 添加端口Three-SW(config)#vlan 9Three-SW(config-vlan)#name xiaoshouThree-SW(config)#vlan 19Three-SW(config-vlan)#name jishuThree-SW(config-vlan)#exitThree-SW(config)#interface range fastEthernet 0/5-9Three-SW(config-if-range)#switchport mode accessThree-SW(config-if-ran
13、ge)#switchport access vlan 9Three-SW(config-if-range)#exitThree-SW(config)#interface range fastEthernet 0/10-14Three-SW(config-if-range)#switchport mode accessThree-SW(config-if-range)#switchport access vlan 20% Access VLAN does not exist. Creating vlan 20Three-SW(config-if-range)#exitThree-SW(confi
14、g)#interface range fastEthernet 0/10-14Three-SW(config-if-range)#switchport mode access Three-SW(config-if-range)#switchport access vlan 19Three-SW(config-if-range)#exit第三步:在二层交换机上划分 VLAN 添加端口Two-SWenableTwo-SW#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Two-SW(conf
15、ig)#vlan 9 Two-SW(config-vlan)#name xiaoshouTwo-SW(config-vlan)#vlan 19 Two-SW(config-vlan)#name jishuTwo-SW(config-vlan)#exitTwo-SW(config)#interface range fastEthernet 0/5-9Two-SW(config-if-range)#switchport mode accessTwo-SW(config-if-range)#switchport access vlan 9Two-SW(config-if-range)#exit第四步
16、:设置交换机之间的链路为 TrunkThree-SW#enableThree-SW#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Three-SW(config)#interface fastEthernet 0/1Three-SW(config-if)#switchport trunk encapsulation dot1qThree-SW(config-if)#switchport mode trunkThree-SW(config-if)#exitTwo-SW#configure
17、 terminalEnter configuration commands, one per line. End with CNTL/Z.Two-SW(config)#interface fastEthernet 0/1Two-SW(config-if)#switchport mode trunkTwo-SW(config-if)#exitTwo-SW(config)#八、实验数据及结果分析:二层交换机的配置信息Two-SW#show running-configBuilding configuration.Current configuration : 1282 bytes!version
18、12.2no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Two-SW!interface FastEthernet0/1switchport mode trunk!interface FastEthernet0/2!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5switchport access v
19、lan 9switchport mode access!interface FastEthernet0/6switchport access vlan 9switchport mode access!interface FastEthernet0/7switchport access vlan 9switchport mode access!interface FastEthernet0/8switchport access vlan 9switchport mode access!interface FastEthernet0/9switchport access vlan 9switchp
20、ort mode access!interface FastEthernet0/10!interface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface Fast
21、Ethernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface GigabitEthernet1/1!interface GigabitEthernet1/2!interface Vlan1no ip addressshutdown!line con 0!line vty 0 4loginline vty 5 15login!End三层交换机的配置信息Three-SW#show running-co
22、nfigBuilding configuration.Current configuration : 1611 bytes!version 12.2no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Three-SW!interface FastEthernet0/1switchport trunk encapsulation dot1qswitchport mode trunk!interface Fast
23、Ethernet0/2!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5switchport access vlan 9switchport mode access!interface FastEthernet0/6switchport access vlan 9switchport mode access!interface FastEthernet0/7switchport access vlan 9switchport mode access!interface FastEthern
24、et0/8switchport access vlan 9switchport mode access!interface FastEthernet0/9switchport access vlan 9switchport mode access!interface FastEthernet0/10switchport access vlan 19switchport mode access!interface FastEthernet0/11switchport access vlan 19switchport mode access!interface FastEthernet0/12sw
25、itchport access vlan 19switchport mode access!interface FastEthernet0/13switchport access vlan 19switchport mode access!interface FastEthernet0/14switchport access vlan 19switchport mode access!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/1
26、8!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface GigabitEthernet0/1!interface GigabitEthernet0/2!interface Vlan1no ip addressshutdown!ip classless!line con 0line vty 0 4login!
27、Endping 的测试截图VLAN 9 之间的 PC 是能够 ping 通的VLAN 9 与 VLAN 19 是不能 ping 通的在将 VLAN 9 内的一台 PC 所接端口街道 VLAN 20 的端口后 不能 ping 通了实验 3 利用三层交换机实现 VLAN 间路由一、实验室名称:软件工程实验室 实验时间: 6 月 7 日二、实验目的:掌握如何在三层交换机上配置 SVI 端口,实现 VLAN 间的路由。3、实验原理:在交换网络中,通过 VLAN 对一个物理网络进行了逻辑划分,不同的 VLAN 之间是无法直接访问的,必须通过三层的路由设备进行连接。一般利用路由器或三层交换机来实现不同 V
28、LAN 之间的互相访问。三层交换机和路由器具备网络层的功能,能够根据数据的 IP 包头信息,进行选路和转发,从而实现不同网段之间的访问。4、实验内容:假设某企业有两个主要部门:销售部和技术部,其中销售部门的个人计算机系统分散连接在两台交换机上,他们之间需要相互进行通信,销售部和技术部也需要进行相互通信,现要在交换机上做适当配置来实现这一目标。需要在网络内所有的交换机上配置 VLAN,然后在三层交换机上给相应的 VLAN 设置 IP 地址,以实现 VLAN 间的路由。五、实验器材(设备、元器件):PC + Cisco Packet Tracer 5.3.16、实验步骤第一步:配置两台交换机的主机
29、名SwitchenableSwitch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname Second-SWSecond-SW(config)#Second-SW#SwitchenableSwitch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname Third_SWThird_SW(con
30、fig)#第二步:在三层交换机上划分 VLAN 添加端口,并设置 TrunkThird_SW(config)#vlan 10Third_SW(config-vlan)#name xiaoshouThird_SW(config-vlan)#vlan 20 Third_SW(config-vlan)#name jishuThird_SW(config-vlan)#exitThird_SW(config)#interface range fastEthernet 0/6-10Third_SW(config-if-range)#switchport mode accessThird_SW(config
31、-if-range)#switchport access vlan 10 Third_SW(config-if-range)#exitThird_SW(config)#interface range fastEthernet 0/11-15Third_SW(config-if-range)#switchport mode access Third_SW(config-if-range)#switchport access vlan 20Third_SW(config-if-range)#exitThird_SW(config)#interface fastEthernet 0/1Third_S
32、W(config-if)#switchport trunk encapsulation dot1qThird_SW(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upThird_SW(config-if)#exitThird_SW(config)
33、#第三步:在二层交换机上划分 VLAN 添加端口,并设置 TrunkSecond-SWSecond-SWenableSecond-SW#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Second-SW(config)#vlan 10Second-SW(config-vlan)#name xiaoshouSecond-SW(config-vlan)#vlan 20 Second-SW(config-vlan)#name jishuSecond-SW(config-vlan)#exitSe
34、cond-SW(config)#interface range fastEthernet 0/6-10Second-SW(config-if-range)#switchport mode accessSecond-SW(config-if-range)#switchport access vlan 10Second-SW(config-if-range)#exitSecond-SW(config)#interface fastEthernet 0/1Second-SW(config-if)#switchport mode trunkSecond-SW(config-if)#exitSecond
35、-SW(config)#第四步:在三层交换机上配置 SVI 端口Third_SW(config)#interface vlan 10%LINK-5-CHANGED: Interface Vlan10, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to upThird_SW(config-if)#ip address 192.168.10.10 255.255.255.0Third_SW(config-if)#no shutdownThird_SW(config-
36、if)#exitThird_SW(config)#interface vlan 20%LINK-5-CHANGED: Interface Vlan20, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to upThird_SW(config-if)#ip address 192.168.20.11 255.255.255.0Third_SW(config-if)#no shutdownThird_SW(config-if)#exitThird_SW(config)
37、#第五步:启动三层交换机路由转发Third_SW#configure terminal Enter configuration commands, one per line. End with CNTL/Z.Third_SW(config)#ip routing七、实验数据及结果分析:二层交换机的配置信息Second-SW#show running-configBuilding configuration.Current configuration : 1228 bytes!version 12.1no service timestamps log datetime msecno servic
38、e timestamps debug datetime msecno service password-encryption!hostname Second-SW!interface FastEthernet0/1switchport mode trunk!interface FastEthernet0/2!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6switchport access vlan 10switchport mode a
39、ccess!interface FastEthernet0/7switchport access vlan 10switchport mode access!interface FastEthernet0/8switchport access vlan 10switchport mode access!interface FastEthernet0/9switchport access vlan 10switchport mode access!interface FastEthernet0/10switchport access vlan 10switchport mode access!i
40、nterface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!inte
41、rface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface Vlan1no ip addressshutdown!line con 0!line vty 0 4loginline vty 5 15login!End三层交换机的配置信息Third_SW#show running-configBuilding configuration.Current configuration : 1616 bytes!version 12.2no service timestamps log da
42、tetime msecno service timestamps debug datetime msecno service password-encryption!hostname Third_SW!interface FastEthernet0/1switchport trunk encapsulation dot1qswitchport mode trunk!interface FastEthernet0/2!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface Fa
43、stEthernet0/6switchport access vlan 10switchport mode access!interface FastEthernet0/7switchport access vlan 10switchport mode access!interface FastEthernet0/8switchport access vlan 10switchport mode access!interface FastEthernet0/9switchport access vlan 10switchport mode access!interface FastEthern
44、et0/10switchport access vlan 10switchport mode access!interface FastEthernet0/11switchport access vlan 20switchport mode access!interface FastEthernet0/12switchport access vlan 20switchport mode access!interface FastEthernet0/13switchport access vlan 20switchport mode access!interface FastEthernet0/
45、14switchport access vlan 20switchport mode access!interface FastEthernet0/15switchport access vlan 20switchport mode access!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface Fast
46、Ethernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface GigabitEthernet0/1!interface GigabitEthernet0/2!interface Vlan1no ip addressshutdown!ip classless!line con 0line vty 0 4login!EndPing 测试截图在三层交换机上配置 SVI 端口之前,不同 VLAN 之间是不能 ping 通的在三层交换机上配置 SVI 端口之后, VLAN10 与 VLAN20 之间是可以 pin
47、g 通的实验 4 路由器的基本操作一、实验室名称: 软件工程实验室 实验时间: 6 月 7 日 二、实验目的:理解路由器的工作原理,掌握路由器的基本操作。三、实验原理:路由器的管理方式基本分为两种:带内管理和带外管理。通过路由器的 Console 口管理路由器属于带外管理,不占用路由器的网络接口,但特点是线缆特殊,需要近距离配置。第一次配置路由器时必须利用 Console 进行配置,使其支持 telnet 远程管理。路由器的命令行操作模式,主要包括:用户模式、特权模式、全局配置模式、端口模式等等几种。四、实验内容:你是某公司新进的网管,公司要求你熟悉网络产品,公司采用全系列锐捷网络产品,首先要
48、求你登录路由器,了解、掌握路由器的命令行操作,进行路由器设备名的配置,配置路由器登录时的描述信息,对路由器的端口配置基本的参数。将计算机的 Com 口和路由器的 Console 口通过 Console 线缆连接起来,使用 Windows 提供的超级终端工具进行连接,登录路由器的命令行界面进行配置。五、实验器材(设备、元器件):PC + Cisco Packet Tracer 5.3.1六、实验步骤:第一步:配置路由器的名称和每日提示信息Router#enableRouter#configure terminalEnter configuration commands, one per line
49、. End with CNTL/Z.Router(config)#hostname RouterguoRouterguo(config)#banner motd %Enter TEXT message. End with the character %.Welcome to Routerguo. if you are admin,you can config it.if you are not admin.pleast exit.and you can follow your teachers advice to do your experiment % 第二步:配置路由器的接口配置RouterguoenableRouterguo#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Routerguo(config)#interface fastEthernet 0/0Routerguo(config-if)#ip address 192.168.1.1 255.255.255.0Routerguo(config-if