实验一、交换机基本配置
1.交换机命令行操作模式的进入
Switch>enable //进入特权模式 Switch#
Switch#config t //进入全局配置模式 Switch(config) #
Switch(config)#int fa0/5 //进入交换机f0/5的端口模式 Switch(config-if)#
Switch(config-if)#exit //退回到上一级操作模式 Switch(config)#
Switch(config-if)#end //直接退回到特权模式 Switch# !
实验二、交换机的全局配置
2.交换机设备名称的配置 Switch>enable Switch#config t
Switch(config)#hostname 105_ Switch //配置交换机的设备名称为105_ Switch 105_Switch(config)#
3.交换机每日提示信息的配置
105_Switch(config)#banner motd //配置每日提示信息&为终止符 & //以&符号终止输入
验证测试
105_ Switch(config)#exit
105_ Switch#show run //显示交换机的全部配置
实验三、交换机端口基本配置
4.交换机端口参数的配置: Switch>enable Switch#config t
Switch(config)#int fa0/3 Switch(config-if)#speed 10 Switch(config-if)#duplex half Switch(config-if)#no shutdown
查看交换机端口的配置信息 Switch#show int fa0/3
实验四、查看交换机系统和配置信息
实验五、交换机端口隔离
5.在交换机上创建VLAN Switch#config t
Switch(config)#VLAN 10
Switch(config-VLAN)#name test10
验证测试
Switch#show VLAN
6.将交换机的端口分配到VLAN中 Switch#config t
Switch(config)#int fa0/5
Switch(config-if)# SwitchPort access VLAN 10 //将fa0/5端口加入VLAN 10中 验证
Switch#show VLAN ID 10
实验六、跨交换机实现VLAN
7.把交换机SwitchA与交换机SwitchB相连的端口(假设为0/24端口)定义为Tag VLAN模式 SwitchA(config)#int fa0/24
Switch(config-if)# SwitchPort mode TRUNK //将fa0/24端口设为Tag VLAN模式 验证
SwitchA#show int fa0/24 SwitchPort
实验七、端口集合提供荣誉备份链路
8.思科的端口聚合操作命令: Switch(config)#interface fa0/1
Switch(config-if)#speed 100 Switch(config-if)#duplex full Switch(config)#interface fa0/2
Switch(config-if)#speed 100 Switch(config-if)#duplex full
Switch(config)#interface range fa0/1 -2 -----------------range为同时配置二个以上的接口 Switch(config-if-range)#channel-group 1 mode desirable --封装为自动协商模式 Switch(config-if-range)#switchport mode trunk
Switch(config-if-range)#switchport trunk allowed vlan all-允许所以vlan通过
Switch(config)#interface fa0/3
Switch(config-if)#speed 100 Switch(config-if)#duplex full Switch(config)#interface fa0/4
Switch(config-if)#speed 100 Switch(config-if)#duplex full
Switch(config)#interface range fa0/3 -4 -----------------range为同时配置二个以上的接口 Switch(config-if-range)#channel-group 2 mode desirable --封装为自动协商模式 Switch(config-if-range)#switchport mode trunk
Switch(config-if-range)#switchport trunk allowed vlan all-允许所以vlan通过
注:
(2950交换机没有encapsulation加密,打en dot1q会出错 Switch(config-if-range)#switchport trunk encap ? % Unrecognized command)
使用的命令是:show etherchannel summary -------------看端口汇聚状态 SD表示关闭,SU表示打开
实验八、快速生成树配置 8.配置快速生成树协议
Switch(config)#spanning-tree //开启生成树协议
Switch(config)#spanning-tree mode rstp //指定生成树协议的类型为RSTP 验证
Switch#show spanning-tree
9.设置交换机的优先级,指定SwitchA为根交换机
SwitchA(config)#spanning-tree priority 4096 //设置交换机SwitchA的优先级为4096
验证SwitchA的优先级 SwitchA#show spanning-tree
路由器配置
1:配置路由器的全局参数
Router> //用户模式提示符 Router>enable //进入特权模式 Router# //特权模式提示符
router#config terminal //进入全局配置模式 router(config) # //全局配置模式提示符
router(config) #hostname R_A //配置路由器的名称为R_A
R_A (config) # banner motd #welcome# //配置路由器的登录提示信息为welcome
2:配置路由器的enable口令
R_A> //用户执行模式提示符 R_A>enable //进入特权模式 R_A# //特权模式提示符
R_A# configure terminal //进入全局配置模式 R_A(config)# //全局配置模式提示符
R_A(config)#enable password net //设置enable password 为net R_A(config)#enable secret student //设置enable secret 为student R_A(config)#exit //回到上一级模式 R_A # //特权模式提示符
R_A #show running-config //查看正在运行的配置文件,请注意“enable password”与“enable secret”在配置文件中的区别
R_A #copy running-config startup-config //把正在运行的配置文件备份到NVRAM中
3:配置路由器的控制终端密码
? 控制终端密码是用户通过交换机的console端口访问交换机时需要输入的密码。其配置过程如下: ? R_A> //用户执行模式提示符