1、项目拓扑图

2、具体配置

2.1PC1配置

2.2PC2配置

2.3AR1配置

基础配置
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR1  //更改设备名称为AR1
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 192.168.10.254 24  //配置接口g0/0/1的IP地址为192.168.10.254 24
Oct 20 2022 23:02:14-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR1-GigabitEthernet0/0/1]dis this  //查询当前命令下的配置
[V200R003C00]
#
interface GigabitEthernet0/0/1
 ip address 192.168.10.254 255.255.255.0 
#
return

[AR1]ip route-static 192.168.20.0 255.255.255.0 192.168.12.2  
//设置静态路由,前面192.168.20.0 255.255.255.0是指你要到达的目标网络地址,后面的192.168.12.2是指你的下一跳地址
[AR1]dis this
[V200R003C00]
#
ip route-static 192.168.20.0 255.255.255.0 192.168.12.2
#
return
[AR1]
[AR1-GigabitEthernet0/0/0]ip address 192.168.12.1 24  //配置接口g0/0/0的IP地址为192.168.12.1 24
Oct 20 2022 23:03:39-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR1-GigabitEthernet0/0/0]dis this  //查询当前命令下的配置
[V200R003C00]
#
interface GigabitEthernet0/0/0
 ip address 192.168.12.1 255.255.255.0 
#
return
配置ssh服务
[AR1]user-interface vty 0 4   //进入vty视图
[AR1-ui-vty0-4]authentication-mode aaa	//指定验证模式为aaa
[AR1-ui-vty0-4]protocol inbound ssh  //绑定服务为ssh
[AR1-ui-vty0-4]quit

[AR1]aaa
[AR1-aaa]local-user cookie password cipher cookie@37 privilege level 15  //创建用户,分配权限
Info: Add a new user.
[AR1-aaa]local-user cookie service-type ssh  //绑定用户服务类型ssh
[AR1-aaa]quit

[AR1]stelnet server enable   //开启stelnet服务
Info: Succeeded in starting the STELNET server.
[AR1]ssh client first-time enable  //开启ssh服务

[AR1]rsa local-key-pair create   //创建本地密钥对
The key name will be: Host
% RSA keys defined for Host already exist.
Confirm to replace them? (y/n)[n]:y
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
       It will take a few minutes.
Input the bits in the modulus[default = 512]:512 
//如果RSA密钥已经存在,则系统将提示用户确认是否替换原有密钥。
执行此命令后,会提示您输入主机密钥的位数。服务器密钥对的位数与主机密钥对的位数至少相差128位。
服务器密钥对和主机密钥对的最小长度为512位,最大长度为2048位,缺省长度为2048位。
小于1024位的RSA密钥对不够安全,不推荐使用。//


Generating keys...
................++++++++++++
..............++++++++++++
.....++++++++
............................++++++++

2.4AR2配置

基础配置
<Huawei>system-view  //进入系统视图界面
Enter system view, return user view with Ctrl+Z.	
[Huawei]sysname AR2	
[AR2]interface GigabitEthernet 0/0/1	
[AR2-GigabitEthernet0/0/1]ip address 192.168.20.254 24
Oct 20 2022 23:08:28-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR2-GigabitEthernet0/0/1]dis this
[V200R003C00]
#
interface GigabitEthernet0/0/1
 ip address 192.168.20.254 255.255.255.0 
#
return
[AR2-GigabitEthernet0/0/1]

[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip address 192.168.12.2 24
Oct 20 2022 23:10:17-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR2-GigabitEthernet0/0/0]dis this
[V200R003C00]
#
interface GigabitEthernet0/0/0
 ip address 192.168.12.2 255.255.255.0 
#
return

[AR2]ip route-static 192.168.10.0 255.255.255.0 192.168.12.1
[AR2]dis this
[V200R003C00]
#
ip route-static 192.168.10.0 255.255.255.0 192.168.12.1
#
return
[AR2]
AR2后续操作参照AR1配置ssh服务

3、测试结果 

3.1PC之间通信正常

3.2AR1测试ssh服务正常

3.2AR2测试ssh服务正常

3.3AR1与AR2相互使用ssh服务正常

原文地址:http://www.cnblogs.com/colk/p/16812014.html

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长! 2. 分享目的仅供大家学习和交流,请务用于商业用途! 3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入! 4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解! 5. 如有链接无法下载、失效或广告,请联系管理员处理! 6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需! 7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员! 8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载 声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性