文章一:

开启交换机telnet的命令步骤:

第一步:给telnet登陆配置密码:

Switch>
Switch>en 用户模式进入特权模式
Switch#conft 特权模式进入配置模式
Enter configuration commands, oneper line. End with CNTL/Z.
Switch(config)#lin
Switch(config)#line vt
Switch(config)#line vty 04 允许5个用户登陆
Switch(config-line)#passw
Switch(config-line)#password123456 设置telnet时的登陆密码
Switch(config-line)#login 使登陆密码生效
Switch(config-line)#^Z 退出到特权模式
%SYS-5-CONFIG_I: Configured from console by console
Switch#cop rs 保存配置文件
Destination filename [startup-config]?
Building configuration...
[OK] 保存成功

第二步:telnet密码虽然配置成功了,可是一想,IP还没配置啊,telnet登陆谁呢?~! 所以这个时候需要开启交换机的管理vlan,给管理vlan配置Ip,一般交换机都有初始的默认vlan1,用他来做管理vlan吧【说说管理vlan的作用:管理VLAN是指设备的IP地址所在的VLAN,主要用来远程连接这个设备进行管理使用 如果不配置这个,你将无法通过网络管理这台设备,业务VLAN就是普通的接台式机的VLAN,接业务使用...】,下面配置二层交换机的管理vlan的Ip:

test02# conft 特权模式进入配置模式
Enter configuration commands, oneper line. End with CNTL/Z.
test02(config)#int vlan1 进入vlan1虚拟口
test02(config-if)#ip add 10.1.1.1255.255.255.0 给vlan1设置IP地址
test02(config-if)#noshutdown 开启vlan1

%LINK-5-CHANGED: Interface Vlan1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changedstate to up
test02(config-if)#^Z 由配置模式推出到特权模式;
%SYS-5-CONFIG_I: Configured from console by console
test02#cop rs 保存配置文件;


第三步:现在看来telnet是有目标IP地址了,也有telnet登陆时候的密码了,但是我在telnet的时候虽然成功了,但是又出现了令一个问题,我无法由用户模式进入特权模式:

PC>telnet 10.1.1.1
Trying 10.1.1.1 ...


User Access Verification

Password: 此处输入设置的vty密码;
test02>en
% No password set
test02>en
% No password set
test02>? 查看可以使用的命令;
Exec commands:
<1-99> Session number to resume
connect Open a terminal connection
disconnect Disconnect anexisting network connection
enable Turn on privileged commands
exit Exit from the EXEC
logout Exit from the EXEC
ping Send echo messages
resume Resume an active network connection
show Show running system information
telnet Open a telnet connection
terminal Setterminal line parameters
traceroute Trace route todestination
test02>enable
% No password set


总是提示我没有设置密码;可见,通过telnet登陆交换机,还需要提高从用户模式到特权模式的密码,如果不设置密码,还是不能成功远程登陆一台交换机的。于是:

第四步:在交换机控制台设置从用户模式到特权模式的密码:

test02> en
test02#conf t
Enter configuration commands, oneper line. End with CNTL/Z.
test02(config)#ena
test02(config)#enable pas
test02(config)#enable password 234567
test02(config)#^Z
%SYS-5-CONFIG_I: Configured from console by console
test02#cop r s
Destination filename [startup-config]?
Building configuration...
[OK]

然后在从远端pc登陆交换机,操作步骤及其显示结果如下:

PC>telnet 10.1.1.1
Trying 10.1.1.1 ...


User Access Verification

Password: 输入最初设置的vty密码;
test02>en
Password: 输入从用户模式登陆到特权模式的密码;
test02#conft 显示登陆成功,输入命令,进入配置模式;
Enter configuration commands, oneper line. End with CNTL/Z.
test02(config)#

最后再多说几个知识点:

设置使用console线登陆的密码:

一.设置console密码
>enable
#configure trminal
(confing)#line console0 登陆进入console口
(config-line)#password (cisco 设置密码
(config-line)#login 这个一定不能少啊,console密码设置完成
(config-line)#exit 退出配置模式

#cop rs 保存配置文件;



文章二:


cisco交换机Telnet配置

switch>en ;第一次密码为空
switch#conf t ;进入全局配置模式
switch(config)#hostname swa ;设置交换机名
swa(config)#enable secret 456 ;设置特权加密口令为(即:从普通模式进入特权(en)模式的口令为:456)
swa(config)#enable password 789 ;设置特权非密口令为:789
swa(config)#line console 0 ;进入控制台口(Rs232)
swa(config-line)#password 999 ;设置登录口令为:999(即:登录到交换机的配置状态,就是普通用户模式啦)举个例子加入你现在在特权(en)模式想返回到普通模式下,呵呵是要输入这个密码的。
swa(config-line)#login ;登录要求口令验证
swa(config-line)#line vty 0 4 ;进入虚拟终端virtual tty
swa(config-line)#password 123 ;设置登录口令(即:从远程pc机Telnet到交换机时代登录口令为:123)
swa(config-line)#login ;登录要求口令验证
swa(config-line)#exit ;返回上一层
swa(config)#exit ;返回上一层
swa#sh run ;看配置信息
swa#exit ;返回命令

(注:1.蓝色字体的配置可以省略

2.另外:一般都是配enable secret 因为安全度高,如果你同时配了enable secret和enable password的时候,后者就失效了,登陆的时候,只需输入enable secret的密码即可。)

在配置之前要还要给交换机配置管理IP。配置如下

RA#
RA#conf t
RA(config)#interface vlan 1
RA(config-if)#ip address 192.168.2.100 255.255.255.0
RA(config-if)#no shutdown

%LINK-5-CHANGED: Interface Vlan1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
RA(config-if)#exit
RA(config)#exit
RA#