Skip to content

One VLAN name, one ID ​

A VLAN has one name and one ID, the same on every device of your network.

Why ​

On the wire, a VLAN is only its ID. Its name lives in your files, your diagrams, and your team's heads. If guests is VLAN 30 on the router and 31 on the switch, the guests' frames cross the trunk under a tag the router doesn't give to guests. They land in another VLAN, or nowhere, and a review doesn't catch it, because both files say guests.

One ID under two names works on the wire, but reads as two VLANs.

In Circuit ​

same_vlan_ids: true in circuit.ts stops the project on a VLAN name with two IDs, and shows where each is written:

text
VLAN guests has 2 IDs: 30 on router (sites/home/site.ts:14); 31 on switch (sites/home/switch.ts:39). One VLAN name has one ID in the network (check same_vlan_ids).

Write each VLAN once, in a literal that every device uses. The single site example keeps its VLANs in site.ts, and both devices write vlans: home.vlans:

ts
// The site's facts that both devices write. Change them to your own.

export const home = literal({
    timezone: "Asia/Jakarta",
    addresses: {
        /** The management network. Only addresses in it may log in to the devices. */
        management: "192.168.10.0/24",
        router: "192.168.10.1/24",
        switch: "192.168.10.2/24",
    },
    vlans: {
        mgmt: { id: 10, description: "Management" },
        home: { id: 20, description: "Home" },
        guests: { id: 30, description: "Guests" },
    },
});

Across a link, Circuit also warns when one ID has a different name at each end. VLANs explains tags and IDs, and Parts and merge explains literal.

Discussion

Stuck, or found a mistake? Ask here. You sign in with GitHub.

Released under the Business Source License 1.1.