1.console线:
一台新设备没有进行任何配置的时候,这时候就需要使用console线连接进行配置了。这里我使用Huawei eNSP来模拟实现一下:
LSW1:
这里的认证模式有AAA,不认证(none),password,这里使用的是password,也就是只用输入密码进行登录,选择AAA就是需要用户名加密码进入。
user-interface con 0 --- console
authentication-mode password --- 设置认证模式为密码登录
set authentication password cipher Huawei@123 --- 设置密码,并且显示为密文
PC1:
输入刚刚LSW1配置好的密码Huawei@123,就可以通过console线进入到网络设备中进行配置了,如果是一台真实的设备厂家已经提前配置过用户名和密码了,登录设备输入给好的用户名和密码就行华为的用户名一般都是admin,密码Admin@123。
下面两种方法我们都是使用LSW2登录到LSW1上:
2.Telnet协议:
用这个方法需要满足两个条件:
①与远程登录的网络设备之间的网络需要相互可达。
②网络设备需要开启Telnet协议。
LSW1:
#
aaa
local-user sisa password cipher Huawei@123
local-user sisa privilege level 15
local-user sisa service-type telnet
#
user-interface vty 0 4
authentication-mode aaa
#
LSW2:
在<>用户模式下使用telnet 192.168.1.254
3.SSH协议:
用这个方法需要满足两个条件:
①与远程登录的网络设备之间的网络需要相互可达。
②网络设备需要开启stelnet协议。
LSW1:
aaa
local-user bo password cipher Huawei@123
local-user bo privilege level 15
local-user bo service-type ssh
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh --- 默认为telnet
#
stelnet server enable
ssh user bo
ssh user bo authentication-type password
ssh user bo service-type stelnet
#
使用rsa对本地用户密码进行加密:
LSW2:
在LSW2设备上输入 ssh client first-time enable这个在首次登录LSW1设备时候有提示:
总的来说一个新的设备初次是需要console线来进行配置的,Telnet和SSH协议是首先配置该协议的内容方便后续登录该设备对设备进行操作 。