Configuring VLANs in VMware ESXi
To configure VLANs in VMware ESXi 6.0, perform the following steps. Ensure that you have installed VMware ESXi 6.0 and NIC drivers on the server, and installed the vSphere Client on a PC as the management terminal.
- On the System Customization screen, select Configure Management Network. On the Configure Management Network screen, select Network Adapters. The physical ports on the MZ522 are displayed.Figure 4-228 MZ522 physical ports displayed in VMware ESXi
- On the Network Adapters screen, select the four vmnics, which map to the four physical ports on the MZ522 respectively, and specify a vmnic for connecting to the management network, as shown in Figure 4-229. In Figure 4-229, [X] indicates that the two vmnics can all be used to connect to the management network. The hypervisor (ESXi) chooses a vmnic as the default management network port for connecting to the management network. The management network port is changeable. Press Enter to confirm the settings, and return to the Configure Management Network screen.
The management network refers to the PC running the vSphere Client. Actually, the vmnic is also used to connect to the service network.
- On the Configure Management Network screen, select IPv4 Configuration and press Enter to go to the IPv4 Configuration screen, as shown in Figure 4-230. The IP addresses are assigned to the default port vmnics first, for example, vmnic 0 and vmnic 1. The IP addresses must be on the same network segment as the IP address of the NIC on the PC so that ESXi can communicate with the vSphere Client. Press Enter to confirm the settings, and return to the Configure Management Network screen.
VLAN (Optional) on the Configure Management Network screen is an optional parameter. Configure a VLAN for the vmnic, which is to assign a PVID to the MZ522 port. You do not need to configure a VLAN for the management network connection.
- Run the vSphere Client, click the Configuration tab, click Network, and then click Properties. The vSwitch0 Properties window is displayed. Click Add to create a virtual port group, select VM, and specify the group name in Network Label, as shown in Figure 4-231 and Figure 4-232.
Because you have selected vmnic 0 and vmnic 1 on the Network Adapters screen in ESXi, the VM Network2 virtual port group created in Figure 4-231 can be associated with the two ports.
- Set a VLAN ID in the virtual port group.
A virtual port group is used for the service network. You can specify a VLAN ID for a virtual port group. The VLAN ID can be 0 (no VLAN), 4095 (all VLANs), or an integer from 1 to 4094. The value 0 indicates the EST mode, that is, the virtual port group is untagged, and the peer device (generally a switch) sets the VLAN ID. The value 4095 indicates the VGT mode, which enables the virtual port group to allow packets with any VLAN ID to pass through, similar to a switch trunk port. You must configure VLANs for the VM OS. The virtual port group does not process the VLAN tags of packets but transparently transmits the packets. An integer from 1 to 4094 indicates the VST mode. A PVID is set for the virtual port group, and the PVID is automatically added to untagged packets before the packets are forwarded to the external network. If the virtual port group receives packets with the VLAN tag that is the same as the PVID, it removes the VLAN tag and then forwards the packets to the destination VM. After setting the VLAN ID, click Next and then click Finish. See Figure 4-233.
Figure 4-234 shows the virtual port group whose VLAN ID has been set.