zoukankan      html  css  js  c++  java
  • Cisco 学会使用Telnet、SSH

    实验目的:通过控制R1 , TELNET R2(12.1.1.2),R3(13.1.1.3)R2,R3 进行远程管理.

    在R1 上配置:

    R1#telnet 12.1.1.2 //从R1 TELNET 到R2

    Trying 12.1.1.2 ... Open

    User Access Verification

    Password:

    R2>

    <Ctrl-Shift-6> + x 把界面切换回R1

    R1#telnet 13.1.1.3 //从R1 TELNET 到R3

    Trying 13.1.1.3 ... Open

    User Access Verification

    Password:

    R3>

    <Ctrl-Shift-6>x 把界面切换回R1

    R1#show sessions //在R1 上查看打开了多少个TELNET 会话

    Conn Host Address Byte Idle Conn Name

    1 12.1.1.2 12.1.1.2 0 0 12.1.1.2

    * 2 13.1.1.3 13.1.1.3 0 0 13.1.1.3

    R1#resume 2 //重新连接到R3

    [Resuming connection 2 to 13.1.1.3 ... ]

    R3>

    <Ctrl-Shift-6>x 切换回R1

    R1#

    R1#show session

    Conn Host Address Byte Idle Conn Name

    1 12.1.1.2 12.1.1.2 6 10 12.1.1.2

    * 2 13.1.1.3 13.1.1.3 0 0 13.1.1.3

    R1#disconnect 1 //从R1 是主动断开到R2 的连接(断开一个TELNET 的会话)

    Closing connection to 12.1.1.2 [confirm]

    在 R2 上实验:

    R2#show users //在R2 上查看有谁登录到R2 路由器

    Line User Host(s) Idle Location

    * 0 con 0 idle 00:00:00

    2 vty 0 idle 00:01:52 12.1.1.1

    Interface User Mode Idle Peer Address

    R2#clear line 2 //发现有人TELNET 过来,把连接清除

    [confirm]

    [OK]

    R2#show users

    Line User Host(s) Idle Location

    * 0 con 0 idle 00:00:00

    Interface User Mode Idle Peer Address

    提示:利用TELNET 来管理的几条命令的区别.

    show session //查看本路由器或是交换机主动打开了多少个telnet 的会话

    show user //查看本路由器或是交换机有谁telnet 进来,可以显示他的IP 地址

    Disconnect //在本路由器上主动断开本路由器所打开的telnet 会话

    Clear line //清除远端连接,发现有TELNET 的会话,把他清除

    Ctrl+shift+6 x //telnet 会话的切换

    Resume + 会话 ID //重新再次连接,先show session 查看会话ID

     

     

     

     

    使用SSH 远程控制远端设备,(包括路由器或是交换机或是防火墙等网络设备)。

    注:SSH 是基于TCP 协议上的,端口号为22

    配置步骤(SSH Server):

    1. Configure the IP domain name

    2. Generate the RSA keys

    3. Configure the SSH timeout interval <可选>

    4. Configure the SSH retries <可选>

    5. Disable vty inbound Telnet sessions

    6. Enable vty inbound SSH sessions

    例子:

    R1#configure terminal

    R1(config)#ip domain-name cisco.com

    R1(config)#crypto key generate rsa general-keys modulus 512

    R1(config)#ip ssh timeout 120

    R1(config)#ip ssh authentication-retries 4

    R(config)#username cisco password cisco

    R1(config)#line vty 0 4

    R1(config-line)#transport input none

    R1(config-line)#transport input ssh

    R1(config-line)#login local

    R1(config-line)#end

    配置步骤(SSH Client):

    以 secure CRT 为例:

     

    在提示中输入用户名 cisco 密码cisco 即可远程控制.

    注:用SSH 代替TELNET 的好处,SSH 的会话过程是加密的,而TELNET 的会话过程是明文

  • 相关阅读:
    Python的运算符
    RabbitMQ 的配置文件
    安装新版本的rabbitmq
    Ubuntu 16.04 安装rabbitmq
    Python Web 版本tailf, grep
    解决pycharm问题:module 'pip' has no attribute 'main'
    Python argparse
    Ansible 并行和异步
    cef相关
    浏览器透明设置例子,qt5.6才支持
  • 原文地址:https://www.cnblogs.com/fatt/p/4353747.html
Copyright © 2011-2022 走看看