一、实战要求
1.在cisco2上设置特权密码和VTY 密码;
2.从cisco1上TELNET到cisco2;
3.在cisco2上查看已经TELNET到本设备上的其它用户
二、拓扑
三、配置
1.设置cisco2的特权密码和线路密码
cisco2(config)#enable secret cisco---------设置加密的特权密码
cisco2(config)#line vty 0 ?
<1-15> Last Line number//本地路由器最多可以创建0到15条线路,也就是说可以允许同时16个人登陆到这台路由器上
cisco2(config)#line vty 0 4
cisco2(config-line)#password cisco --------设置线路密码
cisco2(config-line)#exit
cisco2(config)#interface serial 0
cisco2(config-if)#ip address 192.168.12.2 255.255.255.0
cisco2(config-if)#clock rate 64000
cisco2(config-if)#no shutdown
2.设置cisco1的端口
Cisco1(config)#interface serial 0
Cisco1(config-if)#ip address 192.168.12.1 255.255.255.0
Cisco1(config-if)#no shutdown
3.验证
cisco1#telnet 192.168.12.2
Trying 192.168.12.2 ... Open
User Access Verification
Password: --------输入线路密码cisco
cisco2>enable
Password: --------输入特权密码cisco
cisco2#
查看当前正在使用的用户
cisco2#show users
Line User Host(s) Idle Location
0 con 0 idle 00:00:22
* 3 vty 0 idle 00:00:00 192.168.12.1
*-------------------------表示当前正在使用的线路
0-------------------------表示第一个VTY线路
192.168.12.1------------表示登陆端的IP地址
Interface User Mode Idle Peer Addr
4.login的使用
cisco2#show running-config
Building configuration...
line con 0
exec-timeout 0 0
transport preferred all
transport output all
line aux 0
transport preferred all
transport output all
line vty 0 4
password cisco
login
注:我们在对VTY线路操作的时候,并没有输入login,但是却发现系统自动加上了这条命令
cisco2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
cisco2(config)#line vty 0 4
cisco2(config-line)#no login--------------删去login,以研究它的作用
cisco2(config-line)#end
cisco2#quit-------------------退出telnet,也可以用exit
[Connection to 192.168.12.2 closed by foreign host]
cisco1#telnet 192.168.12.2
Trying 192.168.12.2 ... Open
cisco2>---------------我们发现,cisco1竟然直接登陆到cisco2上,而没有进行线路密码的检测!
由此得出结论,login的作用是对线路密码进行检测,如果去掉,则导致直接登陆到路由器上,而丧失了安全性。对于高版本的IOS,login这条命令可以自动加上,但是对于低版本的IOS却没有这个功能,所以,为了网络的安全性,我们最好手工输入login,以确保网络的安全性
以下是华为数通路由交换方向完整技术分享,欢迎对华为网络技术感兴趣的小伙伴们订阅。【可在专栏中进行查看订阅】
华为新版HCIP数通路由交换
华为新版HCIE数通路由交换