Configuration Examples

Example: Creating a VLAN Name

Thisexample shows how to create Ethernet VLAN 20, name it test20, and add it to the VLAN database:
Switch# configure terminal
Switch(config)# vlan 20
Switch(config-vlan)# name test20
Switch(config-vlan)# end
Related Topics
Creatingor Modifying anEthernet VLAN, on page47
Normal-RangeVLAN Configuration Guidelines, on page44

Example: Configuring a Port as Access Port

Thisexample shows how to configure a port as an access port in VLAN 2:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface gigabitethernet2/0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 2
Switch(config-if)# end
Related Topics
AssigningStatic-Access Ports toa VLAN, onpage 50

Example: Creating an Extended-Range VLAN

Thisexample shows how to create a new extended-range VLAN with all default characteristics, enter VLAN
configurationmode, and save the new VLAN in the switch startup configuration file:
Switch(config)# vtp mode transparent
Switch(config)# vlan 2000
Switch(config-vlan)# end
Switch# copy running-config startup config
Related Topics
Creatingan Extended-RangeVLAN, on page 52
Extended-RangeVLAN Configuration Guidelines, on page45
Catalyst 2960-XR Switch VLAN Configuration Guide, Cisco IOS Release 15.0(2)EX1
OL-29440-01 57
Configuring VLANs
Configuration Examples