欢迎来到天天文库
浏览记录
ID:6133201
大小:66.50 KB
页数:12页
时间:2018-01-04
《思科交换机line配置模式》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、思科交换机Line配置模式在全局配置模式下,执行linevty或lineconsole命令,将进入Line配置模式。该模式主要用于对虚拟终端(vty)和控制台端口进行配置,其配置主要是设置虚拟终端和控制台的用户级登录密码。Line配置模式的命令行提示符为:student1(config-line)#交换机有一个控制端口(console),其编号为0,通常利用该端口进行本地登录,以实现对交换机的配置和管理。为安全起见,应为该端口的登录设置密码,设置方法为:student1#configterminalstudent1(config)#lineconsole0
2、student1(config-line)#?exit exitfromlineconfigurationmodelogin Enablepasswordcheckingpassword Setapassword从帮助信息可知,设置控制台登录密码的命令是password,若要启用密码检查,即让所设置的密码生效,则还应执行login命令。退出line配置模式,执行exit命令。下面设置控制台登录密码为654321,并启用该密码,则配置命令为:student1(config-line)#password 654321studen
3、t1(config-line)#loginstudent1(config-line)#endstudent1#write设置该密码后,以后利用控制台端口登录访问交换机时,就会首先询问并要求输入该登录密码,密码校验成功后,才能进入到交换机的用户EXEC模式。交换机支持多个虚拟终端,一般为16个(0-15)。设置了密码的虚拟终端,就允许登录,没有设置密码的,则不能登录。如果对0-4条虚拟终端线路设置了登录密码,则交换机就允许同时有5个telnet登录连接,其配置命令为:student1(config)#linevty04student1(config-line
4、)#password 123456student1(config-line)#loginstudent1(config-line)#endstudent1#write若要设置不允许telnet登录,则取消对终端密码的设置即可,为此可执行nopassword和nologin来实现。在CiscoIOS命令中,若要实现某条命令的相反功能,只需在该条命令前面加no,并执行前缀有no的命令即可。为了防止空闲的连接长时间的存在,通常还应给通过console口的登录连接和通过vty线路的telnet登录连接,设置空闲超时的时间,默认空闲超时的时间是10分钟。设置空闲超时
5、时间的配置命令为:exec-timeout分钟数秒数例如,要将vty0-4线路和Console的空闲超时时间设置为3分钟0秒,则配置命令为:student1#configtstudent1(config)#linevty04student1(config-line)#exec-timeout30student1(config-line)#lineconsole0student1(config-line)#exec-timeout30student1(config-line)#endstudent1#交换机基本状态:switch:;ROM状态,路由器是rom
6、mon>hostname>;用户模式hostname#;特权模式hostname(config)#;全局配置模式hostname(config-if)#;接口状态交换机口令设置:switch>enable;进入特权模式switch#configterminal;进入全局配置模式switch(config)#hostname;设置交换机的主机名switch(config)#enablesecretxxx;设置特权加密口令switch(config)#enablepasswordxxa;设置特权非密口令switch(config)#lineconsole0;进
7、入控制台口switch(config-line)#linevty04;进入虚拟终端switch(config-line)#login;允许登录switch(config-line)#passwordxx;设置登录口令xxswitch#exit;返回命令交换机VLAN设置:switch#vlandatabase;进入VLAN设置switch(vlan)#vlan2;建VLAN2switch(vlan)#novlan2;删vlan2switch(config)#intf0/1;进入端口1switch(config-if)#switchportaccessvla
8、n2;当前端口加入vlan2switch(config-if)#s
此文档下载收益归作者所有