What is L2 Network?
An L2 network is a layer 2 broadcast domain used for layer
2 isolation. Generally, L2 networks are identified by names of devices on the
physical network.
- VLAN, VXLAN, and SDN can be used as an L2 network.
- An L2 network is used to provide layer 2 isolation for an L3 network.
L2 Network Types
An L2 network supports mainly four types.
Note:
- VxlanNetworkVxlanNetwork indicates that a VXLAN network is created by using the VNI specialized by VxlanNetworkPool of the Software SDN type.
- To create a VxlanNetwork, make sure that a VxlanNetworkPool of the software SDN type is available.
- Each VxlanNetwork corresponds to a VNI specialized by a VxlanNetworkPool of the Software SDN type.
- A VxlanNetwork is a logical L2 network that is encapsulated on a physical L3 network by using UDP.
- A VxlanNetwork can overlay across physical L3 networks.
- A VxlanNetwork encapsulates broadcast packets and multicast packets by using an IP multicast.
- A VxlanNetwork has a 24-bit VXLAN network identifier (VNI), and supports a maximum of 16 million VXLANs.
- A VxlanNetwork can be used to create an L3 network.
- L2NoVlanNetworkNoVlanNetwork indicates that you do not need to set VLAN on the NIC of the corresponding host.
- If you set VLAN for the switch port connected by the host, set the switch to Access mode.
- If you did not set VLAN for the switch connected by the host, do not make any operation.
- If you create an L2 network, note that a bridge will be created according to the NIC name that you entered.
- L2VlanNetworkL2VlanNetwork indicates that you need to set VLAN on the NIC of the corresponding host.
- The switch connected by the host must be in Trunk mode, and the Trunk VLAN must contain the VLAN ID that you are using.
- An L2VlanNetwork is a logical division of virtual LANs and supports 1-4094 subnets.
- If you create an L2 network, note that a VLAN device will be created according to the NIC name that you entered. In addition, a bridge will be created according to the VLAN device.
- HardwareVxlanNetworkHardwareVxlanNetwork indicates that a VXLAN network is created by using the VNI specialized by VxlanNetworkPool of the Hardware SDN type.
- To create a HardwareVxlanNetwork, make sure that a VxlanNetworkPool of the Hardware SDN type is available.
- Each HardwareVxlanNetwork corresponds to a VNI specified by VxlanNetworkPool of the Hardware SDN type.
- A HardwareVxlanNetwork is a logical L2 network that is encapsulated on a physical L3 network by using UDP.
- A HardwareVxlanNetwork can overlay across L3 networks.
- A HardwareVxlanNetwork encapsulates broadcast packets and multicast packets by using an IP multicast.
- A HardwareVxlanNetwork can be used to create an L3 network.

- When you add a NoVlanNetWork or VlanNetwork, enter the NIC name.
- In CentOS 7, the NIC name in the ethX format will be changed after the system reboots. In addition, the NIC sequence will also be randomly changed. We recommend that you change the NIC name of each compute node (especially for VM instances with multiple NICs) to a non-ethX format, such as em01.
L2 Network | Cluster | L3 Network | VM Instance
The relationship between an L2 network and a cluster, an L3 network, a VM instance is
as follows:
- If you attached an L2 network to a cluster whereas the L2 network was not attached to a host, you could not add the host to the cluster.
- If you did not attach an L2 network to a cluster and the L2 network was not attached to a host, you could not attach the L2 network to the cluster.
- If you attached an L2 network to a host whereas the corresponding L2 network devices were inconsistently connected to other hosts in a cluster, note that the VM IP that you created would not work properly.
- You can use one L2 network to create multiple child L3 networks. The private network created from a HarewareVxlanNetwork supports only flat network services. VPC networks cannot be created from a HarewareVxlanNetwork.
- If you delete an L2 network, note that the corresponding L3 networks and VM NICs that are using these networks will also be deleted.
- If you delete an L2 network, you will also delete the VPC vRouter and vRouter offering in the L2 network.
- If you delete an L2 public network, note that all network services that are using the network, such as VPC vRouter, vRouter offering, VIP, EIP, port forwarding, load balancing, IPsec tunnel, and Netflow will also be deleted.
- You can create multiple VxlanNetworks by using a VXLAN Pool of the Software SDN type. These VxlanNetworks can be applied to flat networks and VPC networks, respectively.
- VM instances in a VxlanNetwork cannot be accessed through the Internet. To access these VM instances through the Internet, use an EIP or port forwarding.
- You can also create multiple HardwareVxlanNetworks by using a VXLAN Pool of the Hardware SDN type. These HardwareVxlanNetworks can currently be applied to flat networks.