实验一


实验名称:交换机的配置模式的进入与退出


步骤1配置实验环境


首先打开Cisco Packet Tracer,进入软件后,购买一台交换机


步骤2:进入与退出配置模式


单击该交换机,进入配置界面,单击CLI进入命令行模式;


打一下回车,出现:


Switch>


这告诉我们现在是默认用户模式,且主机名为Switch


输入enable进入特权模式:


Switch>


Switch>enable


Switch#


在特权模式下输入configure terminal进入全局配置模式:


Switch>


Switch>enable


Switch#configure terminal


Enter configuration commands, one per line.  End with CNTL/Z.


Switch(config)#


这样我们就进入了全局配置模式了,那么是怎么退出的呢?输入exit


Switch(config)#exit


Switch#


%SYS-5-CONFIG_I: Configured from console by console



Switch#


这样就返回到了特权模式了。再次输入exit


Switch#exit



Switch con0 is now available



Press RETURN to get started.




Switch>


就回到了最初默认的用户模式。


实验二


实验名称:配置交换机的主机名


步骤1:准备


打开一个交换机,选择CLI进入命令行模式


步骤2:修改交换机的主机名


首先修改主机名需要进入到全局配置模式,在命令行输入enable 然后输入configure terminal


Switch>enable


Switch#configure terminal


Enter configuration commands, one per line.  End with CNTL/Z.


Switch(config)#


这样就进入了全局配置模式了


当前模式下输入hostname 名字


Switch(config)#hostname chenduo


chenduo(config)#


这样,交换机的主机名就改变了。


实验三


实验名称:配置交换机的管理IP


步骤1:准备


购买一台交换机,一台主机,将主机与交换机相连,并为主机配置一个IP


打开交换机,选择CLI进入命令行模式


步骤2:配置交换机IP


首先,配置交换机的IP需要进入全局配置模式,输入enable进入特权模式,输入onfigure terminal进入全局配置模式


Switch>enable


Switch #configure terminal


Enter configuration commands, one per line.  End with CNTL/Z.


Switch (config)#


在当前模式下输入interface vlan 1 进入valn管理界面输入ipaddress 192.168.1.254 255.255.255.0 就可以将IP地址设置为192.168.1.254 将自子网掩码设置为255.255.255.0输入no shutdown激活IP


Switch(config)#interface vlan 1


Switch(config-if)#ip address 192.168.1.254 255.255.255.0


Switch(config-if)#no shutdown



Switch(config-if)#


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



%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up


%IP-4-DUPADDR: Duplicate address 192.168.1.254 on Vlan1, sourced by 000C.CFAE.B09A


%IP-4-DUPADDR: Duplicate address 192.168.1.254 on Vlan1, sourced by 00E0.F79C.34B6



Switch(config-if)#


这样就给交换机配置好了一个IP,下面可以输入ping 192.168.1.1测试一下


Switch#ping 192.168.1.1



Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:


.!!!!


Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms


成功!


实验四


实验名称:查看交换机配置信息


首先,进入特权模式


在特权模式下输入 show running-config;


Switch>


Switch>enable


Switch#show running-config


Building configuration...



Current configuration : 1048 bytes


!


version 12.1


no service timestamps log datetime msec


no service timestamps debug datetime msec


no service password-encryption


!


hostname Switch


!


!


spanning-tree mode pvst


!


interface FastEthernet0/1


!


interface FastEthernet0/2


!


interface FastEthernet0/3


!


interface FastEthernet0/4


!


--More—


这样我们就可以查看交换机的配置信息了。


实验结果:本次实验学习到了很多交换机的基础知识,所学习的命令虽然看似简单,但个个重要,应该下去自己练习熟练了,不能找技巧。