1、<Huawei> //用户视图
<Huawei>system-view //进入系统视图
Enter system view, return user view with Ctrl+Z. 2、
[Huawei] //系统视图
3、[Huawei]quit //退回上一级视图
<Huawei>
4、[Huawei]return //退回用户视图(从任何一级视图退回用户视图)
<Huawei>
5、[Huawei] 使用ctrl+z组合键也可以退回用户视图(CTRL+Z和return功能一样,也代表从任何一级视图退回用户视图)
<Huawei>
6、[Huawei]sysname S-A //设置系统主机名称
[S-A]
7、[S-A]undo sysname //撤销主机名
[Huawei]
8、[S-A]interface Vlanif 1 //进入vlanif接口
[S-A-Vlanif1]
9、[S-A-Vlanif1]ip address 192.168.3.202 24/(255.255.255.0) //设置IP地址以及子网掩码
10、[S-A-Vlanif1]display this //查看当前接口下的配置信息
#
interface Vlanif1
ip address 192.168.3.202 255.255.255.0
#
return
使用物理机ping ensp中交换机IP,进行连通性测试。
从上图得知,两台主机之间是互通的,接下来,我们进行远程登录(Telnet)测试。
通过测试发现并不能直接远程到目标主机
经过分析。我们得知,远程设备并未开启远程登录服务,所以我们先要开启远程设备的Telnet服务,并进行身份验证设置。
11、[S-A]telnet server enable //开启Telnet(远程登录)服务
Info: The Telnet server has been enabled.
[S-A]
[S-A]undo telnet server enable
Warning: The operation will stop the Telnet server. Continue? [Y/N]:y[S-A]
12、[S-A]user-interface vty 0 4 //设置远程登录用户数量 0 4 表示允许5个用户远程登录到设备
[S-A-ui-vty0-4]
13、[S-A-ui-vty0-4]authentication-mode password //以密码作为远程登录的身份验证方式
[S-A-ui-vty0-4]
14、[S-A-ui-vty0-4]set authentication password cipher huawei123 //设置身份验证密码为huawei123,cipher表示密码以密文方式显示。
[S-A-ui-vty0-4]
通过以上命令设置,我们可以进行telnet远程登录测试
输入正确口令,我们可以进入远程设备操作界面
但是,我们发现我们并没有权限,只能使用一些查看命令进行操作,不能使用system-view进入系统视图
经过分析,我们得知,我们没有对远程登录用户进行授权,下边我们对远程登录进行授权,再次尝试。
15、[S-A-ui-vty0-4]user privilege level 3 //给远程登录用户分配权限 3 -15 为高权限
[S-A-ui-vty0-4]
16、[S-A]undo info-center enable //关闭信息中心功能
17、<Huawei>save
//保存配置命令 The current configuration will be written to the device. Are you sure to continue?[Y/N]y
18、清除保存的所以配置并保存
<Huawei>reset saved-configuration //清除保存的所有配置 Warning: The action will delete the saved configuration in the device. The configuration will be erased to reconfigure. Continue? [Y/N]:y //是否清除,选择是Y Warning: Now clearing the configuration in the device. Aug 10 2023 09:52:14-08:00 Huawei %%01CFM/4/RST_CFG(l)[0]:The user chose Y when deciding whether to reset the saved configuration. Info: Succeeded in clearing the configuration in the device.<Huawei>reboot //重启设备 Info: The system is now comparing the configuration, please wait. Warning: All the configuration will be saved to the configuration file for the n ext startup:, Continue?[Y/N]:n //是否保存配置文件,选择否N Info: If want to reboot with saving diagnostic information, input 'N' and then e xecute 'reboot save diagnostic-information'. System will reboot! Continue?[Y/N]:y //确定要重启设备,选择是Y