1.先预配
<Huawei>sys
<Huawei>system-view sy
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sy
[Huawei]sysname r1
[r1]us
[r1]user-bind
[r1]user-group
[r1]user-interface console
[r1-ui-console0]i
[r1-ui-console0]idle-timeout 0 0
[r1-ui-console0]
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]sysname r2
[r2]user-interface console 0
[r2-ui-console0]
[r2-ui-console0]idle-timeout 0 0
[r2-ui-console0]
[r2-ui-console0]
2.给r1使用密码加密
[r1-ui-console0]au
[r1-ui-console0]auto-execute
[r1-ui-console0]authentication-mode p
[r1-ui-console0]authentication-mode password
[r1-ui-console0]authentication-mode password
Please configure the login password (maximum length 16):jincheng
[r1-ui-console0]au
[r1-ui-console0]authentication-mode aaa
3给r2基于不同权限设置不同密码
[r2-aaa]l
[r2-aaa]local-user jincheng pri
[r2-aaa]local-user jincheng privilege l
[r2-aaa]local-user jincheng privilege level 15 p
[r2-aaa]local-user jincheng privilege level 15 password c
[r2-aaa]local-user jincheng privilege level 15 password cipher xueyuan
Info: Add a new user.
[r2-aaa]l
[r2-aaa]local-user jincheng se
[r2-aaa]local-user jincheng service-type t
[r2-aaa]local-user jincheng service-type telnet
[r2-aaa]local-user jincheng service-type terminal
[r2-aaa]l
[r2-aaa]local-user xuesheng pr
[r2-aaa]local-user xuesheng privilege l
[r2-aaa]local-user xuesheng privilege level 0 pa
[r2-aaa]local-user xuesheng privilege level 0 password c
[r2-aaa]local-user xuesheng privilege level 0 password cipher 123
Info: Add a new user.
[r2-aaa]quit
[r2]user
[r2]user-bind
[r2]user-group
[r2]user-interface c
[r2]user-interface console 0
[r2]user-interface console 0
[r2-ui-console0]au
[r2-ui-console0]auto-execute
[r2-ui-console0]authentication-mode aaa
4.r1可ping通r2IP地址
[r1]i
[r1]icmp-reply
[r1]igmp
[r1]igmp-snooping
[r1]ike
[r1]info-center
[r1]interface g
[r1]interface GigabitEthernet
[r1]interface
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip add
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1/24
^
Error: Wrong parameter found at '^' position.
[r1-GigabitEthernet0/0/0]ip
[r1-GigabitEthernet0/0/0]ip add
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1/24
^
Error: Wrong parameter found at '^' position.
[r1-GigabitEthernet0/0/0]ip add
[r1-GigabitEthernet0/0/0]ip address 111.111.1.1/24
^
Error: Wrong parameter found at '^' position.
[r1-GigabitEthernet0/0/0]ip ad
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Oct 29 2022 20:03:41-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]di
[r1-GigabitEthernet0/0/0]dialer
[r1-GigabitEthernet0/0/0]direct-route
[r1-GigabitEthernet0/0/0]discard
[r1-GigabitEthernet0/0/0]quit
[r1]dis
[r1]display ip in
[r1]display ip interface b
[r1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
[r1]quit
<r1>ping 192.168.1.2
PING 192.168.1.2: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.2: bytes=56 Sequence=1 ttl=255 time=160 ms
Reply from 192.168.1.2: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 192.168.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 192.168.1.2: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 192.168.1.2: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/54/160 ms