自作笔记...
目录
vlan技术--交换机连接pc实现局域网分割(Access模式)
PC
SW1
结果
vlan技术--交换机连接pc实现局域网分割(trunk模式)
vlan技术--交换机连接pc实现局域网分割(Access模式)
交换机先创建vlan.
交换机分别进入接口
(配置好连接模式, 连接的vlan)
PC
SW1
<Huawei>
<Huawei>sy
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]
[Huawei]
[Huawei]sy
[Huawei]sysname SW1
[SW1]
Jun 20 2024 23:03:01-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.
[SW1]
[SW1]
[SW1]
[SW1]int
[SW1]interface E
[SW1]interface Eth
[SW1]interface Ethernet0/0/1
[SW1-Ethernet0/0/1]
[SW1-Ethernet0/0/1]ip add
[SW1-Ethernet0/0/1]p
[SW1-Ethernet0/0/1]port l
[SW1-Ethernet0/0/1]port link-ty
[SW1-Ethernet0/0/1]port link-type a
[SW1-Ethernet0/0/1]port link-type access
[SW1-Ethernet0/0/1]p
Jun 20 2024 23:03:31-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 maximum number of records is 4095
Error: The interface is already a L2 interface.
[SW1-Ethernet0/0/1]
[SW1-Ethernet0/0/1]
[SW1-Ethernet0/0/1]p
[SW1-Ethernet0/0/1]port ?
add-tag Add outer tag based on acl
default Specify current port's PVID VLAN characteristics
discard Discard
link-flap Link flap
link-type Switch port link type
mux-vlan Multiplex vlan
priority Specify current port's priority
type Type
vlan-mapping VLAN Mapping
vlan-stacking VLAN Stacking
[SW1]
[SW1]
[SW1]v
[SW1]vlan ba
[SW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]
[SW1]
[SW1]
[SW1]qu
Jun 20 2024 23:04: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 409ppinterface Ethernet0/0/1
[SW1-Ethernet0/0/1]
[SW1-Ethernet0/0/1]p
[SW1-Ethernet0/0/1]port d
[SW1-Ethernet0/0/1]port de
[SW1-Ethernet0/0/1]port default v
[SW1-Ethernet0/0/1]port default vlan 10
[SW1-Ethernet0/0/1]
[SW1-Ethernet0/0/1]di
[SW1-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
return
[SW1-Ethernet0/0/1]
[SW1-Ethernet0/0/1]qu
[SW1]
[SW1]
Jun 20 2024 23:04:32-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]int
[SW1]interface E
[SW1]interface Eth
[SW1]interface Ethernet0/0/2
[SW1-Ethernet0/0/2]
[SW1-Ethernet0/0/2]
[SW1-Ethernet0/0/2]
[SW1-Ethernet0/0/2]p l a
[SW1-Ethernet0/0/2]p d v 20
[SW1-Ethernet0/0/2]
[SW1-Ethernet0/0/2]
[SW1-Ethernet0/0/2]qu
[SW1]
[SW1]
[SW1]
[SW1]int
[SW1]interface
Jun 20 2024 23:04: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.E
[SW1]interface Eth
[SW1]interface Ethernet0/0/3
[SW1-Ethernet0/0/3]
[SW1-Ethernet0/0/3]
[SW1-Ethernet0/0/3]
[SW1-Ethernet0/0/3]p l a
[SW1-Ethernet0/0/3]
[SW1-Ethernet0/0/3]p d v 10
[SW1-Ethernet0/0/3]
Jun 20 2024 23:05:01-08:00 SW1 %%01IFNET/4/IF_STATE(l)[54]:Interface Vlanif1 has
turned into DOWN state.
[SW1-Ethernet0/0/3]
[SW1-Ethernet0/0/3]
Jun 20 2024 23:05: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 11, the
change loop count is 0, and the maximum number of records is 4095.q
<SW1>
<SW1>
<SW1>sa
<SW1>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]:
Jun 20 2024 23:05:10-08:00 SW1 %%01CFM/4/SAVE(l)[55]:The user chose Y when decid
ing whether to save the configuration to the device.
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<SW1>
<SW1>
<SW1>
<SW1>
结果
1 --->1
1---->3
1 !-> 2
2 !->1
2 !->3
vlan技术--交换机连接pc实现局域网分割(trunk模式)
trunk模式的接口连接的是非pc终端设备
连交换机,路由器,.等等...
(接口的连接模式改为trunk就行了,不会就扣?)