vlan access
Syntax
vlan access <VLAN-ID>
no vlan access [<VLAN-ID>]
Description
Creates an access interface and assigns an VLAN ID to it. Only one VLAN ID can be assigned to each access interface.
VLANs can only be assigned to a non-routed (layer 2) interface or LAG interface. By default, all interfaces are routed (layer 3) when created. Use the
no routing
command to disable routing on an interface and change the interface to a layer 2 interface.
The
no
form of this command removes an access VLAN from the interface in the current context and sets it to the default VLAN ID of 1.
Command context
config-if
Parameters
<VLAN-ID>
Specifies the number of the VLAN ID to assign. The VLAN ID must exist. Range: 1 - 4040.
Authority
Administrators
Examples
Configuring interface 1/1/2 as an access interface with VLAN ID set to 20:
switch(config)# interface 1/1/2 switch(config-if)# no routing switch(config-if)# vlan access 20
Removing VLAN ID 20 from interface 1/1/2:
switch(config)# interface 1/1/2 switch(config-if)# no vlan access 20
or:
switch(config)# interface 1/1/2 switch(config-if)# no vlan access