一 CISCO 交换机和路由器根本配置交换机的配置1 用户模式switch > 2 进入特权模式switch > enable 3 进入全局配置模式,全局模式的配置对整个交换机生效.switch # config terminal switch (config)#4 进入接口模式,配置只对当前的接口生效switch(config) # interface f0/1 switch(config-if) #进入 line 模式,这个模式主要用来对控制台做相应的配置5 switch(config) # line console 0 switch(config-line)6 配置主机名switch(config) #hostname 主机名7 配置使能口令switch(config) # enable password 密码8 配置加密使能口令switch(config) # enable secret 密码9 配置 ip 地址switch(config) # interface vlan 1switch(config) # ip add ip 地址 子网掩码switch(config) # no shutdown10 配置交换机的网关switch(config) # ip default-gateway ip 地址11 保存配置switch # copy runing-config startup-configswitch # write12 清空配置switch # erase startup-config13 清空接口配置switch (config) # interface f0/1switch (config-if) # default interface f0/114 清空交换码(1) 关闭电源.(2) 开启电源, 并且按住交换机的 mode 键,当交换机进入................................................................ flash_init load_helper bootswitch:(3) 在 switch 后执行 flash_init 命令switch: flash-init(4) 在查看 flash 中的文件switch: dir flash:/(5) 把 config.text 文件后缀名改了就可以,并且重新启动.(交换机重启后不会在读取配置文件了)switch:rename flash:config.text config.oldswitch:boot(6) 启动后进入特权模式查看 flash 里面的文件,并且把 config.text 文件改回来.并且把 flash 里面的文件复制到存中switch # rename flash:config.old flash:config.textswitch # copy startup-config running-config15 创建 vlan 2switch (config) # vlan 216 删除 vlan 2switch (config) # no vlan 217 把端口 f0/5 到 10 添加到 vlan 2switch (config) # interface range f0/5 - 10switch (config) # switchport access vlan 218 将 f0/1 设置成中 trunkswitch (config) # interface f0/1switch (config) # switchport mode trunk19 将 f0/1 设置成...