如 图 所示,主机Host通过SSH方式访问Router, Router的异步串口通过全反线连接目的设备的
Console口( AUX口)。现要求:在Router上配置重定向服务器功能,使得Host能够通过Telnet重定
向登录到目的设备。
(1) 配置接口地址,使 Host 到重定向服务器 Router 路由可达
# 为接口 GigabitEthernet0/0 配置 IP 地址。
<Router> system-view
[Router] interface gigabitethernet 0/0
[Router-GigabitEthernet0/0] ip address 192.168.100.67 24
[Router-GigabitEthernet0/0] quit
(2) 配置 Stelnet 服务器功能,使主机能够通过 Stelnet 方式访问重定向服务器 Router
# 生成 RSA 密钥对。
[Router] public-key local create rsa
The range of public key modulus is (512 ~ 2048).
If the key modulus is greater than 512, it will take a few minutes.
Press CTRL+C to abort.
Input the modulus length [default = 1024] :
Generating Keys...
.......................++++++
.....................................++++++
............++++++++
.................................++++++++
Create the key pair successfully.
# 生成 DSA 密钥对。
[Router] public-key local create dsa
The range of public key modulus is (512 ~ 2048).
If the key modulus is greater than 512, it will take a few minutes.
Press CTRL+C to abort.
Input the modulus length [default = 1024] :3
Generating Keys...
.++++++++++++++++++++++++++++++++++++++++++++++++++*
........+......+.....+......................................+..+................
.......+..........+..............+.............+...+.....+...............+..+...
...+.................+..........+...+....+.......+.....+............+.........+.
........................+........+..........+..............+.....+...+..........
..............+.........+..........+...........+........+....+..................
.....+++++++++++++++++++++++++++++++++++++++++++++++++++*
Create the key pair successfully.
# 使能 SSH 服务器功能。
[Router] ssh server enable
# 设置 Stelnet 客户端登录用户线的认证方式为 AAA 认证。
[Router] line vty 0 63
[Router-line-vty0-63] authentication-mode scheme
[Router-line-vty0-63] quit
# 创建设备管理类本地用户 sshuser,并设置密码为 admin,服务类型为 SSH,用户角色为
network-admin。
[Router] local-user sshuser class manage
[Router-luser-manage-sshuser] password simple admin
[Router-luser-manage-sshuser] service-type ssh
[Router-luser-manage-sshuser] authorization-attribute user-role network-admin
[Router-luser-manage-sshuser] quit
# 配置 SSH 用户 sshuser 的服务器类型为 Stelnet,认证方式为 password 认证(此步骤可选)。
[Router] ssh user sshuser service-type stelnet authentication-type password
(3) 配置异步串口的工作模式为流模式。(以异步串口 Async6/0 为例进行配置说明,对端的目的
设备为 Device A)
[Router] interface async 6/0
[Router-Async6/0] async-mode flow
[Router-Async6/0] quit
(4) 配置 TTY 用户线
# 查看重定向服务器的异步串口与 TTY 用户线的对应关系。
[Router] display user-interface
Idx Type Tx/Rx Modem Auth Int Location
48 TTY 49 57600 - N Ana3/0 0/0
96 TTY 97 9600 - N Asy6/0 0/0
97 TTY 98 9600 - N Asy6/1 0/0
98 TTY 99 9600 - N Asy6/2 0/0
99 TTY 100 9600 - N Asy6/3 0/0
100 TTY 101 9600 - N Asy6/4 0/0
101 TTY 102 9600 - N Asy6/5 0/0
102 TTY 103 9600 - N Asy6/6 0/0
103 TTY 104 9600 - N Asy6/7 0/0
104 TTY 105 9600 - N Asy6/8 0/0
105 TTY 106 9600 - N Asy6/9 0/0
106 TTY 107 9600 - N Asy6/10 0/04
……
查看到与异步串口 Async6/0 对应的 TTY 用户线为 TTY 97。因此,对于 Async6/0 要连接的目的设
备,需要配置 TTY 97。
# 使能 TTY 用户线的 Telnet 重定向功能。
[Router-line-tty97] line tty 97
[Router-line-tty97] redirect enable
# 设置 Telnet 重定向的监听端口号为 5097。
[Router-line-tty97] redirect listen-port 5097
# 设置 Telnet 重定向的空闲超时时间为 0,表示永不超时。
[Router-line-tty97] redirect timeout 0
[Router-line-tty97] quit
1、在同一时刻,同一目的设备仅允许一个用户通过重定向服务器进行登录。
2、在使用同/异步串口时,需配置其工作在异步模式下,并使用转接器连接到目的设备。
3、全反线是连接主机串口和设备 Console 口的终端线,线序一般为 568B,一端为 12345678,即橙白、橙、绿白、蓝、蓝白、绿、棕白、棕;另一端全反过来,为 87654321,即棕、棕白、绿、蓝白、蓝、绿白、橙、橙白。
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作