Go to main content

Managing Network Datalinks in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

Configuring a VLAN

The following procedure describes how to create a VLAN over a datalink.

For more technical details about the commands you use to configure VLANs, refer to the dladm(8) and ipadm(8) man pages.

How to Configure a VLAN

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. Determine the types of links that are in use on the system.
    $ dladm show-link
  2. Create a VLAN link over a datalink.
    $ 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.

  3. Verify the VLAN configuration.
    $ dladm show-vlan
  4. Create an IP interface over the VLAN.
    $ ipadm create-ip interface

    interface is the interface name, which typically follows the VLAN name.

  5. Configure the IP interface with an IP address.
    $ ipadm create-addr -a address interface
Example 14  Creating a VLAN

This example shows how to create the VLAN configuration that is illustrated in Local Area Network With Three VLANs.

$ dladm show-link
LINK     CLASS     MTU     STATE     OVER
net0     phys      1500    up        --         
net1     phys      1500    up        --        
net2     phys      1500    up        --

The following steps are performed on specified hosts:

  • Host A:

    $ dladm create-vlan -l net0 -v 123 infotech0
    $ ipadm create-ip infotech0
    $ ipadm create-addr -a IP-addr infotech0
  • Host C:

    $ dladm create-vlan -l net0 -v 123 infotech0
    $ ipadm create-ip infotech0
    $ ipadm create-addr -a IP-addr infotech0
  • Host F:

    $ dladm create-vlan -l net0 -v 456 humres0
    $ ipadm create-ip humres0
    $ ipadm create-addr -a IP-addr humres0
  • Host B:

    $ dladm create-vlan -l net0 -v 456 humres0
    $ ipadm create-ip humres0
    $ ipadm create-addr -a IP-addr humres0
  • Host D:

    $ dladm create-vlan -l net0 -v 789 acctg0
    $ ipadm create-ip acctg0
    $ ipadm create-addr -a IP-addr acctg0
  • Host E:

    $ dladm create-vlan -l net0 -v 789 acctg0
    $ ipadm create-ip acctg0
    $ ipadm create-addr -a IP-addr acctg0

    Note -  The IP addresses must be unique for each VLAN.

If you issue the command to list configured VLANs, each host would display a screen similar to the following:

$ dladm show-vlan
LINK           VID   SVID    PVLAN-TYPE   FLAGS    OVER        
infotech0      123    --       --         ----     net0  
humres0        456    --       --         ----     net0
acctg0         789    --       --         ----     net0