Static VLANs
#Create VLANs
Switch(config)# vlan 50
Switch(config-vlan)# name ROOM50
Switch# vlan database
Switch(vlan)# vlan 50 name ROOM50
VLAN 50 added:
Name: ROOM50
#Assign switch port to the VLAN
Switch(config)# interface fastEthernet 1/0
Switch(config-if)# switchport
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 50
Switch# show vlan | include Fa1/0
50 ROOM50 active Fa1/0
Switch# show vlan-switch | include Fa1/0
50 ROOM50 active Fa1/0
Switch# show interfaces status | include 1/0
Port Name Status Vlan Duplex Speed Type
Fa1/0 PRINTER IN BLDG B, disabled 50 half 10 10/100BaseTX
Dinamic VLANs
#VMPS Configuration on Switch
!
vlan 10
name IT
!
vtp domain mydomain
!
vmps server 192.168.3.2 primary
vmps reconfirm 60
vmps retry 3
!
interface fastethernet 0/1
switchport mode access
switchport access vlan dynamic
no shutdown
*Note: When a port is configured as dynamic, the spanning-tree portfast feature is automatically configured on the port.
A sample VMPS Server Database (vlan.db) file looks like this:
#VMPS Server Configuration
!
vmps domain mydomain ! The VTP domain on the Client switch should match this domain name
vmps mode open ! This can be either Open or Secure mode
! vmps fallback <vlan-name> ! Fallback VLAN in case no MAC address-to-VLAN match is made
! vmps no-domain-req { allow | deny }
!
vmps-mac-addrs
address 0022.19df.9252 vlan-name IT
!
vmps-port-policies vlan-name IT
device 192.168.100.10 port Fa 0/1 ! Device is the Switch here
!
#Verification:
Switch# show vmps
VQP Client Status:
--------------------
VMPS VQP Version: 1
Reconfirm Interval: 60 min
Server Retry Count: 3
VMPS domain server: 192.168.3.2 (primary, current)
Reconfirmation status
---------------------
VMPS Action: Success
Switch# show vlan | include IT
10 IT active Fa0/1
#Trunk Configuration
Switch(config)# interface fastEthernet 1/1
Switch(config-if)# switchport
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport trunk native vlan 10
Switch(config-if)# switchport trunk allowed vlan 1,1002-1005,20,50 ! (1,1002-1005 Reserved)
Switch(config-if)# switchport nonegotiate ! Do not send or respond to DTP from this end
*Tricks
Switch(config-if)# switchport trunk allowed vlan 10-12,14-15
Or
Switch(config-if)# switchport trunk allowed vlan 10-15
Switch(config-if)# switchport trunk allowed vlan remove 13
#Troubleshooting VLANs and Trunks
#Determining Switch Port Trunking Status
Switch# show interfaces fastEthernet 1/1 trunk
Port Mode Encapsulation Status Native vlan
Fa1/1 on 802.1q not-trunking 10
#Determining Switch Port Status
Switch# show interfaces status
Port Name Status Vlan Duplex Speed Type
Fa1/0 PRINTER IN BLDG B, disabled 50 half 10 10/100BaseTX
#Verifying Switch VLAN Configuration
Switch# show vlan-switch id 50
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
50 ROOM50 active Fa1/0
#Comparing Switch Port Trunking Configuration and Active State
Switch#show interfaces fastEthernet 1/1 switchport
Name: Fa1/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: down
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 10 (MGM)
Trunking VLANs Enabled: 1,20,50,1002-1005
Trunking VLANs Active: none
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
Switch(config-if)# do show run inter fa 1/1
!
interface FastEthernet1/1
switchport trunk native vlan 10
switchport trunk allowed vlan 1,20,50,1002-1005
switchport mode trunk
shutdown
end