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
Where 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 app1 that are configured over net0 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 from one underlying datalink to another underlying datalink without deleting and reconfiguring 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.3.
To successfully migrate a VLAN, the underlying datalink to which the VLAN is moved must be able to accommodate the datalink properties of the VLAN. If those properties are not supported, then migration fails and the user is notified. After a successful migration, all the applications that use the VLAN continue to operate normally provided that the VLAN remains connected to the network.
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, applications continue to operate without interruption.
You can perform a VLAN migration either globally or selectively.
Global migration is used to migrate all of the VLANs that are configured over one datalink to another datalink. To perform a global migration, you need to specify only the source and target datalinks. The following example shows how to move all of the VLANs on ether0 to net1.
# 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. This example assumes that the zones are already configured in the system:
Create the VLAN VNICs over a specific link after checking for the availability of the links.
usr@solaris# dladm show-link LINK CLASS MTU STATE OVER net3 phys 1500 up -- net4 phys 1500 up -- net5 phys 1500 up -- usr@solaris# dladm create-vnic -v 121 -l net3 vnic1 usr@solaris# dladm create-vnic -v 122 -l net3 vnic2 usr@solaris# dladm create-vnic -v 123 -l net3 vnic3 usr@solaris# dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE IDS vnic1 net3 1000 2:8:20:35:b:9a random VID:121 vnic2 net3 1000 2:8:20:fa:94:57 random VID:122 vnic3 net3 1000 2:8:20:51:1c:4a random VID:123
When link information is displayed, the VLANs are included in the list.
usr@solaris# dladm show-link LINK CLASS MTU STATE OVER net0 phys 1500 up -- vnic1 vnic 1500 up net3 vnic2 vnic 1500 up net3 vnic3 vnic 1500 up net3
Specify the VLAN IDs 121, 122, and 123 to Zone1, Zone2, and Zone3 respectively.
usr@solaris# zonecfg -z Zone1 zonecfg:Zone1> add net zonecfg:Zone1:net> set physical=vnic1 zonecfg:Zone1:net> end zonecfg:Zone1> verify zonecfg:Zone1> commit zonecfg:Zone1> exit usr@solaris# zoneadm -z Zone1 apply usr@solaris# zonecfg -z Zone2 zonecfg:Zone2> add net zonecfg:Zone2:net> set physical=vnic2 zonecfg:Zone2:net> end zonecfg:Zone2> verify zonecfg:Zone2> commit zonecfg:Zone2> exit usr@solaris# zoneadm -z Zone2 apply usr@solaris# zonecfg -z Zone3 zonecfg:Zone3> add net zonecfg:Zone3:net> set physical=vnic3 zonecfg:Zone3:net> end zonecfg:Zone3> verify zonecfg:Zone3> commit zonecfg:Zone3> exit usr@solaris# zoneadm -z Zone3 apply
Display the VLAN VNICs assigned to the zones.
usr@solaris:~# dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE IDS vnic1 net3 1000 2:8:20:35:b:9a random VID:121 vnic2 net3 1000 2:8:20:fa:94:57 random VID:122 vnic3 net3 1000 2:8:20:51:1c:4a random VID:123 Zone1/vnic1 net3 1000 2:8:20:35:b:9a random VID:121 Zone2/vnic2 net3 1000 2:8:20:fa:94:57 random VID:122 Zone3/vnic3 net3 1000 2:8:20:51:1c:4a random VID:123
Modify the VLAN ID of the VLAN VNIC.
usr@solaris:~# dladm modify-vnic -v 221 vnic1 usr@solaris:~# dladm modify-vnic -v 222 vnic2 usr@solaris:~# dladm modify-vnic -v 223 vnic3
Display the modified VLAN IDs.
usr@solaris:~# dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE IDS vnic1 net3 1000 2:8:20:35:b:9a random VID:221 vnic2 net3 1000 2:8:20:fa:94:57 random VID:222 vnic3 net3 1000 2:8:20:51:1c:4a random VID:223 Zone1/vnic1 net3 1000 2:8:20:35:b:9a random VID:221 Zone2/vnic2 net3 1000 2:8:20:fa:94:57 random VID:222 Zone3/vnic3 net3 1000 2:8:20:51:1c:4a random VID:223