1.配置passwd方式登录交换机
switch(config)#enable secret ciscoswitch(config)#line vty 0 4switch(config-if)#passwd ciscoswitch(config-if)#login
2.配置username方式登录交换机
switch(config)#username gyop privilege 15 secret 1q2w3e4r
switch(config)#line vty 0 4
switch(config-if)#passwd cisco
switch(config-if)#login local
3.配置管理IP和网关
switch(config)#inter vlan 1switch(config-if)#ip address 192.168.2.5 255.255.255.0switch(config-if)# no shswitch(config-if)# endswitch(config)#ip default-gateway 192.168.2.254