1、所有设备必须要有预配,都得改名r1,r2
<Huawei>sy
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sy
[Huawei]sysname r1
[r1]us
[r1]user-inter
[r1]user-interface con
[r1]user-interface console 0
[r1-ui-console0]idle-tim
[r1-ui-console0]idle-timeout 0 0
<Huawei>sy
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sy
[Huawei]sysname
^
Error:Incomplete command found at '^' position.
[Huawei]
[Huawei]
[Huawei]
[Huawei]
[Huawei]
[Huawei]
[Huawei]
[Huawei]
[Huawei]sy
[Huawei]sysname r2
[r2]user-in
[r2]user-interface con
[r2]user-interface console 0
[r2-ui-console0]idle
[r2-ui-console0]idle-timeout 0 0
预配:改名+永不超时指令
永不超时:
[r1]user-interface console 0
[r1-ui-console0]idle-timeout 0 0
2、r1使用密码加密,密码为jincheng
[r1-ui-console0]qui
[r1-ui-console0]quit
[r1]user-in
[r1]user-interface con
[r1]user-interface console 0
[r1-ui-console0]authen
[r1-ui-console0]authentication-mode pa
[r1-ui-console0]authentication-mode password
Please configure the login password (maximum length 16):jincheng
[r1-ui-console0]quit
[r1]quit
<r1>quit
Configuration console exit, please press any key to log on
Login authentication
Password:
Password:
<r1>
[r1]user-interface console 0
[r1-ui-console0]authentication-mode password
Please configure the login password (maximum length 16):jincheng
3、r2使用用户名为ijncheng 管理权限15 密码为xueyuan
r2使用用户名为xuesheng 管理权限0密码为123
[r2]aaa
[r2-aaa]loc
[r2-aaa]local-user jincheng pa
[r2-aaa]local-user jincheng password ci
[r2-aaa]local-user jincheng password cipher xuesheng
[r2-aaa]quit
[r2]us
[r2]user-in
[r2]user-interface con
[r2]user-interface console 0
[r2-ui-console0]auth
[r2-ui-console0]authentication-mode aaa
[r2-ui-console0]quit
[r2]aaa
[r2-aaa]loca
[r2-aaa]local-user jincheng pr
[r2-aaa]local-user jincheng privilege le
[r2-aaa]local-user jincheng privilege level 15 pa
[r2-aaa]local-user jincheng privilege level 15 password ci
[r2-aaa]local-user jincheng privilege level 15 password cipher
[r2-aaa]local-user jincheng privilege level 15 password cipher xueyuan
[r2-aaa]lo
[r2-aaa]local-user jincheng se
[r2-aaa]local-user jincheng service-type ter
[r2-aaa]local-user jincheng service-type terminal
[r2-aaa]lo
[r2-aaa]local-user xuesheng pr
[r2-aaa]local-user xuesheng privilege le
[r2-aaa]local-user xuesheng privilege level 0 pa
[r2-aaa]local-user xuesheng privilege level 0 password ci
[r2-aaa]local-user xuesheng privilege level 0 password cipher 123
[r2-aaa]user-in
[r2-aaa]user-interface co
[r2-aaa]user-interface con
[r2-aaa]user-interface console 0
[r2-ui-console0]au
[r2-ui-console0]authentication-mode aaa
[r2-ui-console0]quit
[r2]quit
<r2>quit
Configuration console exit, please press any key to log on
Login authentication
Username:jincheng
Password:
<r2>
<r2>?
User view commands:
arp-ping ARP-ping
autosave <Group> autosave command group
backup Backup information
cd Change current directory
clear <Group> clear command group
clock Specify the system clock
cls Clear screen
compare Compare configuration file
copy Copy from one file to another
debugging <Group> debugging command group
delete Delete a file
dialer Dialer
dir List files on a filesystem
display Display information
fixdisk Try to restory disk
format Format file system
free Release a user terminal interface
ftp Establish an FTP connection
help Description of the interactive help system
hwtacacs-user HWTACACS user
license <Group> license command group
lldp Link Layer Discovery Protocol
local-user Add/Delete/Set user(s)
lock Lock the current user terminal interface
<r2>quit
Configuration console exit, please press any key to log on
Login authentication
Username:xuesheng
Password:
<r2>?
User view commands:
display Display information
hwtacacs-user HWTACACS user
local-user Add/Delete/Set user(s)
ping Ping function
quit Exit from current mode and enter prior mode
save Save file
super Modify super password parameters
telnet Open a telnet connection
tracert <Group> tracert command group
<r2>
[r1]aaa
[r1-aaa]local-user jincheng privilege level 15 password cipher xueyuan
[r1-aaa]local-user jincheng service-type terminal
[r1-aaa]local-user xuesheng privilege level 0 password cipher 123
4、r1可以ping通r2使用的地址为192.168.1.0/24
[r1]in
[r1]info-center
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip a
[r1-GigabitEthernet0/0/0]ip ad
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Oct 31 2022 21:14:26-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]ip ad
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 255.255.255.0
Error: The address already exists.
[r1-GigabitEthernet0/0/0]qu
[r1-GigabitEthernet0/0/0]quit
[r1]
[r1]dis
[r1]display int
[r1]display ip int
[r1]display ip interface br
[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]
Oct 31 2022 21:19:08-08:00 r1 ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648.10
0663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.3355
4432.100663296 ARP detects IP conflict. (IP address=1.1.168.192, Local interface
=GigabitEthernet0/0/0, Local MAC=00e0-fcf0-2746, Local vlan=0, Local CE vlan=0,
Receive interface=GigabitEthernet0/0/0, Receive MAC=00e0-fcdd-55a2, Receive vlan
=0, Receive CE vlan=0, IP conflict type=Local IP conflict).
[r1]
Oct 31 2022 21:19:08-08:00 r1 %%01ARP/4/ARP_DUPLICATE_IPADDR(l)[1]:Received an A
RP packet with a duplicate IP address from the interface. (IpAddress=1.1.168.192
, InterfaceName=GigabitEthernet0/0/0, MacAddress=00e0-fcdd-55a2)
[r1]quit
<r1>ping 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=255 time=1 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/1 ms
[r2]int
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip ad
[r2-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Oct 31 2022 21:19:08-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]
Oct 31 2022 21:19:09-08:00 r2 ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648.10
0663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.3355
4432.100663296 ARP detects IP conflict. (IP address=1.1.168.192, Local interface
=GigabitEthernet0/0/0, Local MAC=00e0-fcdd-55a2, Local vlan=0, Local CE vlan=0,
Receive interface=GigabitEthernet0/0/0, Receive MAC=00e0-fcf0-2746, Receive vlan
=0, Receive CE vlan=0, IP conflict type=Local IP conflict).
[r2-GigabitEthernet0/0/0]
Oct 31 2022 21:19:09-08:00 r2 %%01ARP/4/ARP_DUPLICATE_IPADDR(l)[1]:Received an A
RP packet with a duplicate IP address from the interface. (IpAddress=1.1.168.192
, InterfaceName=GigabitEthernet0/0/0, MacAddress=00e0-fcf0-2746)
[r2-GigabitEthernet0/0/0]dis
[r2-GigabitEthernet0/0/0]discard
[r2-GigabitEthernet0/0/0]display this
[V200R003C00]
#
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
#
return
[r2-GigabitEthernet0/0/0]
先给r1配ip地址:192.168.1.1 24
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
255.255.255.0
查看ip地址:[r1]display ip interface brief
再给r2配ip地址:
192.168.1.1 24
步骤同上
[r1]quit
<r2>ping 192.168.1.1 24