路由交换学习第三天:路由器设置SSH远程登录认证

华为路由器建立远程管理

1》路由器配置
<Huawei>system-view //进入系统视图
[Huawei]sysname HW-R1 //设置系统名字HW-R1
[HW-R1]interface g0/0/1 //配置g0/0/1接口
[HW-R1-GigabitEthernet0/0/1]ip address 10.1.11.1 24 //配置IP地址
[HW-R1-GigabitEthernet0/0/1]display this //查看当前配置
[V200R003C00]
#
interface GigabitEthernet0/0/1
ip address 10.1.11.1 255.255.255.0
#
return

2》交换机配置
<Huawei>system-view //进入系统视图
[Huawei]sysname HW-SW1 //设置系统名字HW-SW1
[HW-SW1]interface Vlanif 1 //配置g0/0/1接口
[HW-SW1-Vlanif1]ip address 10.1.11.2 24 //配置IP地址
[HW-SW1-Vlanif1]display this //查看当前配置
#
interface Vlanif1
ip address 10.1.11.2 255.255.255.0
#
return

验证:
[HW-SW1]ping 10.1.11.1
PING 10.1.11.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.11.1: bytes=56 Sequence=1 ttl=255 time=80 ms
Reply from 10.1.11.1: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 10.1.11.1: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 10.1.11.1: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.1.11.1: bytes=56 Sequence=5 ttl=255 time=40 ms

[HW-R1]ping 10.1.11.2
PING 10.1.11.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.11.2: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 10.1.11.2: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 10.1.11.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 10.1.11.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.1.11.2: bytes=56 Sequence=5 ttl=255 time=10 ms

3》配置路由器远程管理
[HW-R1]user-interface vty 0 4 //配置虚拟终端,最多支持5路
[HW-R1-ui-vty0-4]set authentication password cipher 123456 //设置认证隐藏密码***
[HW-R1-ui-vty0-4]user privilege level 15 //设置VTY用户权限为15级

验证:
<HW-SW1>telnet 10.1.11.1 //在SW1上Telnet HW-R1
Trying 10.1.11.1 ...
Press CTRL+K to abort
Connected to 10.1.11.1 ...
Login authentication
Password:
<HW-R1>sys //进入系统视图
Enter system view, return user view with Ctrl+Z.
[HW-R1] //可以进入系统视图说明拥有相应的权限
[HW-R1]dis users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
0 CON 0 00:00:00 pass Username : Unspecified

  • 129 VTY 0 00:00:00 TEL 10.1.11.2 pass Username : Unspecified
    [HW-R1]

意外收获:
[HW-R1]telnet server enable //虚拟机默认开启,真机需要开启telnet服务

猜你喜欢

转载自blog.51cto.com/63736/2424563