System Administration Guide: Network Interfaces and Network Virtualization

ProcedureHow to Configure a VLAN

Before You Begin

Data links must already be configured on your system before you can create VLANs. See How to Configure an IP Interface After System Installation.

  1. On the system in which you configure VLANs, assume the Primary Administrator role, or become superuser.

    The Primary Administrator role includes the Primary Administrator profile. To create the role and assign the role to a user, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Determine the types of links that are in use in your system.


    # dladm show-link
    
  3. Create a VLAN link over a data-link.


    # dladm create-vlan -l link -v VID vlan-link
    
    link

    Specifies the link on which the VLAN interface is being created.

    VID

    Indicates the VLAN ID number

    vlan-link

    Specifies the name of the VLAN, which can also be an administratively-chosen name.

  4. Verify the VLAN configuration.


    # dladm show-vlan
    
  5. Configure an IP interface over the VLAN.


    # ifconfig interface plumb IP-address up
    

    where interface takes the same name as the VLAN name.


    Note –

    You can assign IPv4 or IPv6 addresses to the VLAN's IP interface.


  6. (Optional) To make the IP configuration for the VLAN persist across reboots, create an /etc/hostname.interface file to contain the interface's IP address.

    The interface takes the name that you assign to the VLAN.


Example 5–1 Configuring a VLAN

This example configures the VLAN sales over the link subitops0. The VLAN is configured to persist across reboots.


# dladm show-link
LINK        CLASS     MTU     STATE     OVER
subitops0   phys      1500    up        --
ce1         phys      1500    up        --

# dladm create-vlan -l subitops0 -v 7 sales
# dladm show-vlan
LINK       VID     OVER        FLAGS
sales      7       subitops0   ----

When link information is displayed, the VLAN link is included in the list.


# dladm show-link
LINK          CLASS    MTU      STATE     OVER
subitops0     phys     1500     up        --
ce1           phys     1500     up        --
sales         vlan     1500     up        subitops0

# ifconfig sales plumb 10.0.0.3/24 up
# echo 10.0.0.3/24 > /etc/hostname.sales