模式类型
-
switch>
用户模式 -
switch#
特权模式 -
switch(config)#
全局配置模式 -
switch(config-if)#
接口配置模式
基本命令
进入特权模式 enable(en)
switch>en
switch#
进入全局配置模式 configure terminal(conf t)
switch>en
switch#conf t
switch(config)#
交换机命名 hostname aptech2950 以aptech2950为例
switch>en
switch#con t
switch(config)#hostname aptch-2950
aptech-2950(config)#
配置使能口令
使能加密口令就是在进入特权模式时使用的密码
password
传输时是使用的明文,而secret
是用的密文
switch>enable
switch#configure terminal
switch(config)#hostname aptch-2950
aptech-2950(config)#en password cisco
设置虚拟局域网vlan 1 interface vlan 1
switch>en
switch#con t
switch(config)#hostname aptch2950
aptech2950(config)#interface vlan 1
aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip和子网掩码
aptech2950(conf-if)#no shut 是配置处于运行中
aptech2950(conf-if)#exit
aptech2950(conf)#ip default-gateway 192.168.3.1设置网关地址
进入交换机某一端口 interface fastehernet 0/1 以1端口为例
switch>enable
switch#conf t
switch(conf)#hostname aptch-2950
aptech-2950(conf)#interface fastehernet 0/1
aptech-2950(conf-if)#
查看命令 show
switch>en
switch#show version 察看系统中的所有版本信息
show interface vlan 1
查看交换机有关ip 协议的配置信息
show running-configure
查看交换机当前起作用的配置信息
show interface fastethernet 0/1
察看交换机1接口具体配置和统计信息
show mac-address-table
查看mac地址表
show mac-address-table aging-time
查看mac地址表自动老化时间
交换机恢复出厂默认恢复命令
switch>en
switch#erase startup-configure
switch#reload
双工模式设置
switch>en
switch#conf t
switch(config)#hostname aptch-2950
aptech-2950(config)#interface fastehernet 0/1 以1端口为例
aptech-2950(conf-if)#duplexfull/half/auto //有full , half, auto 三个可选项
cdp相关命令
switch>enable
switch#show cdp 查看设备的cdp全局配置信息
show cdpinterface fastethernet 0/1
查看1端口的cdp配置信息
show cdptraffic
查看有关cdp包的统计信息
show cdpnerghbors
列出与设备相连的cisco设备
网友评论