PentOpsVault @syztem4our666

PentOpsVault
Networks

VLANS

Networking

VLANs Cheat Sheet

This guide provides a quick reference for VLAN configuration, trunking, and VLAN Trunking Protocol (VTP) commands on network switches.

VLAN Configuration

VLAN Creation

To create a VLAN and assign it a name:

Switch(config)# vlan 100
Switch(config-vlan)# name Engineering
VLAN 0: Reserved
VLAN 1: Default VLAN
VLAN 1002-1005: Legacy VLANs (e.g., fddi-default, tr, fdnet, trnet)
VLAN 1006-4094: Extended VLANs
VLAN 4095: Reserved

Terminology

Trunking

Trunking: Carrying multiple VLANs over the same physical connection.
Access VLAN: The VLAN to which an access port is assigned.
Voice VLAN: Supports voice traffic alongside data traffic on an access port.

Access Port Configuration

To configure a switchport as an access port:

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 Configuration

To configure a switchport as a trunk:

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

Trunk Types

FeatureISL802.1Q
Header Size26 bytes4 bytes
Trailer Size4 bytesN/A
StandardCiscoIEEE
Maximum VLANs10004094
Native VLAN: By default, frames in this VLAN are untagged when sent across a trunk.

Switch Port Modes

trunk: Forms an unconditional trunk.
dynamic desirable: Attempts to negotiate a trunk with the far end.
dynamic auto: Forms a trunk only if requested by the far end.
access: Will never form a trunk.

VLAN Trunking Protocol (VTP)

VTP Modes

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 client mode switches.
Transparent Mode: Forwards advertisements but does not participate in VTP. VLANs must be configured manually.

VTP Pruning

Pruning: Removes VLANs from a trunk that do not have any access ports on an end switch, reducing flooded traffic.

VTP Configuration

To configure VTP settings:

Switch(config)# vtp mode {server | client | transparent}
Switch(config)# vtp domain <name>
Switch(config)# vtp password <password>
Switch(config)# vtp version {1 | 2}
Switch(config)# vtp pruning

Troubleshooting

To display VLAN-related information:

Switch# show vlan
Switch# show interface [status | switchport]
Switch# show interface trunk
Switch# show vtp status
Switch# show vtp password

SVI (Switched Virtual Interface) Configuration

To configure an SVI as a routed gateway for a VLAN:

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

On this page

Edit on GitHub