Cisco CCNA (200-301)Network AccessEasy
A network administrator is configuring a new Cisco Catalyst 2960 switch. They want to ensure that only VLANs 10, 20, and 30 are allowed to traverse a specific trunk interface, Gi0/1. Which of the following commands, executed on interface Gi0/1, will achieve this requirement?
- Aswitchport trunk allowed vlan add 10,20,30
- Bswitchport trunk allowed vlan 10,20,30
- Cswitchport mode trunk
- Dswitchport trunk native vlan 1
Show answer & explanationAnswer & explanation
Correct answer: B. switchport trunk allowed vlan 10,20,30
The 'switchport trunk allowed vlan' command is used to specify which VLANs are permitted to traverse a trunk link. Using 'add' would append to existing allowed VLANs, while the direct assignment overwrites them.
Why the other options are wrong
- A. This command adds VLANs to the currently allowed list, it does not restrict to only these VLANs by itself.
- C. This command configures the interface as a trunk port but does not restrict allowed VLANs.
- D. This command sets the native VLAN for the trunk, not the allowed VLANs.
Allowed VLANs on Trunk
On a Cisco switch, the 'switchport trunk allowed vlan' command controls which VLANs are permitted to traverse a trunk link.
- By default, all VLANs are allowed on a trunk.
- This command can filter traffic for security or performance.
- Use 'add', 'remove', or 'except' keywords for granular control.
Memory trick: Trunks are bridges, but sometimes you need a bouncer for the VLANs.