To add an interface to a VLAN, you use the vlan add command. As with the vlan create command, the vlan add
command creates a VLAN interface that must be configured using the
ifconfig command.
Step
- Enter the following command:
vlan add interface_name vlanid
interface_name
is the name of the network interface.
vlanid
is the VLAN
identifier to which the ifname interface belongs.
You can include a list of
VLAN identifiers.
Note: VLANs created using the vlan add commands are not
persistent across reboots unless the vlan commands are
added to the /etc/rc file.
Example of adding an interface to a VLAN
You can add VLANs with identifiers 40 and 50 on interface e4 of
a storage system using the following command:
vlan add e4 40 50
As a result, VLAN interfaces
e4-40 and e4-50 are created.