Hone

Lessons · Network switches · what a VLAN is

One switch, several networks

A VLAN is a number that splits one physical switch into separate networks, and ports in different VLANs cannot talk to each other through the switch.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

It is how one box serves reception, accounting and the CCTV cameras without any of them seeing each other's traffic, and without buying three switches.

How to think about it

Think of it as painting each port a colour. Same colour, same network. Different colours need a router between them, whatever cable is plugged in where.

Worked example

enable
The # prompt.
configure terminal
Into configuration mode.
vlan 20
Creates VLAN 20 and drops you into (config-vlan)#, its own small mode.
name ACCOUNTS
A name for people, not for the switch. The switch only ever cares about the number.
exit
Back to (config)#, VLAN 20 now exists.
end
Out.
show vlan brief
VLAN 1 (default) and VLAN 20 (ACCOUNTS). No port is in 20 yet, so its Ports column is empty.

Your turn

Create VLAN 30.

 30

The trap

Expecting two VLANs to reach each other because they are on the same switch. They cannot, by design. Getting between them needs a router or a layer 3 switch, and that is the point of them.

Practise what a VLAN is on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.