2.8.3 Ethernet VLAN (VLAN division method)
The division methods of VLAN are
1. Based on port division
Brief description : Manually specify the VLAN to which the port belongs on the port.
Note : None
Configuration command : (configure vlan 10 to which the interface belongs)
interface e0/0/1
- Access mode:
port link-type access
,port default vlan 10
- Trunk mode:
port link-type trunk
、port trunk pvid vlan 10
- Hybrid mode:
port link-type hybrid
,port hybrid pvid vlan 10
2. Based on MAC address division
Brief description : Configure mac-vlan to realize the binding of network device MAC address and vlan. When the device is configured with mac-vlan device and connected to different ports, the vlan will not be changed.
Precautions:
- In VLAN mode: bind MAC address and VLAN
- In the interface: enable the mac-vlan mode,
mac-vlan enable
- Huawei device ports are in hybrid mode by default, and only vlan1 data is allowed , so you need to pay attention to configuring the allowed vlan.
Configuration command: (configure the binding of MAC address and vlan under vlan10)
vlan 10
mac-vlan mac-address 5489-98f1-51db priority 0
#后面的priority 0缺省产生,可不明确指定
interface Ethernet0/0/2
port hybrid untagged vlan 10 # 放行VLAN10
mac-vlan enable # 开启MAC-Vlan功能
#用于测试的目标主机
interface Ethernet0/0/3
port link-type access
port default vlan 10
3. Based on IP subnetting
Brief description : Set the protocol to bind with Vlan, and when the specified protocol enters, it will be marked with the corresponding VLAN tag (too little use, no in-depth understanding)
Precautions:
- In VLAN mode: IP subnet binding
- In the interface: enable the ip-subnet-vlan function ,
ip-subnet-vlan enable
- Huawei device ports are in hybrid mode by default, and only vlan1 data is allowed , so you need to pay attention to configuring the allowed vlan.
Configuration command: (configure the binding between host 192.168.1.3 and vlan under vlan10)
vlan 10
ip-subnet-vlan ip 192.168.1.3 32
interface Ethernet0/0/4
port hybrid untagged vlan 10 # 因为默认hybrid不放行vlan10
ip-subnet-vlan enable # 开启ip-subnet-vlan功能
4. Based on agreement division
Brief description : Set the protocol to bind with Vlan, and when the specified protocol enters, it will be marked with the corresponding VLAN tag (too little use, no in-depth understanding)
Precautions:
- Protocol binding in VLAN mode
- Enable the protocol-vlan function on the interface
Configuration command:
vlan 10
protocol-vlan ipv4
interface Ethernet0/0/11
protocol-vlan vlan 10 all
Five, based on strategy division
Brief description : Specify MAC, IP, and ports through policies , and divide VLANs only when network devices meet all conditions .
Precautions:
- Policy configuration in VLAN mode
- It is not necessary to enable the mac-vlan and ip-subnet-vlan functions under the interface . If it is a mixed configuration, it can also be configured without being affected.
- Huawei device ports are in hybrid mode by default, and only vlan1 data is allowed , so you need to pay attention to configuring the allowed vlan.
Configuration command:
vlan 10
policy-vlan mac-address 5489-989A-779B ip 192.168.1.4 interface e0/0/2
interface Ethernet0/0/2
port hybrid untagged vlan 10