1、 基本模式
用户模式hostname>enable到特权模式
特权模式hostname#config terminal到全局配置模式
全局配置模式hostname(config)#interface fastethernet 0/端口 到接口模式
接口模式hostname(config-if)#exit 后退一级 
                          或end 返回用户模式
2、 配置的查看
hostname#show version 查看版本信息
hostname#show run 查看配置文件
hostname#show ip 查看IP配置信息
hostname#show interface 查看接口信息
hostname#show vtp 验证VTP配置
hostname#show mac-address-table 查看MAC地址与端口对应表
hostname#show trunk A|B 查一个主干
hostname#show vlan vlan-no 验证VLAN配置
hostname#show vlan-membership 验证VLAN成员信息
hostname#show cotroller int 显示接口的物理层信息
hostname#show flash 显示闪存信息及内容
hostname#show ip int brief 显示接口简要信息
hostname#show ip route 显示路由表信息
hostname#show user 显示进入的会话
hostname#show sessions 显示登出的会话
hostname#show line 显示终端(line)的配置信息
3、出厂默认恢复
hostname#erase startup-config 删除配置信息并恢复出厂配置状态
hostname#reload 成功清除配置信息后确认命令
4、保存配置信息
hostname#copy nvram tftp: 保存配置文件到TFTP
hostname#copy tftp : nvram 从TFTP配置文件到交换机
hostname#erase nvrame 删除配置文件
hostname#copy flash tftp 将IOS映象文件复制到TFTP服务器中
hostname#copy runnig-config startup-config 将配置文件从RAM中复制              到NVRAM中(覆盖)
5、 主机名设置
hostname(config)#hostname name
6、 配置密码
hostname(config)#enable password level 1 password 设置进入用户模式密码(cata1900)
hostname(config)#enable password level 15 password 设置进入特权模式密码(cata1900)
hostname(config)#enable secret password 设置特权加密口令为password
hostname(config)#enable password password 设置特权非加密口令为password
hostname(config)#line console 0 进入控制台
hostname(config-line)#login 允许登录
hostname(config-line)#password XXXX 设置登录口令为XXXX
hostname(config)#line vty 0 4 进入虚拟终端virtual tty(cata1900不用设置)
7、 IP地址设置
hostname(config)#ip address ip –address subnet-mask 只在1900下可直接在全局配置模式下设IP
hostname(config)#int vlan 1
hostname(config-if)#ip address ip-address subnet-mask 在3550中要到vlan子模式、或在接口模式下设管理IP
8、 缺省网关
hostname(config)#ip defaut-gateway ip-address
9、 接口配置
hostname(config)#int e0/n 进入接口配置模式
hostname(config-if)#duplex half / full 设置半双工、双工
hostname(config-if)#description message 接口描述信息
hostname(config-if)#trunk on/off 主干信息(只有百兆口才能配置)1900
hostname(config-if)#switchport mode trunk 3550switch或其它中高端
hostname(config-if)#no switchport 将一个二层端口转变成三层端口
hostname(config-if)#switchport 将一个三层端口转变成二层端口
注:通过no switchport 配置命令,就可以把3550中的二层端口变成和一般路由器的FE端口没什么区别,在里面,可以分配ip address 或者做访问列表的控制、QOS相关的配置等等,
hostname(config)#int range f number 进入一组接口
10、 配置VTP信息
hostname(config)#vtp domain name VTP域名
hostname(config)#vtp server/client/transparent 模式(服务器/客户端/透时域)
hostname(config)#vtp password secret VTP密码
hostname(config)#vtp pruning enable VTP剪除启动
hostname(config)#vtp trap enable VTP trap 启动
注:在3550等中高端交换机中也可在VLAN模式下进行以上配置
hostname#vlan database
hostname(vlan)#……
11、 VLAN配置
hostname(config)#valn vlan-number name vlan-name 创建VLAN
hostname(config-if)#vlan-member ship static vlan-number 端口分配给VLAN(1900SWITCH)
hostname(config-if)#switchport access vlan vlan-number 端口分配置给VLAN(3550及以上)
hostname(config-if)#switchport trunk encapsulation cisco|dot1 设置trunk封装
hostname(config-if)#switchport mode trunk 起主干
hostname(config-if)#no shutdown
注:在端口起trunk时,端口一定是个二层、并且不能设IP
当要挂一个控制访问列表时,一般都要挂在trunk口上
在创建VLAN时也可以VLAN模式下完成,
hostname#vlan database
hostname(vlan)#vlan vlan-number
hostname(vlan)#name name-vlan
12、 启动路由
hostname(config)#ip routing 可以配置静态或动态路由,跟路由器一样了