You can modify a VLAN by using the dladm modify-vlan command in the following ways:
Change the VLAN ID of a VLAN
Migrate a VLAN to another underlying link
To change the VLAN ID of a VLAN, use one of the following commands:
$ dladm modify-vlan -v vid -L datalink
vid specifies the new VLAN ID that you are assigning to the VLAN and datalink refers to the underlying link over which the VLAN is configured.
If you modify the VLAN ID on the link, you must also configure the switch port for the new VLAN ID.
$ dladm modify-vlan -v vid vlan
Use this command to change the unique VLAN IDs of multiple VLANs over a single datalink. Each VLAN on the datalink has a unique VLAN ID so you must change the VLAN IDs one at a time. In the setup shown in VLANs With Zones, you would change the VLAN IDs of web1, auth1, and as follows:
$ dladm modify-vlan -v 123 web1 $ dladm modify-vlan -v 456 app1 $ dladm modify-vlan -v 789 auth1
You can migrate a VLAN between underlying datalinks without needing to delete and reconfigure the VLAN. The underlying link can be a physical link, a link aggregation, or an etherstub. For more information about etherstubs, see Network Virtualization Components in Managing Network Virtualization and Network Resources in Oracle Solaris 11.4.
To successfully migrate a VLAN, the target underlying datalink must be able to accommodate the datalink properties of the VLAN. Otherwise, migration fails and the user is notified.
Certain hardware-dependent properties might change after a VLAN migration. For example, a VLAN always shares the same MAC address as its underlying datalink. Therefore, when you migrate a VLAN, the VLAN's MAC address changes to the primary MAC address of the target datalink. Other properties that might be affected are the datalink state, link speed, and MTU size. However, after a successful migration, all applications continue to operate normally without interruption.
You can perform a VLAN migration either globally or selectively.
Global migration moves all of the VLANs from one underlying datalink to another. You need to specify only the source and target datalinks.
$ dladm modify-vlan -l net1 -L ether0
Refers to the target datalink to which the VLANs are migrated.
Refers to the original datalink over which the VLANs are configured.
Selective migration is used to migrate only selected VLANs. To perform selective VLAN migration, you specify the VLANs that you want to move. In the following example, which is based on VLANs With Zones, VLANs are moved from net0 to net3.
$ dladm modify-vlan -l net3 web1,auth1,app1
You can change the VLAN IDs of VLANs while performing a migration. Using VLANs With Zones as the basis, the following example shows how you would migrate multiple VLANs and change their VLAN IDs at the same time.
$ dladm show-vlan LINK VID SVID PVLAN-TYPE FLAGS OVER web1 111 -- -- ----- net0 auth1 112 -- -- ----- net0 app1 113 -- -- ----- net0 $ dladm modify-vlan -l net3 -v 123 web1 $ dladm modify-vlan -l net3 -v 456 auth1 $ dladm modify-vlan -l net3 -v 789 app1 $ dladm show-vlan LINK VID SVID PVLAN-TYPE FLAGS OVER web1 123 -- -- ----- net3 auth1 456 -- -- ----- net3 app1 789 -- -- ----- net3
You can modify the VLAN ID of a VLAN VNIC when you need to move one VLAN to another. For example, if any department that shared a VLAN with another department needs to move to its own newly configured VLAN, the VLAN ID of the VLAN VNICs need to be modified. The following example shows how to modify VLAN IDs of VLAN VNICs assigned to zones. It is based on the configuration in Example 16, Configuring VNICs as VLANs for Zones, where 3 zones are each configured with a VNIC as follows:
solaris:~$ dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE IDS ZoneA/vnic1 net0 1000 2:8:20:47:8c:85 random VID:101 ZoneB/vnic2 net0 1000 2:8:20:47:8c:85 random VID:102 ZoneC/vnic3 net0 1000 2:8:20:47:8c:85 random VID:103
To move the zones' VLANs, you would proceed as follows:
usr@solaris:~$ dladm modify-vnic -v 221 -L vnic1 usr@solaris:~$ dladm modify-vnic -v 222 -L vnic2 usr@solaris:~$ dladm modify-vnic -v 223 -L vnic3 usr@solaris:~$ dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE IDS ZoneA/vnic1 net0 1000 2:8:20:47:8c:85 random VID:221 ZoneB/vnic2 net0 1000 2:8:20:47:8c:85 random VID:222 ZoneC/vnic3 net0 1000 2:8:20:47:8c:85 random VID:223