The following procedure shows how to create and configure a VLAN. In this Solaris release, all Ethernet devices can support VLANs. However, some restrictions exist with certain devices. For these exceptions, refer to VLANs on Legacy Devices.
Data links must already be configured on your system before you can create VLANs. See How to Configure an IP Interface After System Installation.
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.
Determine the types of links that are in use in your system.
# dladm show-link |
Create a VLAN link over a data-link.
# dladm create-vlan -l link -v VID vlan-link |
Specifies the link on which the VLAN interface is being created.
Indicates the VLAN ID number
Specifies the name of the VLAN, which can also be an administratively-chosen name.
Verify the VLAN configuration.
# dladm show-vlan |
Configure an IP interface over the VLAN.
# ifconfig interface plumb IP-address up |
where interface takes the same name as the VLAN name.
You can assign IPv4 or IPv6 addresses to the VLAN's IP interface.
(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.
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 |