Watch on Instagram

Network Bytes · Episode 30 · CCNA 2.1

What is a VLAN?

One office switch can run several separate networks. A VLAN groups the switch's ports so each group gets its own broadcast domain, with no new cables.

Posted · About a 1 minute watch, 3 minute read · Take the quiz

One switch, one big network

Picture an office switch with sales, finance and guest laptops all plugged in. Out of the box, every port is in the same VLAN (on a Cisco switch, VLAN 1), so the whole office is one big network.

That means every broadcast (a frame sent to everyone, like an ARP request from EP29) is flooded out of every port. All the laptops hear it, and any device can reach any other device directly. It works, but it's noisy, and the guest Wi-Fi laptop can talk straight to finance.

VLANs put up invisible walls

A VLAN lets you tell the switch which ports belong to which group. For example:

  • Sales ports in VLAN 10
  • Finance ports in VLAN 20
  • Guest ports in VLAN 30

The "walls" are an analogy. Nothing physical changes: the switch simply only forwards frames between ports that are in the same VLAN. Same switch, three networks, no new cables.

Each VLAN is its own broadcast domain

Because frames only move within a VLAN, each VLAN is a separate broadcast domain. A broadcast from a guest laptop reaches the other guest ports and stops there. Finance never even hears it. The same goes for unknown unicast frames, which the switch also floods only within the VLAN.

Each VLAN is normally its own IP subnet too, for example 192.168.10.0/24 for sales and 192.168.30.0/24 for guests.

Crossing a wall

Devices in different VLANs can't reach each other through the switch alone. Traffic has to leave its VLAN and go through a Layer 3 device that routes between the subnets, and that device is where you decide what's allowed between groups. How that is set up (inter-VLAN routing) comes later in the series.

Try it yourself

If you have access to a Cisco switch or a free simulator such as Cisco Packet Tracer, run show vlan brief. On a fresh switch you'll see every port listed under VLAN 1 (default). Create a VLAN with vlan 10, put a port in it with switchport access vlan 10 under that interface, and run show vlan brief again to see the port move.

Good to know

  • A VLAN is a separate Layer 2 broadcast domain; frames, including broadcasts and unknown unicasts, are only switched between ports in the same VLAN.
  • Each VLAN is normally its own IP subnet, so traffic between VLANs needs a Layer 3 device (inter-VLAN routing, covered later).
  • By default every port on a Cisco switch is in VLAN 1.
  • "Invisible walls" is the analogy; the separation is done in the switch's forwarding logic, not physically.

For CCNA learners

This lines up with CCNA 200-301 exam topic 2.1, configure and verify VLANs (normal range) spanning multiple switches: know that each VLAN is its own broadcast domain and that ports start in VLAN 1.

Answer to the comment question

A router (or a Layer 3 switch doing inter-VLAN routing). The guest laptop and the sales server are in different VLANs, which are different broadcast domains and normally different IP subnets. The switch won't forward frames between them, so the traffic has to be routed: it goes up to a router or Layer 3 switch, which can also apply rules about what's allowed, and comes back down into the sales VLAN.

Test your knowledge

Quick quiz: What is a VLAN?

4 multiple-choice questions. Pick one answer for each, then check how you did.

1What does a VLAN do on a switch?
2A guest laptop in VLAN 30 sends a broadcast. Who receives it?
3On a Cisco switch, which VLAN are all ports in out of the box?
4Why can VLANs separate groups without new cables?

Sources

Video transcript

How can one switch run three separate networks?

Picture one office switch. Sales, finance and guest laptops are all plugged in. Out of the box, they're one big network, so every broadcast reaches everyone, and anyone can talk to anyone.

A VLAN, short for virtual LAN, puts up invisible walls. You tell the switch which ports belong to which group: sales in VLAN 10, finance in 20, guests in 30.

Now each VLAN is its own broadcast domain. A shout from a guest laptop only reaches other guests. Finance never even hears it.

To cross a wall, traffic has to go through a router, where you decide what's allowed. Same switch, three networks, no new cables.

A guest laptop wants to reach a sales server. What has to sit between their VLANs? Comment your answer below!

That's your byte.

More from Network Bytes

All Network Bytes lessons