2024年4月3日发(作者:)

switch> 用户模式

1:进入特权模式 enable

switch> enable //进入特权模式

switch# //当前在特权模式中

2:进入全局配置模式 configure terminal

switch> enable //进入特权模式

switch#configure terminal //进入全局模式

switch(conf)# //当前全局模式

3:交换机命名 hostname aptech2950 //以aptech2950为例

switch> enable //进入特权模式

switch#configure terminal //进入全局模式

switch(conf)#hostname aptch-2950 //红色为主机名

aptech2950(conf)# //当前全局模式

4:配置使能口令 enable password cisco 以cisco为例

switch> enable //进入特权模式

switch#configure terminal //进入全局模式

aptech2950(conf)# enable password cisco //红色部分为密码

5:配置使能密码 enable secret ciscolab 密码以cicso01为例

switch> enable //进入特权模式

switch#configure terminal //进入全局模式

aptech2950(conf)# enable secret ciscol01 //红色部分为加密密码

6:设置交换机IP 地址

switch> enable //进入特权模式

switch#configure terminal //进入全局模式

aptech2950(conf)# interface vlan 1 //进入vlan1

aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 //配置交换机端口ip和子

网掩码

aptech2950(conf-if)#no shut //开启vlan1

aptech2950(conf-if)#exit

aptech2950(conf)#ip default-gateway 192.168.254 //设置网关地址

7:进入交换机某一端口,以7端口为例;

switch> enable //进入特权模式

switch#configure terminal //进入全局模式

aptech2950(conf)# interface fastehernet 0/7 //进入第7口

aptech2950(conf-if)#

8:查看命令 show

switch> enable //进入特权模式

switch# show version //察看系统版本信息

show interface vlan 1 //查看交换机有关vlan1的配置信息

show running-configure //查看交换机当前的配置信息

show interface fastethernet 0/1 //察看交换机1接口具体配置和统计信息

show mac-address-table //查看mac地址表

show mac-address-table aging-time //查看mac地址表自动老化时间

9:交换机恢复出厂默认恢复命令

switch> enable //进入特权模式

switch# erase startup-configure //出厂默认恢复命令 s

witch# reload //从新启动

10:双工模式设置

switch> enable //进入特权模式

switch#configure terminal //进入全局模式

switch(conf)# interface fastehernet 0/7 //以7口为例

Switch(conf)# duplex full/half/auto //有half:半双工,full:全双工,auto:自动

11:cdp相关命令

switch> enable

switch# show cdp 设备的cdp全局配置信息

show cdp interface fastethernet 0/17 查看17端口的cdp配置信息

show cdp traffic 查看有关cdp包的统计信息

show cdp nerghbors 列出与设备相连的cisco设备

12:csico2950的密码恢复

拔下交换机电源线。

用手按着交换机的MODE键,插上电源线

在switch:后执行flash_ini命令:switch: flash_ini

查看flash中的文件: switch: dir flash:

把“”文件改名为“”: switch: rename flash: flash:

执行boot:

switch: boot 交换机进入是否进入配置的对话,执行no :

进入特权模式察看flash里的文件: show flash :

把“”文件改名为 “”: switch: rename flash: flash:

把“”拷入系统的“running-configure”: copy flash: system :

running-configure

把配置模式重新设置密码存盘,密码恢复成功。

13:交换机telnet远程登录设置:

switch>en

switch#configure terminal

switch(conf)#hostname aptech-2950

aptech2950(conf)#enable password cisco 以cisco为特权模式密码

aptech2950(conf)#interface fastethernet 0/1 以17端口为telnet远程登录端口

aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0

aptech2950(conf-if)#no shut

aptech2950(conf-if)#exit aptech2950(conf)line vty 0 4 设置0-4 个用户可以telnet