Telnet工作原理与配置

2024-08-12T09:45:00

一、远程登录管理协议:Telnet

  1. 要求IP可达+23端口开放
  2. 基于TCP

二、基于C/S架构

  1. C/S架构:客户端+服务器
  2. B/S架构:浏览器(即无需部署客户端)+服务器

1、Client上:

  • 仅需登录操作:
    telnet+服务器IP+23(尝试发起与服务器23端口建立远程登录连接)

2、Server服务器上:

  1. 开放telnet端口
  2. 配置aaa本地验证
  3. aaa视图下创建身份标识账号、密码、授权权限(账号访问的服务)
  4. 配置虚拟用户数量及虚拟用户的认证模式

三、实验:

1、实验一:

实验拓扑(一台路由器+一台交换机):

  1. 在R1上配置aaa远程登录服务,作为Server,R2作为Client,在R2上使用远程登录协议登录到R1上。
  2. R1与R2的Ethernet0/0/0接口都在同一网段10.0.0.0/24网段


R1上的配置:

<Huawei>system-view
//进入系统视图
[Huawei]undo info-center enable
//关闭消息中心提示
Info: Information center is disabled.
[Huawei]sysname R1
//修改设备名称为R1
[R1]telnet server enable
//开启远程登录端口,相当于开启23端口
Info: The Telnet server has been enabled.
[R1]interface Ethernet0/0/0
//进入Ethernet0/0/0接口
[R1-Ethernet0/0/0]ip address 10.0.0.1 24
//为接口添加上IP地址
//返回系统视图:输入quit
[R1]aaa
//配置aaa
[R1-aaa]local-user admin password cipher 123456 privilege level 3
//解释:创建一个本地认证的用户名为admin,密码为123456(cipher标识密文)的用户,给予其权限为3
//或者可以单独配置权限
//如:[R1-aaa]local-user admin privilege level 3
[R1-aaa]local-user admin service-type telnet 8021x
//在aaa视图下给予admin用户服务类型为telnet,并且指定为802.1x认证(基于端口的身份认证)
//使用quit命令退出
[R1]user-interface vty 0 4
//创建用户vty数量,同时登录用户数,最多5个用户同时登录(0-4)
[R1-ui-vty0-4]authentication-mode aaa
//设置认证模式为AAA

R2上的配置:

<Huawei>system-view 
[Huawei]un info-center enable 
[Huawei]sysname R2
[R2]interface Ethernet0/0/0
[R2-Ethernet0/0/0]ip address 10.0.0.2 24

实验验证:

  1. 查看是否有到R1的路由


  2. 使用telnet登录该设备
    注意:远程登录需在用户视图下
    <R2>telnet 10.0.0.1 23
    //指定服务telnet+serverIP+端口号
    Trying 10.0.0.1 ...
    Press CTRL+K to abort
    Connected to 10.0.0.1 ...
    
    Login authentication
    
    Username:admin
    Password:123456(不显示)
    Info: The max number of VTY users is 10, and the number
          of current VTY users on line is 1.
          The current login time is 2023-12-27 23:38:05.
    //显示提示信息标识登录成功,可以看到<R1>,R1设备被命名为R1
  3. 退出登录命令:Ctrl+]
    Info: The max number of VTY users is 10, and the number of current VTY users on line is 0.Info: The connection was closed by the remote host.
    //注销成功
  4. 查询到用户登录失败记录命令:
    display aaa online-fail-record all

     

 

2、实验二:

增加一台路由器,实现跨网段(基于路由可达+端口开放实现远程管理

实验图+配置(基本步骤省略):

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »