分享

思科交换机密码设置

 大马赛克士革 2016-02-23

思科交换机密码设置

(2011-10-07 21:43:02)

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

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

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

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

test02#   conf t            特权模式进入配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
test02(config)#int vlan 1         进入vlan1虚拟口
test02(config-if)#ip add 10.1.1.1 255.255.255.0             给vlan1设置IP地址
test02(config-if)#no shutdown         开启vlan1

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

 

第三步:现在看来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 an existing 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    Set terminal line parameters
  traceroute  Trace route to destination
test02>enable
% No password set

 

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

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

test02> en
test02#conf t
Enter configuration commands, one per 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#conf t            显示登陆成功,输入命令,进入配置模式;
Enter configuration commands, one per line.  End with CNTL/Z.
test02(config)#

最后再多说几个知识点:

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

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

 #cop r s                   保存配置文件;  

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多