//新建VLAN[NB12]VLAN301//将1-24口加入VLAN 301[NB12-vlan301]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/24//配置虚拟VLAN[NB12]VLAN2000//为虚拟VLAN分配地址[NB12-vlan2000]ip address 172.50.20.239255.255.255.0//光口设置成Truck口[NB12]int GigabitEthernet 1/0/25[NB12-GigabitEthernet1/0/25]port link-type trunk
[NB12-GigabitEthernet1/0/25]port trunk permit vlan all
//配置交换机snmp协议,供zabbix连接使用[NB12]snmp-agent
[NB12]snmp-agent sys-info version all
3、交换机开启SSH登陆
//创建一个用户,用户名为wllt[NB12]local-user wllt
//为该用户配置密码,simple指定以明文方式配置密码,cipher指密文//遇到报错the new password is too short. It must contain at least 10 characters//密码长度不够导致,更改密码限制[NB12]password-control length 4[NB12-luser-manage-wllt]password simple admin@123411111111//设置该用户ssh服务类型[NB12-luser-manage-wllt]service-type ssh
//该用户的用户角色user-role为level-3,数值越小,用户的权限的级别越低[NB12-luser-manage-wllt]authorization-attribute user-role level-3[NB12-luser-manage-wllt]quit
//配置对ssh用户使用缺省的本地认证,进入vty0~63用户线,系统支持64个vty用户同时访问//vty口属于逻辑终端线,用户对设备进行telnet或ssh访问[NB12]user-interfacevty04//使用本地认证授权模式(认证模式为scheme)[NB12-line-vty0-4]authentication-mode scheme
//设置认证类型仅为ssh[NB12-line-vty0-4]protocol inbound ssh
[NB12-line-vty0-4]quit
//打开ssh服务[NB12]ssh server enable
[NB12]save
The current configuration will be written to the device. Are you sure?[Y/N]:
选择Y,确定将当前运行配置写进设备存储介质中。(To leave the existing filename unchanged, press the enter key):
直接回车
flash:/startup.cfg exists, overwrite?[Y/N]:
选择Y