Home Cisco Vlan
Post
Cancel

Cisco Vlan

VLANS

VLAN Creation

1
2
Switch(config)# vlan 100 
Switch(config-vlan)# name Engineering

Access Port Configuration

1
2
3
4
Switch(config-if)# switchport mode access 
Switch(config-if)# switchport nonegotiate 
Switch(config-if)# switchport access vlan 100 
Switch(config-if)# switchport voice vlan 150

Trunk Port Config

1
2
3
4
Switch(config-if)# switchport mode trunk 
Switch(config-if)# switchport trunk encapsulation dot1q 
Switch(config-if)# switchport trunk allowed vlan 10,20-30 
Switch(config-if)# switchport trunk native vlan 10

SVI Config

1
2
Switch(config)# interface vlan100 
Switch(config-if)# ip address 192.168.100.1 255.255.255.0 

Note: A switch virtual interfaces (SVI) or VLAN interface, is a virtual routed interface that connects a VLAN on the device to the Layer 3 router engine on the same device.


VLAN Trunking (VTP)

1
2
3
4
Switch(config)# vtp mode {server | client | transparent} Switch(config)# vtp (domain) 
Switch(config)# vtp (password) 
Switch(config)# vtp version {1 | 2} 
Switch(config)# vtp pruning

Trouble Shooting Commands

1
2
3
4
5
6
7
8
9
sh vlan  
sh inter ==(status | switchport)==
sh inter trunk  
sh vtp status  
sh vtp password
sh mac address-table | inc abcd
sh run inter vlan x
sh run inter gig x/x/x

Examples of configurations

note: to check a config of a specific port you have to run

1
sh run inter gig x/x/x
1
2
3
4
5
interface GigabitEthernet1/7  
description namehere
switchport  
switchport access vlan 80  
switchport mode access  
1
2
3
4
5
6
7
interface GigabitEthernet1/28  
description name here
switchport  
switchport access vlan 10  
switchport trunk encapsulation dot1q  
switchport trunk native vlan 10  
switchport mode trunk 
1
2
3
4
5
6
7
interface GigabitEthernet4/28  
description sonicwalla_x8  
switchport  
switchport trunk encapsulation dot1q  
switchport trunk allowed vlan 10,20,30,40,50,60,70,80,90  
switchport mode trunk  
switchport nonegotiate  

if you would like to add or subtract vlans to a trunk it would look something like this

1
2
3
4
5
6
  Switch(config)#int gig0/2
  Switch(config-if)#switchport trunk encapsulation dot1q
  Switch(config-if)#switchport mode trunk
  Switch(config-if)#switchport trunk allowed vlan remove 5-10,12
  Switch(config-if)#switchport trunk allowed vlan add 7
  Switch(config-if)#end

to show vlan information on a port

1
show interfaces gig 0/2 trunk

Definitions

VLAN Trunking Protocol (VTP)

  • Domain
    Common to all switches participating in VTP

  • Server Mode
    Generates and propagates VTP advertisements to clients;
    default mode on unconfigured switches

  • Client Mode
    Receives and forwards advertisements from servers; VLANs
    cannot be manually configured on switches in client mode

  • Transparent Mode
    Forwards advertisements but does not participate in VTP;
    VLANs must be configured manually

  • Pruning
    VLANs not having any access ports on an end switch are
    removed from the trunk to reduce flooded traffic

This post is licensed under CC BY 4.0 by the author.