3.2 Network Segmentation (VLANs)

Dividing the Physical World with Logical Walls

If you buy a 48-port network switch for your house and plug everything into it, every device can talk directly to every other device. In networking, this is called a "Flat Network," and it is one huge Broadcast Domain.

In an enterprise environment, a flat network is a security nightmare. If a guest connects their infected laptop to the lobby Wi-Fi, the virus can effortlessly scan the network and jump to the CEO's workstation or the payroll servers.

To solve this without buying a separate physical switch for every department, engineers use VLANs (Virtual Local Area Networks).

1. The Power of Isolation

A VLAN allows you to take one physical 48-port switch and digitally slice it into multiple, completely invisible miniature switches.

For example, an engineer might configure:

Even though the Corporate PCs and the Guest Laptops are plugged into the exact same metal box, they cannot see each other. If a guest PC sends out a broadcast shout asking "Who is on the network?", the switch intercepts that shout and physically prevents it from leaving VLAN 20. The Corporate PCs (VLAN 10) will hear nothing but silence.

2. The Mechanics: Access Ports vs. Trunk Ports

How does the switch know which data belongs to which network? It uses a protocol called 802.1Q Tagging.

3. Native VLANs and Security

By default, every brand-new switch places all ports in VLAN 1. This is incredibly dangerous.

Hackers know this. If they can plug into an unsecured wall jack, they will immediately be on the default VLAN 1. A core tenet of enterprise networking is to immediately change the "Native" management VLAN to an obscure number (like VLAN 999), shut down all unused ports, and never leave active ports on VLAN 1.

4. (Addition) Inter-VLAN Routing (Router-on-a-Stick)

Stuff to add: If VLANs are perfectly isolated, how does a Guest on VLAN 20 get to the internet? They can't, unless a Router steps in.

Because switches operate at Layer 2 (MAC Addresses), they cannot route traffic between different networks. You must connect the switch to a Router (which operates at Layer 3 - IP Addresses).

Powered by Forestry.md