Go to main content

Managing Network Datalinks in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

Modifying VLANs

    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

Modifying the VLAN ID of a VLAN

    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.


    Note -  This syntax is valid if only a single VLAN exists on the datalink. Otherwise, use the second syntax.

    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

Migrating a VLAN to Another Underlying Link

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.


Note -  A migrated VLAN does not retain any of its hardware lane statistics from the original datalink. Available hardware lanes for the VLAN on the target datalink become the new source of statistics information. However, software statistics that are displayed by default by the dlstat command are preserved.

You can perform a VLAN migration either globally or selectively.

Global Migration

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
–l

Refers to the target datalink to which the VLANs are migrated.

–L

Refers to the original datalink over which the VLANs are configured.


Note -  You must specify the target datalink before the source datalink.

Selective Migration

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

Note -  When migrating VLANs selectively, do not include the –L option, which applies only to global migration.

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

Note -  A parallel command, dladm modify-vnic, migrates VNICs that are configured as VLANs. You must use the correct subcommand depending on the object you are modifying. See the next example. Refer also to Modifying the VLAN IDs of VNICs in Managing Network Virtualization and Network Resources in Oracle Solaris 11.4.
Example 20  Modifying the VLAN ID of a VLAN VNIC in a Zone

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