admin管理员组

文章数量:1532772

2024年5月14日发(作者:)

思科交换机的Line配置模式方法

你还在为不知道思科交换机的Line配置模式而烦恼么?接下来是小

编为大家收集的思科交换机的Line配置模式教程,希望能帮到大家。

思科交换机的Line配置模式的方法

在全局配置模式下,执行line vty或line console命令,将进入

Line配置模式。该模式主要用于对虚拟终端(vty)和控制台端口进行配

置,其配置主要是设置虚拟终端和控制台的用户级登录密码。

Line配置模式的命令行提示符为:student1(config-line)#

交换机有一个控制端口(console),其编号为0,通常利用该端口

进行本地登录,以实现对交换机的配置和管理。为安全起见,应为该

端口的登录设置密码,设置方法为:

student1#config terminal

student1(config)#line console 0

student1(config-line)#?

exit exit from line configuration mode

login Enable password checking

password Set a password

从帮助信息可知,设置控制台登录密码的命令是password,若要

启用密码检查,即让所设置的密码生效,则还应执行login命令。退出

line配置模式,执行exit命令。

下面设置控制台登录密码为654321,并启用该密码,则配置命令

为:

student1(config-line)#password 654321

student1(config-line)#login

student1(config-line)#end

student1#write

设置该密码后,以后利用控制台端口登录访问交换机时,就会首

先询问并要求输入该登录密码,密码校验成功后,才能进入到交换机

的用户EXEC模式。

交换机支持多个虚拟终端,一般为16个(0-15)。设置了密码的虚

拟终端,就允许登录,没有设置密码的,则不能登录。如果对0-4条

虚拟终端线路设置了登录密码,则交换机就允许同时有5个telnet登

录连接,其配置命令为:

student1(config)#line vty 0 4

student1(config-line)#password 123456

student1(config-line)#login

student1(config-line)#end

student1#write

若要设置不允许telnet登录,则取消对终端密码的设置即可,为

此可执行no password和no login来实现。

在Cisco iOS命令中,若要实现某条命令的相反功能,只需在该条

命令前面加no,并执行前缀有no的命令即可。

为了防止空闲的连接长时间的存在,通常还应给通过console口

的登录连接和通过vty线路的telnet登录连接,设置空闲超时的时间,

默认空闲超时的时间是10分钟。

设置空闲超时时间的配置命令为:exec-timeout 分钟数秒数

例如,要将vty 0-4线路和Console的空闲超时时间设置为3分

钟0秒,则配置命令为:

student1#config t

student1(config)#line vty 0 4

student1(config-line)#exec-timeout 3 0

student1(config-line)#line console 0

student1(config-line)#exec-timeout 3 0

student1(config-line)#end

student1#

交换机基本状态:

switch: ;ROM状态, 路由器是rommon>

本文标签: 配置交换机登录设置密码