You can configure multiple virtual networks within a single network unit such as a switch by combining VLANs and Oracle Solaris Zones. The following figure shows a system with net0 as the physical interface. ZoneA, ZoneB, and ZoneC are configured in the system with VLAN IDs, 101, 102, and 103 assigned to each of the zones respectively.
Figure 10 VLANs With Zones
You create a VNIC datalink by using the dladm create-vnic command. You create a VLAN datalink by using the dladm create-vlan command.
To see how to configure VLANs as shown in the figure, refer to Example 16, Configuring VLANs With Zones. For more information about VLAN VNICs, see How to Configure VNICs as VLANs in Managing Network Virtualization and Network Resources in Oracle Solaris 11.3 and Modifying the VLAN IDs of VNICs in Managing Network Virtualization and Network Resources in Oracle Solaris 11.3.
In addition to the VNICs that can be created inside a kernel zone, you can create VNICs to be on a VLAN of a Oracle Solaris Kernel Zone. These VNICs are a part of the same L2 broadcast domain as that of a kernel zone. Oracle Solaris Kernel Zones are VLAN-aware for the Ethernet-based anets.
In Oracle Solaris, a VLAN datalink is configured by creating a VNIC with the desired VLAN ID. An implicit virtual switch is created when a VNIC is created. The virtual switch inserts and strips the tags for the VNIC. This VID associated with the VNIC is called the port VID (PVID) and it signifies the VLAN to which the VNIC belongs to in an untagged mode. You can specify the PVID by using anet:vlan-id property. In addition, to support multiple VLANs for Oracle Solaris kernel zone network, you can also specify additional VLAN IDs per anet, so that the virtual switch in the host can be configured. The VLAN IDs and the configured MAC addresses for each anet enable switch frames to enter in and go out of kernel zone.
For more information, see Configuring Virtual LANs in Kernel Zones in Creating and Using Oracle Solaris Kernel Zones.
To identify the VLANs that can be created on the datalink, you can use the dladm show-phys -v command. For an example, see Example 18, Displaying the VLAN IDs That Can be Created on the Datalinks.
In most of the deployments, the values of MAC addresses and VLAN IDs in a kernel zone can be statically configured before the zone is booted. However, in certain deployments such as a cloud deployment, the values of MAC address and VLAN IDs that the kernel zone needs to use are priorly not known. In such cases, you can specify prefixes of allowed MAC addresses and ranges of allowed VLAN IDs to enable the kernel zone to communicate to the global host about the MAC address and VLAN IDs that the kernel zone needs to use when it boots. This enables the kernel zone to create a VNIC with any valid MAC address or VLAN ID.
To identify the MAC address prefixes and VLAN IDs that are allowed, you can use the dladm show-phys command with –o option by using the fields allowed-addresses and allowed-vids. For an example to show the allowed addresses and VLAN IDs, see Example 19, Viewing the Allowed MAC Addresses and Allowed VLAN IDs.
For more information about configuring the VLAN ID in kernel zones, see Using Dynamic MAC Addresses and VLAN IDs in Kernel Zones in Creating and Using Oracle Solaris Kernel Zones.