VLAN Commands 791
switchport forbidden vlan
Use the switchport forbidden vlan command in Interface Configuration
mode to forbid adding specific VLANs to a port. To revert to allowing the
addition of specific VLANs to the port, use the remove parameter of this
command.
Syntax
switchport forbidden vlan {add
vlan-list
| remove
vlan-list
}
add
vlan-list
— List of valid VLAN IDs to add to the forbidden list.
Separate nonconsecutive VLAN IDs with a comma and no spaces. Use a
hyphen to designate a range of IDs.
remove
vlan-list
— List of valid VLAN IDs to remove from the forbidden
list. Separate nonconsecutive VLAN IDs with a comma and no spaces. Use
a hyphen to designate a range of IDs.
Default Configuration
All VLANs allowed.
Command Mode
Interface Configuration (gigabitethernet, port-channel, tengigabitethernet)
mode
User Guidelines
This command has no user guidelines.
Example
The following example forbids adding VLAN numbers 234 through 256 to
port 1/0/8.
console(config)#interface gigabitethernet 1/0/8
console(config-if-1/0/8)#switchport forbidden vlan
add 234-256
2CSPC4.XCT-SWUM2XX1.book Page 791 Monday, October 3, 2011 11:05 AM