I am completing an online course for the network+ and am going through one of the labs. Here is a diagram of the network in question. enter image description here

Specifically I have a switch with 24 fast ethernet ports and 2gigabit ports and the tasks mentioned are to do the following:

  • Manually designate ports fa0/8, fa0/23-24, gi0/1-2 as trunk ports.
  • For each trunk port remove the current vlan assignment
  • Manually configure the remaining ports as access ports.
  • save the changes in the startup config file.

To achieve this I entered the following commands:

conf t. 
int range fa0/8, fa0/23-24, gi0/1-2
switchport mode trunk
switchport trunk allowed vlan remove 2-4094
conf t 
int range fa0/1-7, fa0/9-22
switchport mode access 
copy run start

The solution calls for using the code

no switchport access vlan 

instead of:

switchport trunk allowed vlan remove 2-4094

What is the difference(if any) between these 2 commands?

3 Answers 3


no switchport access vlan is used to reset the access-mode VLAN to the appropriate default VLAN for the switch. This default vlan can be defined by the administrator to be any value(which means it could be other than 1). Keep in mind that the concept of 802.1q tagging makes no sense for an access port.

switchport trunk allowed vlan remove 2-4094 allows traffic from vlan 1 ONLY to be sent across the link as tagged*(if vlan 1 is not native vlan) or untagged.

*Tagging: adding an identifier to frames to indicate what VLAN the frame belongs to


The instructions are ambiguous. Once the port is configured as a trunk, any access configuration statements are meaningless. If they want you to remove the now vestigial access mode configuration, that's what they should ask you to do. I would recommend getting in the habit of removing the access mode configuration(s) for trunk ports as a "Best Practice" to avoid any confusion and/or issues in the future.

"no switchport access vlan" simply returns the port's access vlan to the switch default. (usually "1") "switchport trunk allowed vlan remove 2-4094" removes all vlans from the trunk port. If the switch default vlan is not "1", the port will carry no traffic. Note, VLAN 1 cannot be removed from the port (or tagged) because of various link-layer protocols like spanning-tree. You can specify some other vlan to be the native (untagged) vlan, but "1" still cannot be removed. (I've always found that a rather annoying Cisco-ism.)


Access ports and trunk ports are two types of vlan passing technic on switching

Access ports carries single Vlan traffic . Access port are enable on switchports where end devices are connected .

Switch (config)#int f0/1 Switch(config)Switchport mode access Switch(config)#switchport access vlan 10 Switch(config)no shutdown

To disable access vlan Access use this command

Switch (config)#no switch access vlan 10

This above command disables single Vlan traffic on specific link

Trunk port

Configuring Switchport with trunk port enables to pass multiple VLANs trunk ports can be configured in between router to switches , switches to base servers

Switch(config)#int F0/1 Switch(config)#switchport mode trunk Switch(config)#switchport trunk allowed vlans all Switch(config)#no shutdown.

To disable trunkport configuration

Switch(config)#no switch trunk allowed vlans 10

This command will remove vlan10 traffic from trunk link

Switch (config)# no Switchport trunk allowed vlan all

This command stops multiple VLANs traffic fron trunk link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.