VLANs
# VLAN Configuration Guide
Learn how to configure VLANs (Virtual Local Area Networks) to segment your network traffic.
## What are VLANs?
VLANs allow you to logically segment a physical network into multiple broadcast domains. Devices in different VLANs cannot communicate directly without a Layer 3 device (router or L3 switch).
## VLAN Benefits
- 🔒 **Security** - Isolate sensitive traffic
- 📊 **Performance** - Reduce broadcast traffic
- 🔧 **Flexibility** - Group devices logically, not physically
- 🏢 **Organization** - Separate departments or functions
## Configuring VLANs
### Creating VLANs (Switch)
Open the switch terminal and create VLANs:
## Switchport Modes
### Access Ports
Access ports belong to a single VLAN and connect to end devices (PCs, servers).
### Trunk Ports
Trunk ports carry multiple VLANs between switches. Traffic is tagged with 802.1Q headers.
## Inter-VLAN Routing
Devices in different VLANs need a Layer 3 device to communicate.
### Option 1: Router-on-a-Stick
Use a router with subinterfaces:
interface GigabitEthernet0/0.20 encapsulation dot1q 20 ip address 10.20.20.1 255.255.255.0
interface vlan 10 ip address 10.10.10.1 255.255.255.0 no shutdowninterface vlan 20 ip address 10.20.20.1 255.255.255.0 no shutdown
!!! tip "SVI MAC Address"
Each SVI has its own MAC address for ARP resolution.
## UI Configuration
You can also configure VLANs through the Properties Panel:
1. Select a switch
2. Find the **VLANs** section
3. Click **Add VLAN** and enter ID and name
4. For interfaces, configure:
- **Mode**: Access or Trunk
- **Access VLAN**: VLAN ID for access ports
- **Native VLAN**: Untagged VLAN for trunks
- **Allowed VLANs**: Comma-separated list for trunks
## Example: Department Segmentation
interface vlan 10 ip address 10.10.10.1 255.255.255.0 interface vlan 20 ip address 10.20.20.1 255.255.255.0 interface vlan 30 ip address 10.30.30.1 255.255.255.0
interface GigabitEthernet0/0 switchport mode trunk switchport trunk allowed vlan 10,20,30
interface FastEthernet0/1 switchport mode access switchport access vlan 10 interface FastEthernet0/2 switchport mode access switchport access vlan 10## Troubleshooting
### VLAN Mismatch
- Ensure access ports have the correct VLAN assigned
- Check trunk allowed VLANs include all needed VLANs
### No Inter-VLAN Communication
- Verify SVI or router subinterface is configured
- Check default gateway on end devices
- Verify routing table entries
### Trunk Not Passing Traffic
- Both ends must be configured as trunk
- Check allowed VLANs on both sides
- Verify native VLAN matches
## Related Commands
| Command | Description |
|---------|-------------|
| `show vlan` | Display all VLANs |
| `show vlan brief` | Display VLAN summary |
| `show interfaces trunk` | Display trunk information |
| `show mac address-table vlan 10` | Show MAC table for VLAN 10 |