A VLAN scheme you can derive in your head

Isometric illustration of nine translucent boxes on a grid, connected by thin straight lines, one larger box containing smaller ones.

In short. Six network classes, one addressing rule, fixed host octets, and a firewall rule order that keeps tenants apart. Nothing in this scheme needs a spreadsheet to look up. That is the whole point.

Who this is for

You are standing up a first colocation rack, or a homelab that has quietly become production. You know you need VLANs. You have read that "management should be separate". What you have not found is a scheme that is small enough to remember and strict enough to survive the third site.

This is the scheme I use. It has run three sites and a couple of home disaster-recovery boxes, and the parts that changed over that time are listed at the end.

The six network classes

Every site has the same VLAN numbers with the same meaning. Only the site number changes.

VLANNameWhat lives thereInternet
1MGMTHardware only: out-of-band controllers, hypervisors, backup server, switches, jumphostNothing inbound
2FW-SYNCFirewall state and config syncNone
5STORAGECeph public and cluster traffic, and all backup traffic. 10G, jumbo framesNone
10OPS-INTSource of record, secrets, monitoring, SIEM10/8 only; packages via a proxy
11OPS-EXTMesh VPN controller, identity provider, ingressOutbound NAT plus specific inbound
100 + NTenant NOne tenant, one VLANAllowed

Two rules make this table work:

The addressing rule

10.<site>.<vlan>.<host>/24     gateway is always .254

Site 1, VLAN 10, host 20 is 10.1.10.20. Site 3, tenant 7 (VLAN 107), its DNS server is 10.3.107.2. Anyone on the team can read an address and know where they are and what they are talking to.

Three consequences follow:

IPv6 mirrors IPv4: <prefix>:<site>:<vlan>::/64. The decimal site number is written as if it were hex, so site 12 is :12: in both families and reads the same. A test in the repository enforces this.

Fixed host octets inside a tenant

A tenant VLAN is a /24 with a layout that never changes:

HostRole
.2DNS and DHCP container for that tenant
.10Ingress: reverse proxy and the identity provider's outpost
.11 to .199Static guests
.200 to .249Provisioning DHCP pool
.254Gateway (the firewall's shared address)

MAC addresses are derived from the IP: a fixed prefix, then the VLAN, site and host. When a switch shows you a MAC, you know what it is without a lookup. When a DHCP lease looks wrong, you can tell at a glance.

The firewall rule order per tenant

Every tenant gets the same four rules, in this order, generated by a tool rather than typed:

  1. Block to MGMT
  2. Block to every other tenant
  3. Block to both ops VLANs
  4. Allow to the internet

The order matters because the allow is broad. Put it first and the blocks never match. The tool that creates a tenant writes all four rules in one pass, and a drift audit compares what is on the firewall with what the tool would generate.

flowchart LR
  subgraph S["One site: 10.S.V.0/24 per VLAN, gateway .254"]
    M["VLAN 1 MGMT<br/>out-of-band, hypervisors, backup, switches"]
    Y["VLAN 2 FW-SYNC"]
    C["VLAN 5 STORAGE<br/>Ceph and backup, 10G jumbo"]
    OI["VLAN 10 OPS-INT<br/>source of record, secrets, monitoring"]
    OE["VLAN 11 OPS-EXT<br/>mesh VPN, identity, ingress"]
    T1["VLAN 101 tenant 1<br/>.2 dns, .10 ingress, .254 gw"]
    T2["VLAN 102 tenant 2"]
  end
  I((Internet))
  P["Package proxy"]
  T1 -- "allow" --> I
  T2 -- "allow" --> I
  OE -- "outbound NAT + specific inbound" --> I
  OI -- "10/8 only" --> P --> I
  T1 -. "deny" .-> T2
  T1 -. "deny" .-> M
  T1 -. "deny" .-> OI
  OV["10.254/16 reserved<br/>mesh overlay, never a VLAN"]

Things that went wrong, and what they taught

What changed between site one and site three

FAQ

Why not a /16 per site with VLAN as the third octet anyway? That is exactly what this is. Writing it as 10.<site>.<vlan>.<host> just makes the role of each octet explicit, and the /14 per region is a free consequence.

Why 100 + N for tenants instead of starting at 2? So that no tenant number can collide with an infrastructure VLAN, and so the VLAN number tells you it is a tenant without looking anything up.

What about VLAN 1 being the default VLAN on switches? The switch trunks use a non-existent "poison" native VLAN, so untagged frames go nowhere. VLAN 1 is tagged like any other. The switching post covers that.

Related