switchport mode access
Switchport mode access
The switchport mode command allows us to configure the trunking operational mode on a Layer 2 interface on a Cisco IOS device. By entering the command switchport mode access we configure the interface to operate in access mode. This ensures that the interface will pass traffic for a single VLAN only. In access mode, the interface will not tag an outgoing ethernet frame with an 802.1Q VLAN ID tag. It will also discard received frames that are tagged with a VLAN ID.
Let's take a look at an example:
access | Set trunking mode to ACCESS unconditionally | |
dynamic | Set trunking mode to dynamically negotiate access or trunk mode | |
trunk | Set trunking mode to TRUNK unconditionally |
The context sensitive help shows us that the options for the switchport mode command include:
- access
- dynamic
- trunk
We can use this command to set the interface to operate in access mode as follows:
access | Set trunking mode to ACCESS unconditionally | |
dynamic | Set trunking mode to dynamically negotiate access or trunk mode | |
trunk | Set trunking mode to TRUNK unconditionally |
The switchport mode access command is usually followed by the command switchport access vlan. This command specifies which VLAN the interface belongs to. If this command is omitted when an interface is statically set to access mode, the interface is assigned to the default VLAN - VLAN 1.
VLANs, trunking, VLAN tagging and inter-vlan routing are covered comprehensively in the following interactive course: Course 5 - VLANs & Trunks. The course features visual, animated explanations and hands-on interactive labs.
Want to test your networking skills with hands-on configuration and troubleshooting questions? Try out the Workshops section of this website here: Workshops (Login required).
Read how to use the device simulators on this website here: Workshops - General Instructions