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.
Before You Begin
Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.
$ dladm show-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.
$ dladm show-vlan
$ ipadm create-ip interface
interface is the interface name, which typically follows the VLAN name.
$ ipadm create-addr -a address interface
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
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