admin管理员组

文章数量:1530057

给路由器配置IP

Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface GigabitEthernet0/0/1
Router(config-if)#ip address 10.1.1.254 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#

开启telnet配置登陆密码

Router#enable 
Router#conf te
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#line vty 0?
<0-15>  
Router(config)#line vty 0 3     #3表示3个用户可以同时登陆
Router(config-line)#pass
Router(config-line)#password 123456    #telnet密码
Router(config-line)#login       #允许登陆
Router(config-line)#exit
Router(config)#
Router(config)#enable password feifei    #特权模式密码
Router(config)#
Router(config)#exit 
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#write    #保存
Building configuration...
[OK]

验证telnet登陆,在PC1中


Packet Tracer PC Command Line 1.0
C:\>ping 10.1.1.254

Pinging 10.1.1.254 with 32 bytes of data:

Reply from 10.1.1.254: bytes=32 time<1ms TTL=255
Reply from 10.1.1.254: bytes=32 time<1ms TTL=255
Reply from 10.1.1.254: bytes=32 time<1ms TTL=255
Reply from 10.1.1.254: bytes=32 time<1ms TTL=255

Ping statistics for 10.1.1.254:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms


C:\>telnet 10.1.1.254
Trying 10.1.1.254 ...Open


User Access Verification

Password: 123456  #输入telnet密码
Router>
Router>
Router>en
Router>enable 
Password: feifei  #输入特权模式密码
Router#

开启ssh配置登陆密码


Router#enable 
Router#conf te
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#line vty 0?
<0-15>  
Router(config)#line vty 0 3     #3表示3个用户可以同时登陆
Router(config-line)#transport input ssh
Router(config-line)#password 123456    #telnet密码
Router(config-line)#login       #允许登陆
Router(config-line)#exit
Router(config)#
Router(config)#enable password feifei    #特权模式密码
Router(config)#
Router(config)#exit 

Router(config)#line vty 0 3
Router(config-line)#transport input ssh
Router(config-line)#exit


Router(config)#hos        
Router(config)#hostname R1     #给路由器配置名字
Router(config)#ip domain-name r1.pokes     #给路由器配置域名
R1(config)#crypto key generate rsa     #生成密钥
The name for the keys will be: R1.r1.pokes
Choose the size of the key modulus in the range of 360 to 2048 for your
  General Purpose Keys. Choosing a key modulus greater than 512 may take
  a few minutes.

How many bits in the modulus [512]: 回车
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]

验证telnet登陆,在PC1中

C:\>ssh
Packet Tracer PC SSH
Usage: SSH -l username target
C:\>ssh -l R1 10.1.1.254
Password: 123456  # ssh密码
R1>en
Password: feifei
R1#

本文标签: 思科路由器远程登陆telnetSSH