Go to main content

Managing Network Virtualization and Network Resources in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

How to Configure VNICs as VLANs

You can configure VNICs with VLAN IDs to host VLAN traffic. As part of this configuration, you also set the link property vlan-announce to propagate the VLAN configurations of each individual VNIC to the network.

Unlike a regular VLAN link, the VNIC configured as a VLAN has its own MAC address. For information about regular VLANs, see Chapter 4, Configuring Virtual Networks by Using Virtual Local Area Networks in Managing Network Datalinks in Oracle Solaris 11.4.

This procedure contains only the steps to create the VNIC with a VLAN ID and to set the appropriate properties that enable the VNIC to service VLAN traffic. The intermediary ports and switches are automatically updated when you enable the vlan-announce property. However, you must still configure these intermediary ports and switches must be separately to define VLANs at these points.

Before You Begin

Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.

  1. Create a VNIC with a VLAN ID.
    $ dladm create-vnic -l link -v vid VNIC

    vid refers to the VLAN ID of the VNIC.

  2. (Optional) Broadcast the VNIC's VLAN configuration to the network.
    $ dladm set-linkprop -p vlan-announce=gvrp link

    This step enables a GARP VLAN Registration Protocol (GVRP) client system that automatically registers VLAN IDs with attached switches. By default, the vlan-announce property is set to off and no VLAN broadcast messages are sent to the network. After you set the property to gvrp, the VLAN configuration for that link is propagated to enable automatic VLAN port configuration of the network devices. VLAN traffic can then be accepted and forwarded by these devices. For more information about GVRP, see "Configuring GVRP in Sun Ethernet Fabric Operating System, VLAN Administration Guide.

  3. (Optional) Set the gvrp-timeout property to configure the wait period between VLAN broadcasts.
    $ dladm set-linkprop -p gvrp-timeout=time link

    The default value is 250 milliseconds. A system with a heavy load might require a shorter interval when rebroadcasting VLAN information.

  4. (Optional) Display the value of the properties vlan-announce and gvrp-timeout.
    $ dladm show-linkprop -p vlan-announce,gvrp-timeout
Example 3  Configuring a VNIC as a VLAN

This example shows how to create a VNIC named vnic0 on the datalink net0 with a VLAN ID 123 and how to enable the VLAN configuration to be announced to the network.

$ dladm create-vnic -l net0 -v 123 vnic0
$ dladm set-linkprop -p vlan-announce=gvrp net0
$ dladm set-linkprop -p gvrp-timeout=250 net0
$ dladm show-linkprop -p vlan-announce,gvrp-timeout net0
LINK     PROPERTY        PERM   VALUE     EFFECTIVE    DEFAULT   POSSIBLE
net0     vlan-announce   rw     gvrp      gvrp         off       off,gvrp
net0     gvrp-timeout    rw     250       250          250       100-100000

The output shows the following information:

LINK

Physical datalink, identified by a name.

PROPERTY

Property of the link. A link can have several properties.

PERM

Permissions of the property, which can be either read-only or read-write.

VALUE

Current (or persistent) link property value. If the value is not set, it is shown as --. If it is unknown, the value is shown as ?.

DEFAULT

Default value of the link property. If the link property has no default value, -- is shown.

POSSIBLE

A comma-separated list of the values that the link property can have. If the possible values are unknown or unbounded, -- is shown.