1、在路由器上和交换机相连的借口上配置一个IP地址:比如192.168.1.1 24
2、在交换机上配置如下:<switch>system-view[switch]vlan 10[switch-vlan10]qu足毂忍珩it[switch]interface vlan 10[switch-vlanif 10]ip address 192.168.1.2 24 //保证和路由器的IP在同一网段[switch-vlanif 10]quit[switch]interface ethernet 0/0/1[switch-interface ethernet 0/0/1]port hybrid untagged vlan 10 //untag方式加入vlan10[switch-interface ethernet 0/0/1]quit//做完上述配置后,在路由器和交换机上192.168.1.1和192.168.1.2应该可以互相ping通。
3、然后茧盯璜阝就是在交换机上配置telnet登录命令:[switch]aaa[switch-aaa]local-user admin password simple ad罪焐芡拂min //2个admin分别是账号密码,可以自设[switch-aaa]local-user admin privilege level 3 //设置账号级别,3为最高级[switch-aaa]local-user service-type telnet //设置本地账号服务类型是telnet[switch-aaa]quit [switch]user-interface vty 0 4[switch-user-vty0-4]authentication-mode aaa //设置登录用户验证方式为aaa,在刚才设置账号那块设置了账号密码[switch-user-vty0-4]protocol bind all // 绑定用户协议为全部,包括telnet/ftp/ssh。就是这些方式登录交换机的时候都使用这个用户界面。[switch-user-vty0-4]quit