一 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 键,当交换机进入