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, or SDN can be used as an L2 network and can provide layer 2 isolation.
  • An L2 network is used to provide layer 2 isolation for an L3 network, as shown in L2 Network.
Figure 1. L2 Network


Four Major Types of L2 Network

An L2 network supports mainly four types.
  1. L2NoVlanNetwork
    L2NoVlanNetwork indicates that VLAN settings are not used for connecting the corresponding host.
    • If you set VLAN for a switch port, make sure that the switch port is in Access mode.
    • If you do not set VLAN for the switch port, do not make any operation.
    • If you create an L2 network, note that a bridge will be created according to the network device that you have entered.
  2. L2VlanNetwork
    L2VlanNetwork indicates that VLAN settings are used for connecting the corresponding host.
    • The switch port connected by the host must be in Trunk mode.
    • The virtual LAN can be divided logically. Notice that it can support 1-4094 subnets.
    • If you create an L2 network, notice that a VLAN device will be created according to the network device that you have entered. In addition, a bridge will be created according to the VLAN device.
  3. VxlanNetwork
    VxlanNetwork indicates that the VXLAN network is created by using the VNI specialized by VxlanNetworkPool of the Software SDN type.
    • VxlanNetwork is created according to VxlanNetworkPool of the Software SDN type.
    • Each VxlanNetwork corresponds to a VNI specialized by VxlanNetworkPool of the Software SDN type.
    • VxlanNetwork can be used for creating an L3 network.
  4. HardwareVxlanNetwork
    HardwareVxlanNetwork indicates that the VXLAN network is created by using the VNI specialized by VxlanNetworkPool of the Hardware SDN type.
    • HardwareVxlanNetwork is created according to VxlanNetworkPool of the Hardware SDN type.
    • Each HardwareVxlanNetwork corresponds to a VNI specialized by VxlanNetworkPool of the Hardware SDN type.
    • HardwareVxlanNetwork can be used for creating an L3 network.
Note:
  • When you add 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.

Relationship Between L2 Network and Cluster/L3 Network/VM Instance

The relationship between L2 network and cluster/L3 network/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 instance IP that you created would not work normally.
  • You can use one L2 network to create multiple child L3 networks. If you select the HarewareVxlanNetwork L2 network to create a private network, you can only create a flat network and corresponding network services. vRouter network cannot be created by using the HarewareVxlanNetwork L2 network.
  • If you delete an L2 network, notice that the corresponding L3 network will also be deleted, and that the VM NIC in the L3 network will be deleted as well.
  • If you delete an L2 network, you will also delete the vRouter, VPC vRouter, and vRouter offering in the L2 network.
  • If you delete the corresponding L2 network of a public network, notice that all network services of the corresponding router will be deleted, including the vRouter, VPC vRouter, vRouter offering, virtual IP, elastic IP, port forwarding, load balancing, IPsec tunnel, and Netflow.
  • You can create multiple VxlanNetworks by using a VXLAN Pool of the Software SDN type. These VxlanNetworks can be applied to the flat network, vRouter network, or VPC network respectively.
  • VM instances in VxlanNetwork cannot be accessed through the Internet. To access these VM instances through the Internet, use an elastic IP 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.