In this post we describe the set of tested and working cisco switch VLAN (Virtual LAN) command line options . This post covers the following topics
- Creating a VLAN
- Assigning a IP address or Switch Virtual Interface(SVI) to VLAN
- Assigning a specific switch port to VLAN
- Assigning a port range to VLAN
- View VLAN properties
- Delete a created VLAN
Creating a VLAN and Assigning IP address (SVI)
Switch1#config t
Switch1(config)#int
vlan 100 ( or just vlan 100 )
Switch1(config-if)#description ShareoLite
Switch1(config-if)#no
shut
Switch1(config-if)#ip
address 10.1.1.1 255.255.255.0
Assigning a specific port to VLAN
Switch1(config)#interface
f2/0/1
Switch1(config-if)#switch
access vlan 100
Switch1(config-if)#no
shut
Switch1(config-if)#^Z
Assigning a port range to VLAN
Switch1(config)#interface range f2/0/1-16
Switch1(config-if-range)#switch
access vlan 100
Switch1(config-if-range)#no
shut
Switch1(config-if-range)#^Z
View VLAN details
Switch1#show
vlan
VLAN
Name
Status Ports
----
-------------------------------- --------- -------------------------------
1 default active Fa2/0/33, Fa2/0/34, Fa2/0/35
Fa2/0/36, Fa2/0/37, Fa2/0/38
Fa2/0/39, Fa2/0/40, Fa2/0/41
Fa2/0/42,
Fa2/0/43, Fa2/0/44
Fa2/0/45, Fa2/0/46, Fa2/0/47
Fa2/0/48, Gi2/0/1, Gi2/0/2
Gi2/0/3, Gi2/0/4
100 Shareolite active Fa2/0/1, Fa2/0/2, Fa2/0/3
Fa2/0/4, Fa2/0/5, Fa2/0/6
Fa2/0/7, Fa2/0/8, Fa2/0/9
Fa2/0/10, Fa2/0/11, Fa2/0/12
Fa2/0/13, Fa2/0/14, Fa2/0/15
Fa2/0/16
Switch1#show
ip interface brief
Interface IP-Address OK? Method Status Protocol
Vlan1 192.168.1.1 YES manual up down
Vlan100 10.1.1.1 YES manual up down
Switch1#show interfaces
Vlan1
is up, line protocol is up
Hardware is EtherSVI, address is
001c.8fb8.a2c0 (bia 001c.8fb8.a2c0)
Internet address is 192.168.1.1/24
MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
reliability 255/255, txload 1/255, rxload
1/255
Encapsulation ARPA, loopback not set
Keepalive not supported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:00, output
hang never
Last clearing of "show interface"
counters never
Input queue: 0/75/0/0
(size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 3000 bits/sec, 5
packets/sec
5 minute output rate 0 bits/sec, 0
packets/sec
2302 packets input, 181693 bytes, 0 no
buffer
Received 0 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun,
0 ignored
393 packets output, 34505 bytes, 0
underruns
0 output errors, 2 interface resets
0 output buffer failures, 0 output buffers
swapped out
Delete/Remove a VLAN and its IP details (SVI)
Switch1#config t
Switch1(config)#int vlan 100
Switch1(config)#shut
Switch1#config t
Switch1(config)#no vlan 100
Hope this is useful to VLAN command line beginners.