路由交换机命令大全
交换机命令
switch
用户模式
1:进入特权模式e
able
switche
able
switch
2:进入全局配置模式co
figuretermi
al
switche
able
switch#co
figuretermi
al
switchco
f
3:交换机命名host
ameaptech2950
以aptech2950为例
switche
able
switch#co
figuretermi
al
switchco
fhost
ameaptch2950
aptech2950co
f
4:配置使能口令e
ablepasswordcisco
以cisco为例
switche
able
switch#co
figuretermi
al
switchco
fhost
ameaptch2950
aptech2950co
fe
ablepasswordcisco5:配置使能密码e
ablesecretciscolab
以cicsolab为
例
fswitche
ableswitch#co
figuretermi
al
switchco
fhost
ameaptch2950
aptech2950co
fe
ablesecretciscolab
6:设置虚拟局域网vla
1
i
terfacevla
1
switche
ableswitch#co
figuretermi
al
switchco
fhost
ameaptch2950
aptech2950co
fi
terfacevla
1
aptech2950co
fifipaddress192168112552552550配置交换机端口ip和子网掩码
aptech2950co
fif
oshut是配置处于运行中
aptech2950co
fifexit
aptech2950co
fipdefaultgateway192168254设置网关地址
7:进入交换机某一端口i
terfacefasteher
et017以17端口为例
switche
ableswitch#co
figuretermi
al
switchco
fhost
ameaptch2950
aptech2950co
fi
terfacefasteher
et017
faptech2950co
fif
8:查看命令show
switche
able
switchshowversio
察看系统中的所有版本信息
showi
terfacevla
1查看交换机有关ip协议的配置信息
showru
i
gco
figure查看交换机当前起作用的配置信息
showi
terfacefastether
et01统计信息
察看交换机1接口具体配置和
showmacaddresstable
查看mac地址表
showmacaddresstableagi
gtime查看mac地址表自动老
化时间
9:交换机恢复出厂默认恢复命令
switche
able
switcherasestartupco
figure
switchreload
10:双工模式设置
switche
able
switch#co
figuretermi
al
switch2950co
fhost
ameaptch2950
aptech2950co
fi
terfacefasteher
et017以17端口为例
aptech2950co
fifduplexfullhalfauto
f有fullhalfauto三个可选项
11:cdp相关命令
switche
able
switchshowcdp
查看设备的cdp全局配置信息
showcdpi
terfacefastether
et017
查看17端口的cdp配
置信息
showcdptrafficshowcdp
erghbors
查看有关cdp包的统计信息列出与设备相连的cisco设备
12:csico2950的密码恢复拔下交换机电源线。
用手按着交换机的MODE键,插上电源线在switch:后执行flash_i
i命令:switchflash_i
i
查看flash中的文件:switchdirflash把“co
figtext”文件改名为“co
figold”:switchre
ameflashco
f
igtextflashco
figold
执行boot:
switchboot
交换机进入是否进入配置的对话,执行
o:
进入特权模式察看flash里的文件:showflash
把r