一.实验目的:
1.掌握交换机基本配置的步骤和方法。
2.掌握查看和测试交换机基本配置的步骤和方法。
二.实验要点:
配置交换机的基本参数,检查交换机的基本参数配置。
三.实验设备:
交换机 Cisco Catalyst 2950-24 一台,带有网卡的工作站 PC 一台,控制台电缆一条,直连线一条。
四、实验环境
图15
实验中使用2950-24和2950T-24都能实现效果
五. 实验步骤
1.按图 15 连接交换机和工作站 PC。
2.配置交换机主机名(SwitchA)、加密使能密码(S1)、虚拟终端口令(S2)及超时时间(5分钟)、禁止名称解析服务。
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
switchA(config)#hostname SwitchA
SwitchA(config)#enable password s1
SwitchA(config)#line vty 0 4
SwitchA(config-line)#password s2
SwitchA(config-line)#login
SwitchA(config-line)#line con 0
SwitchA(config-line)#exec-time 5 0
SwitchA(config-line)#no ip domain-lookup
SwitchA(config)#
3.配置交换机管理 IP 地址(192.168.1.1)、子网掩码(255.255.255.0)、默认网关(192.168.1.254)。
SwitchA(config)#int vlan 1
SwitchA(config-if)#ip ad 192.168.1.1 255.255.255.0
SwitchA(config-if)#no sh
SwitchA(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
SwitchA(config-if)#exit
SwitchA(config)#ip default-gateway 192.168.1.254
SwitchA(config)#exit
4.配置交换机端口速度(100Mbps)、端口双工方式(半双工)。(这里配置全双工模式是无法实现端口能够ping通的)
什么是半双工,什么是全双工?它们之间有什么区别?
半双工(half-duplex)是指传输过程中同时只能向一个方向传输。一方的数据传输结束之后,另外一方再回应。也就是说同时只有一个节点能够传输,如果两个节点同时传输数据的话,网络中就会出现拥堵。 相信你能够理解,这种传输方式效率低,需要更多的时间,收发更多的数据。 老的网站都是用的半双工的节点,主要是因为受到网络媒介(同轴电缆)和硬件设备(hub)的限制。 全双工(full-duplex)是指两方能同时发送和接受数据。在这种情况下就没有拥堵的危险,数据的传输也就更快。
全双工 速率100M ,可以同时接收发送帧。配置duplex full
半双工 速率10M , 瞬时只能接收或者发送帧。配置duplex half
SwitchA#
%SYS-5-CONFIG_I: Configured from console by console
SwitchA#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SwitchA(config)#int f0/1
SwitchA(config-if)#speed 10
SwitchA(config-if)#duplex half
SwitchA(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
SwitchA(config-if)#exit
5.通过 Telnet 方式登录到交换机。
在 hostA 上 C:>telnet 192.168.1.1
PC>ping 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=0ms TTL=255
Reply from 192.168.1.1: bytes=32 time=1ms TTL=255
Reply from 192.168.1.1: bytes=32 time=0ms TTL=255
Reply from 192.