R1的环回:192.168.1.0/28
R2的环回:192.168.1.16/28
R123的0/0/0接口:192.168.1.32/28
R3-4:192.168.1.128/30
vlan2:192.168.1.48/28
vlan3:192.168.1.64/28
192.168.1.0 24
0区域:192.168.1.0/25
1区域:192.168.1.128/30
R1
<Huawei>sys
Jul 13 2023 20:48:50-08:00 Huawei %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEt
hernet0/0/0 has turned into UP state.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int g
[R1]int GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip ad
[R1-GigabitEthernet0/0/0]ip address 192.168.1.33 28
Jul 13 2023 20:49:30-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]q
[R1]int l
[R1]int LoopBack 0
[R1-LoopBack0]ip ads
[R1-LoopBack0]ip ad
[R1-LoopBack0]ip address 192.168.1.1 28
[R1-LoopBack0]q
[R1]dis
[R1]display ip int
[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 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.33/28 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.1/28 up up(s)
NULL0 unassigned up up(s)
[R1]q
<R1>
<R1>sys
Enter system view, return user view with Ctrl+Z.
[R1]
[R1]
[R1]
[R1]os
[R1]ospf 1 r
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]are
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]net
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0.0.0.0.15
[R1-ospf-1-area-0.0.0.0]net
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.15
[R1-ospf-1-area-0.0.0.0]net
[R1-ospf-1-area-0.0.0.0]network 192.168.1.33 0.0.0.0
[R1-ospf-1-area-0.0.0.0]q
[R1-ospf-1]
[R1-ospf-1]dis
[R1-ospf-1]display th
[R1-ospf-1]display this
[V200R003C00]
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.1.0 0.0.0.15
network 192.168.1.33 0.0.0.0
#
return
[R1-ospf-1]q
R2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip ad
[R2-GigabitEthernet0/0/0]ip address 192.168.1.34 28
Jul 13 2023 20:52:37-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]q
[R2]int l
[R2]int LoopBack 0
[R2-LoopBack0]ip ad
[R2-LoopBack0]ip address 192.168.1.17 28
[R2-LoopBack0]q
[R2]dis
[R2]display ip int
[R2]display ip interface b
[R2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.34/28 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.17/28 up up(s)
NULL0 unassigned up up(s)
[R2]q<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]
[R2]
[R2]os
[R2]ospf 1 rou
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]
[R2-ospf-1]ar
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]ne`
[R2-ospf-1-area-0.0.0.0]ne
[R2-ospf-1-area-0.0.0.0]network 192.168.1.16 0.0.0.15
[R2-ospf-1-area-0.0.0.0]
[R2-ospf-1-area-0.0.0.0]ne
[R2-ospf-1-area-0.0.0.0]network 192.168.1.34 0.0.0.0
[R2-ospf-1-area-0.0.0.0]q
[R2-ospf-1]dis
[R2-ospf-1]display th
[R2-ospf-1]display this
[V200R003C00]
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 192.168.1.16 0.0.0.15
network 192.168.1.34 0.0.0.0
#
return
[R2-ospf-1]q
R3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]int g
[R3]int GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip add
[R3-GigabitEthernet0/0/0]ip address 192.168.1.35 28
Jul 13 2023 20:55:20-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]q
[R3]int g
[R3]int GigabitEthernet 0/0/2.1
[R3-GigabitEthernet0/0/2.1]ip add
[R3-GigabitEthernet0/0/2.1]ip address 192.168.1.49 28
[R3-GigabitEthernet0/0/2.1]do
[R3-GigabitEthernet0/0/2.1]dot1q ter
[R3-GigabitEthernet0/0/2.1]dot1q termination v
[R3-GigabitEthernet0/0/2.1]dot1q termination vid 2
Jul 13 2023 20:58:00-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/2.1 has entered the UP state.
[R3-GigabitEthernet0/0/2.1]ar
[R3-GigabitEthernet0/0/2.1]arp br
[R3-GigabitEthernet0/0/2.1]arp broadcast en
[R3-GigabitEthernet0/0/2.1]arp broadcast enable
[R3-GigabitEthernet0/0/2.1]q
[R3]
[R3]int g
[R3]int GigabitEthernet 0/0/2.2
[R3-GigabitEthernet0/0/2.2]ip ad
[R3-GigabitEthernet0/0/2.2]ip address 192.168.1.65 28
[R3-GigabitEthernet0/0/2.2]do
[R3-GigabitEthernet0/0/2.2]dot1q ter
[R3-GigabitEthernet0/0/2.2]dot1q termination v
[R3-GigabitEthernet0/0/2.2]dot1q termination vid 3
Jul 13 2023 20:59:21-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2.2 has entered the UP state.
[R3-GigabitEthernet0/0/2.2]ar
[R3-GigabitEthernet0/0/2.2]arp b
[R3-GigabitEthernet0/0/2.2]arp broadcast e
[R3-GigabitEthernet0/0/2.2]arp broadcast enable
[R3-GigabitEthernet0/0/2.2]
[R3-GigabitEthernet0/0/2.2]q
[R3]int g
[R3]int GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip ad
[R3-GigabitEthernet0/0/1]ip address 192.168.1.129 25
Jul 13 2023 21:00:37-08:00 R3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]q
[R3]dis
[R3]display ip int
[R3]display ip interface b
[R3]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 6
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.35/28 up up
GigabitEthernet0/0/1 192.168.1.129/25 up up
GigabitEthernet0/0/2 unassigned up down
GigabitEthernet0/0/2.1 192.168.1.49/28 up up
GigabitEthernet0/0/2.2 192.168.1.65/28 up up
NULL0 unassigned up up(s)
[R3]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]os
[R3]ospf 1 r
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]ar
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]network 192.168.1.35 0.0.0.0
[R3-ospf-1-area-0.0.0.0]
Jul 13 2023 21:13:22-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[10]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=34.1.168.192, Neig
hborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loa
ding)
[R3-ospf-1-area-0.0.0.0]
Jul 13 2023 21:13:22-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[11]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=34.1.168.192, Neig
hborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]network 192.168.1.49 0.0.0.0
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]dis
[R3-ospf-1-area-0.0.0.0]display th
[R3-ospf-1-area-0.0.0.0]display this
[V200R003C00]
#
area 0.0.0.0
network 192.168.1.35 0.0.0.0
network 192.168.1.49 0.0.0.0
network 192.168.1.65 0.0.0.0
#
return
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]ar
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]ne
[R3-ospf-1-area-0.0.0.1]network 192.168.1.129 0.0.0.0
[R3-ospf-1-area-0.0.0.1]q
[R3-ospf-1]
[R3-ospf-1]
<R3>
R4
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]int g
[R4]int GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip ad
[R4-GigabitEthernet0/0/0]ip address 192.168.1.130 30
Jul 13 2023 21:02:24-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R4-GigabitEthernet0/0/0]q
[R4]int l
[R4]int LoopBack 0
[R4-LoopBack0]ip add
[R4-LoopBack0]ip address 4.4.4.1 24
[R4-LoopBack0]q
[R4]
[R4]dis
[R4]display ip int
[R4]display ip interface b
[R4]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.130/30 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 4.4.4.1/24 up up(s)
NULL0 unassigned up up(s)
[R4]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]os
[R4]ospf 1 r
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]
[R4-ospf-1]ar
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]net
[R4-ospf-1-area-0.0.0.1]network 192.168.1.130 0.0.0.0
[R4-ospf-1-area-0.0.0.1]
[R4-ospf-1-area-0.0.0.1]
[R4-ospf-1-area-0.0.0.1]dis
[R4-ospf-1-area-0.0.0.1]display th
[R4-ospf-1-area-0.0.0.1]display this
[V200R003C00]
#
area 0.0.0.1
network 192.168.1.130 0.0.0.0
#
return
[R4-ospf-1-area-0.0.0.1]q
[R4-ospf-1]q
[R4]q
<R4>
LSW2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys vl
[Huawei]vl
[Huawei]vlan 2
[Huawei-vlan2]
[Huawei-vlan2]
Jul 13 2023 21:20:41-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 4, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei-vlan2]q
[Huawei]v
[Huawei]vlan 3
[Huawei-vlan3]q
[Huawei]
Jul 13 2023 21:21:01-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 5, th
e change loop count is 0, and the maximum number of records is 4095
[Huawei]sys sw1
[sw1]
Jul 13 2023 21:21:11-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]dis
[sw1]display vlan
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
1 common UT:GE0/0/1(U) GE0/0/2(U) GE0/0/3(U) GE0/0/4(D)
GE0/0/5(D) GE0/0/6(D) GE0/0/7(D) GE0/0/8(D)
GE0/0/9(D) GE0/0/10(D) GE0/0/11(D) GE0/0/12(D)
GE0/0/13(D) GE0/0/14(D) GE0/0/15(D) GE0/0/16(D)
GE0/0/17(D) GE0/0/18(D) GE0/0/19(D) GE0/0/20(D)
GE0/0/21(D) GE0/0/22(D) GE0/0/23(D) GE0/0/24(D)
2 common
3 common
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
1 enable default enable disable VLAN 0001
2 enable default enable disable VLAN 0002
3 enable default enable disable VLAN 0003
[sw1]int g
[sw1]int GigabitEthernet 0/0/2
[sw1-GigabitEthernet0/0/2]po
[sw1-GigabitEthernet0/0/2]port li
[sw1-GigabitEthernet0/0/2]port link-
[sw1-GigabitEthernet0/0/2]port link-flap
[sw1-GigabitEthernet0/0/2]port link-type acc
[sw1-GigabitEthernet0/0/2]port link-type access
[sw1-GigabitEthernet0/0/2]po
[sw1-GigabitEthernet0/0/2]port de
[sw1-GigabitEthernet0/0/2]port default
Jul 13 2023 21:23:42-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-port-group-default]po
[sw1-port-group-default]port de
Jul 13 2023 21:24:02-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-port-group-default]port default v
[sw1-port-group-default]port default vlan 2
[sw1-port-group-default]q
[sw1]int GigabitEthernet 0/0/2
[sw1-GigabitEthernet0/0/2]dis
[sw1-GigabitEthernet0/0/2]display th
[sw1-GigabitEthernet0/0/2]display this
#
interface GigabitEthernet0/0/2
port link-type access
#
return
[sw1-GigabitEthernet0/0/2]q
[sw1]int g
[sw1]int GigabitEthernet 0/0/3
[sw1-GigabitEthernet0/0/3]po
[sw1-GigabitEthernet0/0/3]port li
[sw1-GigabitEthernet0/0/3]port link-ty
[sw1-GigabitEthernet0/0/3]port link-type acc
[sw1-GigabitEthernet0/0/3]port link-type access
[sw1-GigabitEthernet0/0/3]po
[sw1-GigabitEthernet0/0/3]port
Jul 13 2023 21:27:52-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
^
Error:Incomplete command found at '^' position.
[sw1-GigabitEthernet0/0/3]
[sw1-GigabitEthernet0/0/3]PO
[sw1-GigabitEthernet0/0/3]port de
[sw1-GigabitEthernet0/0/3]port default vl
[sw1-GigabitEthernet0/0/3]port default vlan 3
[sw1-GigabitEthernet0/0/3]
Jul 13 2023 21:28:22-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-GigabitEthernet0/0/3]q
[sw1]int g
[sw1]int GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]por
[sw1-GigabitEthernet0/0/1]port li
[sw1-GigabitEthernet0/0/1]port link-t
[sw1-GigabitEthernet0/0/1]port link-type t
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]dis
[sw1-GigabitEthernet0/0/1]display t
[sw1-GigabitEthernet0/0/1]display this
#
interface GigabitEthernet0/0/1
port link-type trunk
#
return
[sw1-GigabitEthernet0/0/1]po
[sw1-GigabitEthernet0/0/1]port t
[sw1-GigabitEthernet0/0/1]port trunk a
[sw1-GigabitEthernet0/0/1]port trunk allow-pass v
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 3
[sw1-GigabitEthernet0/0/1]
Jul 13 2023 21:31:42-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.
return
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 t
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 4094
[sw1-GigabitEthernet0/0/1]dis
[sw1-GigabitEthernet0/0/1]display t
[sw1-GigabitEthernet0/0/1]display this
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
return
PC2
PC3
实验结果: