学习HCIA得第四节------vlan原理

1.实验拓扑:

2.实验要求:

 

 

 

3.实验代码:

 sw1:

<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw1
[sw1]vlan	
[sw1]vlan b	
[sw1]vlan batch 10 11 100 
Mar 27 2023 16:11:29-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 4, the c
hange loop count is 0, and the maximum number of records is 4095.101 102
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]vlan batch 10 11 100 101 102
Mar 27 2023 16:11:39-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 5, the c
hange loop count is 0, and the maximu
[sw1]
[sw1]sys sw1
[sw1]vlan batch 10 11 100 101 102
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]
Mar 27 2023 16:12:39-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]
[sw1]
[sw1]int g0/0/1
[sw1-GigabitEthernet0/0/1]po	
[sw1-GigabitEthernet0/0/1]po	
[sw1-GigabitEthernet0/0/1]port de	
[sw1-GigabitEthernet0/0/1]po	
[sw1-GigabitEthernet0/0/1]port li	
[sw1-GigabitEthernet0/0/1]port link-	
[sw1-GigabitEthernet0/0/1]port link-ty	
[sw1-GigabitEthernet0/0/1]port link-type tr	
[sw1-GigabitEthernet0/0/1]port link-type trunk 
[sw1-GigabitEthernet0/0/1]po	
[sw1-GigabitEthernet0/0/1]port 
Mar 27 2023 16:13:59-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.tr	
[sw1-GigabitEthernet0/0/1]port trunk al	
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan	
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 to	
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 to 11
[sw1-GigabitEthernet0/0/1]int g0/0/2
[sw1-GigabitEthernet0/0/2]po	
[sw1-GigabitEthernet0/0/2]portl
Mar 27 2023 16:14:19-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.lin	
[sw1-GigabitEthernet0/0/2]port lin	
[sw1-GigabitEthernet0/0/2]port link-ty	
[sw1-GigabitEthernet0/0/2]port link-type 
[sw1-port-group-link-type]port link-type 
Mar 27 2023 16:14:29-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.	
[sw1-port-group-link-type]port link-type tr	
[sw1-port-group-link-type]port link-type trunk 
[sw1-port-group-link-type]po	
[sw1-port-group-link-type]port tr	
[sw1-port-group-link-type]port trunk al	
[sw1-port-group-link-type]port trunk allow-pass v	
[sw1-port-group-link-type]port trunk allow-pass vlan 10 to	
[sw1-port-group-link-type]port trunk allow-pass vlan 10 to 11
[sw1-port-group-link-type]
[sw1-port-group-link-type]
[sw1-port-group-link-type]q
[sw1]int g0/0/3
[sw1-GigabitEthernet0/0/3]
[sw1-GigabitEthernet0/0/3]po	
[sw1-GigabitEthernet0/0/3]port hy	
[sw1-GigabitEthernet0/0/3]port hybrid ta	
[sw1-GigabitEthernet0/0/3]port hybrid tagged vlan	
[sw1-GigabitEthernet0/0/3]port hybrid tagged vlan 100 to 102
[sw1-GigabitEthernet0/0/3]int g0/0/4
[sw1-GigabitEthernet0/0/4]
Mar 27 2023 16:20:50-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.po	
[sw1-GigabitEthernet0/0/4]port hy	
[sw1-GigabitEthernet0/0/4]port hybrid pv	
[sw1-GigabitEthernet0/0/4]port hybrid pvid vlan	
[sw1-GigabitEthernet0/0/4]port hybrid pvid vlan 100
[sw1-GigabitEthernet0/0/4]po	
[sw1-GigabitEthernet0/0/4]port hi	
[sw1-GigabitEthernet0/0/4]port hy	
[sw1-GigabitEthernet0/0/4]port hybrid un	
[sw1-GigabitEthernet0/0/4]port hybrid untagged 
Mar 27 2023 16:21:10-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 11, the 
change loop count is 0, and the maximum number of records is 4095.	
[sw1-GigabitEthernet0/0/4]port hybrid untagged vlan	
[sw1-GigabitEthernet0/0/4]port hybrid untagged vlan 100 to 102
[sw1-GigabitEthernet0/0/4]
Mar 27 2023 16:21:20-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.
[sw1-GigabitEthernet0/0/4]q
[sw1]q
<sw1>save

sw2;

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw2
[sw2]
Mar 27 2023 16:11:59-08:00 sw2 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, the c
hange loop count is 0, and the maximum number of records is 4095.vlan	
[sw2]vlan b	
[sw2]vlan batch 10 11
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2]
Mar 27 2023 16:12:09-08:00 sw2 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, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw2]int	
[sw2]interface g0/0/1
[sw2-GigabitEthernet0/0/1]po	
[sw2-GigabitEthernet0/0/1]port li	
[sw2-GigabitEthernet0/0/1]port link-ty	
[sw2-GigabitEthernet0/0/1]port link-type tr	
[sw2-GigabitEthernet0/0/1]port link-type trunk 
[sw2-GigabitEthernet0/0/1]po	
[sw2-GigabitEthernet0/0/1]port
Mar 27 2023 16:15:59-08:00 sw2 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.tr	
[sw2-GigabitEthernet0/0/1]porttral	
[sw2-GigabitEthernet0/0/1]port tr	
[sw2-GigabitEthernet0/0/1]port trunk al	
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan	
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 to 11
[sw2-GigabitEthernet0/0/1]
Mar 27 2023 16:16:19-08:00 sw2 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.int g0/0/2
[sw2-GigabitEthernet0/0/2]po	
[sw2-GigabitEthernet0/0/2]port li	
[sw2-GigabitEthernet0/0/2]port link-ac	
[sw2-GigabitEthernet0/0/2]port link-ty	
[sw2-GigabitEthernet0/0/2]port link-type ac	
[sw2-GigabitEthernet0/0/2]port link-type access 
[sw2-GigabitEthernet0/0/2]po	
[sw2-GigabitEthernet0/0/2]port
Mar 27 2023 16:16:39-08:00 sw2 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.	
[sw2-GigabitEthernet0/0/2]port de	
[sw2-GigabitEthernet0/0/2]port default vlan	
[sw2-GigabitEthernet0/0/2]port default vlan 10
[sw2-GigabitEthernet0/0/2]int g0/0/3
[sw2-GigabitEthernet0/0/3]po	
[sw2-GigabitEthernet0/0/3]port 
Mar 27 2023 16:16:59-08:00 sw2 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.	
[sw2-GigabitEthernet0/0/3]port li	
[sw2-GigabitEthernet0/0/3]port link-ty	
[sw2-GigabitEthernet0/0/3]port link-type ac	
[sw2-GigabitEthernet0/0/3]port link-type access 
[sw2-GigabitEthernet0/0/3]po	
[sw2-GigabitEthernet0/0/3]port de	
[sw2-GigabitEthernet0/0/3]port default vlan	
[sw2-GigabitEthernet0/0/3]port default vlan 11
[sw2-GigabitEthernet0/0/3]
Mar 27 2023 16:17:19-08:00 sw2 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 11, the 
change loop count is 0, and the maximum number of records is 4095.
[sw2-GigabitEthernet0/0/3]q

sw3:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw3
[sw3]vlan	
[sw3]vlan b	
[sw3]vlan batch 10 11
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw3]
Mar 27 2023 16:12:20-08:00 sw3 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, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw3]vlan batch 10 11
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw3]
Mar 27 2023 16:12:30-08:00 sw3 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.
[sw3]
[sw3]
[sw3]int g0/0/1
[sw3-GigabitEthernet0/0/1]po	
[sw3-GigabitEthernet0/0/1]port lin	
[sw3-GigabitEthernet0/0/1]port link-ty	
[sw3-GigabitEthernet0/0/1]port link-type tr	
[sw3-GigabitEthernet0/0/1]port link-type trunk 
[sw3-GigabitEthernet0/0/1]po	
[sw3-GigabitEthernet0/0/1]portde	
[sw3-GigabitEthernet0/0/1]port de	
[sw3-GigabitEthernet0/0/1]port tr	
[sw3-GigabitEthernet0/0/1]port trunk 
Mar 27 2023 16:18:10-08:00 sw3 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.al	
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan	
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 to11
                                                        ^
