- [SW1]interface Vlanif 1 // 进入 vlan1 逻辑接口配置
- [SW1-Vlanif1]IP address 10.0.0.2 30 // 配置 IP 为 10.0.0.2/30
测试连通性:
- [SW1-Vlanif1]ping 10.0.0.1
- PING 10.0.0.1: 56 data bytes, press CTRL_C to break
- Reply from 10.0.0.1: bytes=56 Sequence=1 ttl=255 time=90 ms
2. 配置 AR1 的 SSH
- [AR1]aaa // 进入 aaa 配置模式
- [AR1-aaa]local-user zw password cipher 135113 privilege level 15 // 创建用户 zw, 密码为 135113, 权限级别为 15
- [AR1-aaa]local-user zw service-type SSH // 这个用户服务于 SSH
- [AR1]stelnet server enable // 开启 SSH 服务
- [AR1]SSH user zw authentication-type password // 配置 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 // 密钥名称为: 主机
% 为主机定义的 RSA 密钥已经存在.
确认更换?(是 / 否)[否]: 是
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]:768 // 设置公钥的大小, 最低为 768 位
- [AR1]user-interface vty 0 4 // 进入 vty 虚拟接口 0-4
- [AR1-ui-vty0-4]authentication-mode aaa // 配置登录方式为 aaa 模式
- [AR1-ui-vty0-4]protocol inbound SSH // 允许登录 SSH
3. 用 SW1 做客户端连接 AR1 的 SSH 服务
- [SW1]SSH client first-time enable // 第一次配置作为 SSH 客户端登录需要运行此命令
- [SW1]stelnet 10.0.0.1 // 连接到 AR1 的 SSH 服务器
- Please input the username:zw // 登录用户名为 zw
The server is not authenticated. Continue to access it? [Y/N] :y 服务器未通过身份验证. 继续访问?
Enter password: // 输入密码
来源: http://www.bubuko.com/infodetail-2974211.html