目录
一、需要熟记的命令
三个必打命令
(1)<Huawei>undo terminal monitor (关掉提示消息)
(2)[server]user-interface console 0 (进入这个接口)
idle-timeout 0 0 (设置会话永不超时)
(3)<Huawei>sysname sw1 (改名字)
查询配置命令
<Huawei>display current-configuration (查询当前配置)
<Huawei>display saved-configuration (查询已保存配置)
二、交换机/路由器的虚拟接口
注意:交换机的物理接口是不能配置ip地址的
交换机有一个虚拟接口,默认虚拟接口名称叫:VLanif 1 ,我们可以给默认虚拟接口配置ip,即给二层交换机配置一个管理ip。
[] interface vlanif 1
[] ip address 192.168.1.1 24
undo shutdown 开启接口(交换机不需要打)
交换机/路由器虚拟接口特性:只要设备启动,虚拟接口默认开启。
交换机的物理接口默认是开启状态。
拓扑图
三、操作步骤
Sw1
<Huawei>undo terminal monitor (关掉提示消息)
<Huawei>system-view (进入系统模式)
[Huawei]sysname sw1 (改名字)
[sw1]interface Vlanif 1 (进入虚拟接口,配上ip地址后可以理解成人的名片)
[sw1-Vlanif1]ip address 192.168.12.1 24 (配置ip地址)
[sw1-Vlanif1]quit (退出接口,只能退出一级)
[sw1]
[sw1]user-interface vty 0 4 (进入telnet配置,0 4代表5个线程数)
[sw1-ui-vty0-4]authentication-mode password (设置远程登录模式)
[sw1-ui-vty0-4]set authentication password ?
cipher Set the password with cipher text(cipher密文)
simple Set the password in plain text (simple 明文)
[sw1-ui-vty0-4]set authentication password cipher Huawei (配置密文密码 为Huawei)
[sw1-ui-vty0-4]user privilege level 3 (设定为3级管理权限,管理级为0—15)
[sw1-ui-vty0-4]return (直接返回用户视图)
<sw1>
<sw1>save (将配置进行保存)
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y (输入y确定保存)
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]: (回车)
Now saving the current configuration to the slot 0.
Save the configuration successfully. (意思是保存成功)
<sw1>
Sw2
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>system-view
[Huawei]sysname sw2
[sw2]interface Vlanif 1
[sw2-Vlanif1]
[sw2-Vlanif1]ip ad
[sw2-Vlanif1]ip address 192.168.12.2 24
[sw2-Vlanif1]
[sw2-Vlanif1]quit
[sw2]q
<sw2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<sw2>telne
<sw2>telnet 192.168.12.1 (在sw2进行远程登陆sw1)
Trying 192.168.12.1 ...
Press CTRL+K to abort
Connected to 192.168.12.1 ...
Login authentication
Password: (输入密文密码Huawei) 然后回车)
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2021-08-05 18:01:10.
<sw1> (说明登录成功)
四、总结
首先理解是在客户机上远程登录,用Telnet协议登录,在登录前要做好可登录的一些配置。熟记命令、理解命令含义。