Error: Wrong parameter found at '^' position.
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 to 11
[sw3-GigabitEthernet0/0/1]
Mar 27 2023 16:18:30-08:00 sw3 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.
[sw3-GigabitEthernet0/0/1]int g0/0/2
[sw3-GigabitEthernet0/0/2]po	
[sw3-GigabitEthernet0/0/2]port lin	
[sw3-GigabitEthernet0/0/2]port link-ty	
[sw3-GigabitEthernet0/0/2]port link-type ac	
[sw3-GigabitEthernet0/0/2]port link-type access 
[sw3-GigabitEthernet0/0/2]po	
[sw3-GigabitEthernet0/0/2]portde	
[sw3-GigabitEthernet0/0/2]port de	
[sw3-GigabitEthernet0/0/2]port default vlan	
[sw3-GigabitEthernet0/0/2]port default vlan 10
[sw3-GigabitEthernet0/0/2]
Mar 27 2023 16:19:00-08:00 sw3 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.
[sw3-GigabitEthernet0/0/2]int g0/0/3
[sw3-GigabitEthernet0/0/3]po	
[sw3-GigabitEthernet0/0/3]port lin	
[sw3-GigabitEthernet0/0/3]port link-ty	
[sw3-GigabitEthernet0/0/3]port link-type ac	
[sw3-GigabitEthernet0/0/3]port link-type access 
[sw3-GigabitEthernet0/0/3]po	
[sw3-GigabitEthernet0/0/3]port de	
[sw3-GigabitEthernet0/0/3]port default vla
Mar 27 2023 16:19:20-08:00 sw3 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 11, the 
change loop count is 0, and the maximum number of records is 4095.n	
[sw3-GigabitEthernet0/0/3]port default vlan 11
[sw3-GigabitEthernet0/0/3]
Mar 27 2023 16:19:30-08:00 sw3 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.
[sw3-GigabitEthernet0/0/3]
[sw3-GigabitEthernet0/0/3]
[sw3-GigabitEthernet0/0/3]
[sw3-GigabitEthernet0/0/3]q

sw4:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw4
[sw4]vlan b	
[sw4]vlan batch 100
Mar 27 2023 16:12:51-08:00 sw4 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, the c
hange loop count is 0, and the maximum number of records is 4095. 	
[sw4]vlan batch 100 101 102
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw4]
Mar 27 2023 16:13:01-08:00 sw4 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, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw4]
[sw4]int g0/0/1
[sw4-GigabitEthernet0/0/1]po	
[sw4-GigabitEthernet0/0/1]port hy	
[sw4-GigabitEthernet0/0/1]port hybrid un	
[sw4-GigabitEthernet0/0/1]port hybrid uta	
[sw4-GigabitEthernet0/0/1]port hybrid ta	
[sw4-GigabitEthernet0/0/1]port hybrid tagged vlan	
[sw4-GigabitEthernet0/0/1]port hybrid tagged vlan 100 to 102
[sw4-GigabitEthernet0/0/1]int 
Mar 27 2023 16:21:52-08:00 sw4 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.g0/0/2
[sw4-GigabitEthernet0/0/2]po	
[sw4-GigabitEthernet0/0/2]porthy	
[sw4-GigabitEthernet0/0/2]port hy	
[sw4-GigabitEthernet0/0/2]port hybrid  pv	
[sw4-GigabitEthernet0/0/2]port hybrid  pvid vlan	
[sw4-GigabitEthernet0/0/2]port hybrid  pvid vlan 101
[sw4-GigabitEthernet0/0/2]
Mar 27 2023 16:22:12-08:00 sw4 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.po	
[sw4-GigabitEthernet0/0/2]port hy	
[sw4-GigabitEthernet0/0/2]port hybrid un	
[sw4-GigabitEthernet0/0/2]port hybrid untagged vlan	
[sw4-GigabitEthernet0/0/2]port hybrid untagged vlan 100 to102
                                                        ^
Error: Wrong parameter found at '^' position.
[sw4-GigabitEthernet0/0/2]port hybrid untagged vlan 100 to 102
[sw4-GigabitEthernet0/0/2]
Mar 27 2023 16:22:42-08:00 sw4 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.
[sw4-GigabitEthernet0/0/2]int g0/0/3
[sw4-GigabitEthernet0/0/3]po	
[sw4-GigabitEthernet0/0/3]port hy	
[sw4-GigabitEthernet0/0/3]port hybrid pv	
[sw4-GigabitEthernet0/0/3]port hybrid pvid v	
[sw4-GigabitEthernet0/0/3]port hybrid pvid vlan 102
[sw4-GigabitEthernet0/0/3]po	
[sw4-GigabitEthernet0/0/3]port
Mar 27 2023 16:23:12-08:00 sw4 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. 	
[sw4-GigabitEthernet0/0/3]portswitchhy	
[sw4-GigabitEthernet0/0/3]port hy	
[sw4-GigabitEthernet0/0/3]port hybrid un	
[sw4-GigabitEthernet0/0/3]port hybrid untagged vlan	
[sw4-GigabitEthernet0/0/3]port hybrid untagged vlan 	
[sw4-GigabitEthernet0/0/3]port hybrid untagged vlan 100 102
[sw4-GigabitEthernet0/0/3]
Mar 27 2023 16:23:32-08:00 sw4 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.
[sw4-GigabitEthernet0/0/3]
[sw4-GigabitEthernet0/0/3]
[sw4-GigabitEthernet0/0/3]q
[sw4]q

猜你喜欢

转载自blog.csdn.net/qq_62466609/article/details/129798146