0

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:

en 
conf t. 
int range fa0/8, fa0/23-24, gi0/1-2
switchport mode trunk
switchport trunk allowed vlan remove 2-4094
end 
conf t 
int range fa0/1-7, fa0/9-22
switchport mode access 
end 
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

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

| improve this answer | |
3

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.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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