System Administration Guide: Network Interfaces and Network Virtualization

Performing Other Administrative Tasks on VLANs

This section describes the usage of new dladm subcommands for other VLAN tasks. These dladm commands also work with link names.

ProcedureHow to Display VLAN Information

  1. Assume the System Administrator role or become superuser.

    The System Administrator role includes the Network Management profile. To create the role and assign the role to a user, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.

  2. Display VLAN information.


    # dladm show-vlan [vlan-link]
    

    If you do not specify a VLAN link, the command displays information about all configured VLANs.


Example 5–2 Displaying VLAN Information

The following example shows the available VLANs in a system.


# dladm show-vlan
LINK          VID     OVER        FLAGS
sales         7       subitops0   ----
managers      5       net0        ----

Configured VLANs also appear when you issue the dladm show-link command. In the command output, the VLANs are appropriately identified in the CLASS column.


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

ProcedureHow to Remove a VLAN

  1. Assume the System Administrator role or become superuser.

    The System Administrator role includes the Network Management profile. To create the role and assign the role to a user, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.

  2. Determine which VLAN you want to remove.


    # dladm show-vlan
    
  3. Unplumb the VLAN's IP interface.


    # ifconfig vlan-interface unplumb
    

    where vlan-interface is the IP interface that is configured over the VLAN.


    Note –

    You cannot remove a VLAN that is currently in use.


  4. Remove the VLAN by performing one of the following steps:

    • To delete the VLAN temporarily, use the -t option as follows:


      # dladm delete-vlan -t vlan
      
    • To make the deletion persist, perform the following:

      1. Remove the VLAN.


        # dladm delete-vlan vlan
        
      2. Remove the /etc/hostname.vlan-interface file.


Example 5–3 Removing a VLAN


# dladm show-vlan
LINK       VID     OVER          FLAGS
sales      5       subitops0     ----
managers   7       net0          ----

# ifconfig managers unplumb
# dladm delete-vlan managers
# rm /etc/hostname.managers