Example projects
Copy the project closest to your network from examples/, and change it to yours. Each one passes circuit validate on every change to Circuit.
A single site
A home, an office, or an internal network. It has a router, a switch, three VLANs, DHCP, and a firewall, but no BGP.
ts
// The network: one site, a home or a small office, with a router and a switch. Circuit reads this file first, then every device file under sites/.
import { managementStaysOnTrunks } from "./lib/checks";
export const as64500 = circuit({
asn: 64500,
sites: {
home: { description: "A home or a small office: one router and one switch." },
},
checks: {
same_vlan_ids: true,
management_stays_on_trunks: managementStaysOnTrunks,
},
});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" },
},
});ts
// The router: the internet connection, a gateway and DHCP for each VLAN, and the firewall.
import { as64500 } from "../../circuit";
import { home } from "./site";
export default as64500.device({
name: "router",
site: "home",
role: "Router",
platform: "routeros",
model: "CCR2216-1G-12XS-2XQ",
connection: { host: "192.168.10.1", user: "operator" },
system: {
timezone: home.timezone,
dns: { servers: ["1.1.1.1", "1.0.0.1"] },
ntp: { servers: ["pool.ntp.org"] },
users: { operator: { role: "admin", password: secret("ROUTER_PASSWORD") } },
},
management: { allow: [home.addresses.management], ssh: {} },
interfaces: {
ethernet: {
"1g-1": { description: "Internet provider", addresses: ["203.0.113.2/30"] },
"25g-1": {
description: "switch 10GE1/0/1",
speed: "10g",
trunk_vlans: ["mgmt", "home", "guests"],
link: { device: "switch", port: "10g-1" },
},
},
// The gateway of each VLAN.
vlan_interface: {
mgmt: { vlan: "mgmt", addresses: [home.addresses.router] },
home: { vlan: "home", addresses: ["192.168.20.1/24"] },
guests: { vlan: "guests", addresses: ["192.168.30.1/24"] },
},
},
switching: {
vlans: home.vlans,
},
services: {
dns_server: true,
ntp_server: true,
dhcp_server: {
home: {
interface: "home",
network: "192.168.20.0/24",
gateway: "192.168.20.1",
dns: ["192.168.20.1"],
pool: ["192.168.20.100", "192.168.20.200"],
},
guests: {
interface: "guests",
network: "192.168.30.0/24",
gateway: "192.168.30.1",
dns: ["192.168.30.1"],
pool: ["192.168.30.100", "192.168.30.200"],
lease_time: 3600,
},
},
},
routing: {
static_routes: [{ prefix: presets.default_routes.ipv4, next_hop: "203.0.113.1", description: "Internet provider" }],
},
firewall: {
filter: {
// Traffic to the router itself.
input: {
default_action: "drop",
rules: [
{ description: "Replies", if: { connection_state: ["established", "related"] }, then: "accept" },
{ description: "Ping", if: { protocol: "icmp" }, then: "accept" },
{ description: "Management", if: { src: home.addresses.management }, then: "accept" },
{ description: "DNS from home", if: { in_interface: "home", protocol: "udp", dst_port: 53 }, then: "accept" },
{ description: "DNS from guests", if: { in_interface: "guests", protocol: "udp", dst_port: 53 }, then: "accept" },
],
},
// Traffic through the router: home and guests reach the internet, and nothing else gets through.
forward: {
default_action: "drop",
rules: [
{ description: "Replies", if: { connection_state: ["established", "related"] }, then: "accept", fast_path: true },
{ description: "Home to the internet", if: { in_interface: "home", out_interface: "1g-1" }, then: "accept" },
{ description: "Guests to the internet", if: { in_interface: "guests", out_interface: "1g-1" }, then: "accept" },
],
},
},
nat: {
source: [{ description: "Share the public address", if: { out_interface: "1g-1" }, then: "masquerade" }],
},
},
});ts
// The switch: a port for each device on the site, in the VLAN it belongs to.
import { as64500 } from "../../circuit";
import { home } from "./site";
export default as64500.device({
name: "switch",
site: "home",
role: "Switch",
platform: "vrp",
model: "CE6855-48S6Q-HI",
connection: { host: "192.168.10.2", user: "operator" },
system: {
timezone: home.timezone,
ntp: { servers: ["192.168.10.1"] },
users: { operator: { role: "admin", password: secret("SWITCH_PASSWORD") } },
},
management: { allow: [home.addresses.management], ssh: {} },
interfaces: {
ethernet: {
"10g-1": {
description: "router sfp28-1",
trunk_vlans: ["mgmt", "home", "guests"],
link: { device: "router", port: "25g-1" },
},
"10g-2": { description: "Desk", access_vlan: "home", stp: { edge: true } },
"10g-3": { description: "Living room", access_vlan: "home", stp: { edge: true } },
"10g-4": { description: "Guest access point", access_vlan: "guests", stp: { edge: true } },
},
vlan_interface: {
mgmt: { vlan: "mgmt", addresses: [home.addresses.switch] },
},
},
switching: {
vlans: home.vlans,
stp: {},
lldp: true,
},
routing: {
static_routes: [{ prefix: presets.default_routes.ipv4, next_hop: "192.168.10.1" }],
},
});ts
// This network's own checks, beside Circuit's built-in ones. circuit.ts turns them on in `checks`.
import type { Check } from "circuit";
/** Someone who plugs into a wall socket must not land on the management network: only a trunk between devices carries it. */
export const managementStaysOnTrunks: Check = (network) =>
network.devices.flatMap((device) =>
Object.entries(device.interfaces?.ethernet ?? {})
.filter(([, port]) => port?.access_vlan === "mgmt")
.map(([name]) => ({
device: device.name,
path: `interfaces.ethernet.${name}`,
message: "gives management to whatever plugs in. Put the port in another VLAN.",
}))
);An edge router
Your own AS with one router. It has IP transit from Hurricane Electric, peering at DE-CIX, filters both ways, and BGP communities.
ts
// The network, AS64500: its own address space, its BGP communities, and the checks Circuit runs on it.
import { importsFiltered } from "./lib/checks";
export const as64500 = circuit({
asn: 64500,
prefixes: {
ours: { v4: "198.51.100.0/24", v6: "2001:db8:100::/48" },
},
communities: {
groups: { transit: { value: 1 }, exchange: { value: 2 } },
learned_from_group: { code: 1 },
learned_from_as: { code: 3 },
},
sites: {
"pop-1": { description: "The point of presence: one router with an IP transit and an internet exchange." },
},
checks: {
exports_end_in_reject: true,
imports_end_in_accept_or_reject: true,
untrusted_vlans: { filtering_devices: ["edge-01"] },
imports_filtered: importsFiltered,
},
});ts
// The edge router: BGP with an IP transit and an internet exchange, filtered on the way in and on the way out.
// Hurricane Electric and DE-CIX stand for your own transit and exchange. The addresses are documentation ranges, so use the ones your providers give you.
import { as64500 } from "../../circuit";
export default as64500.device({
name: "edge-01",
site: "pop-1",
role: "Edge router",
platform: "routeros",
model: "CCR2216-1G-12XS-2XQ",
connection: { host: "10.0.0.1", user: "operator" },
system: {
timezone: "Asia/Jakarta",
ntp: { servers: ["pool.ntp.org"] },
users: { operator: { role: "admin", password: secret("EDGE_01_PASSWORD") } },
},
management: { allow: ["10.0.0.0/24"], ssh: {} },
interfaces: {
ethernet: {
"1g-1": { description: "Management", addresses: ["10.0.0.1/24"] },
"25g-1": { description: "Hurricane Electric", access_vlan: "transit", ingress_acl: "edge" },
"25g-2": { description: "DE-CIX", access_vlan: "exchange", ingress_acl: "edge" },
},
vlan_interface: {
transit: { vlan: "transit", addresses: ["203.0.113.2/30"] },
exchange: { vlan: "exchange", addresses: ["192.0.2.10/24", "2001:db8:ffff::10/64"] },
},
},
switching: {
vlans: {
transit: { id: 300, description: "IP transit from Hurricane Electric, AS6939", untrusted: true },
exchange: { id: 200, description: "DE-CIX peering LAN", untrusted: true },
},
// In the switch chip, before a packet reaches the router's CPU: nothing from outside may claim our addresses or private ones.
acls: {
edge: [
{ description: "Our own space", if: { vlan: ["transit", "exchange"], src: as64500.prefixes.ours.v4 }, then: "drop" },
{ description: "Private ranges", if: { vlan: ["transit", "exchange"], src: presets.rfc1918 }, then: "drop" },
],
},
},
routing: {
router_id: "203.0.113.2",
// A route for each block we announce, so it is in the table even when nothing inside it is up.
static_routes: [
{ prefix: as64500.prefixes.ours.v4, blackhole: true, description: "Originate" },
{ prefix: as64500.prefixes.ours.v6, blackhole: true, description: "Originate" },
],
bgp: {
originated_prefixes: [as64500.prefixes.ours.v4, as64500.prefixes.ours.v6],
neighbors: {
"hurricane-electric": {
address: "203.0.113.1",
remote_as: 6939,
description: "Hurricane Electric",
role: "provider",
max_prefixes: 1_200_000,
import_policy: "transit-import",
export_policy: "export",
communities: { groups: ["transit"] },
},
"de-cix-rs-v4": {
address: "192.0.2.1",
remote_as: 6695,
description: "DE-CIX route server",
role: "rs",
max_prefixes: 100_000,
import_policy: "exchange-import",
export_policy: "export",
communities: { groups: ["exchange"] },
},
"de-cix-rs-v6": {
address: "2001:db8:ffff::1",
remote_as: 6695,
description: "DE-CIX route server",
role: "rs",
max_prefixes: 50_000,
import_policy: "exchange-import",
export_policy: "export",
communities: { groups: ["exchange"] },
},
},
},
prefix_sets: {
ours: { prefixes: as64500.prefixes.ours },
"bogons-v4": { prefixes: presets.bogons.ipv4 },
"bogons-v6": { prefixes: presets.bogons.ipv6 },
},
policies: {
sanity: presets.bgp_sanity,
// A route from the exchange beats the same route from the transit: the higher local preference wins.
"transit-import": [
{ call: "sanity" },
{ description: "Bogons", if: { prefix_set: "bogons-v4" }, then: "reject" },
{ description: "Bogons", if: { prefix_set: "bogons-v6" }, then: "reject" },
{ if: { prefix_set: "ours" }, then: "reject" },
{ communities: "import" },
{ set: { local_pref: 100 }, then: "accept" },
],
"exchange-import": [
{ call: "sanity" },
{ description: "Bogons", if: { prefix_set: "bogons-v4" }, then: "reject" },
{ description: "Bogons", if: { prefix_set: "bogons-v6" }, then: "reject" },
{ if: { prefix_set: "ours" }, then: "reject" },
{ communities: "import" },
{ set: { local_pref: 200 }, then: "accept" },
],
export: [
{ communities: "export" },
{ description: "Our own space", if: { prefix_set: "ours" }, then: "accept" },
{ description: "Nothing else leaves", then: "reject" },
],
},
},
firewall: {
address_sets: {
management: ["10.0.0.0/24"],
"bgp-neighbors": bgpNeighbors(),
},
filter: {
input: {
default_action: "drop",
rules: [
{ description: "Replies", if: { connection_state: ["established", "related"] }, then: "accept" },
{ description: "Ping", if: { protocol: "icmp" }, then: "accept" },
{ description: "Management", if: { src_address_set: "management" }, then: "accept" },
{
description: "BGP",
if: { src_address_set: "bgp-neighbors", protocol: "tcp", dst_port: presets.ports.bgp },
then: "accept",
},
],
},
forward: {
rules: presets.bad_tcp_flags,
},
},
},
});Colocation with tenants
A router and a top-of-rack switch. Each tenant, here Netflix, has its own file with its VLANs, gateway, ports, and rules. Devices pull them in with include. See Parts and merge.
ts
// The network, AS64500: a colocation site whose tenants each get their own VLANs, addresses, and ports.
import { blocksApart } from "./lib/checks";
export const as64500 = circuit({
asn: 64500,
prefixes: {
ours: { v4: "198.51.100.0/24", v6: "2001:db8:100::/48" },
},
communities: {
groups: { transit: { value: 1 }, exchange: { value: 2 } },
learned_from_group: { code: 1 },
},
sites: {
"dc-1": { description: "The data center: one router, and one top-of-rack switch for the tenants' servers." },
},
checks: {
exports_end_in_reject: true,
imports_end_in_accept_or_reject: true,
same_vlan_ids: true,
blocks_apart: blocksApart,
},
});ts
// Tenant netflix: its VLANs, its gateway on the router, its servers' ports on the switch, and a cap on UDP toward it.
// Copy this file for a new tenant, and add it to index.ts.
const vlans = literal({
"netflix-internet": { id: 1001, description: "Tenant netflix internet" },
"netflix-private": { id: 2001, description: "Tenant netflix private" },
});
export const netflix = {
parts: {
"edge-01": part("device", {
switching: { vlans: { "netflix-internet": vlans["netflix-internet"] } },
interfaces: {
ethernet: { "100g-1": { trunk_vlans: ["netflix-internet"] } },
vlan_interface: {
"netflix-internet": {
vlan: "netflix-internet",
description: "Tenant netflix",
addresses: ["198.51.100.9/29", "2001:db8:100:1::1/64"],
},
},
},
}),
"tor-01": part("device", {
switching: { vlans },
interfaces: {
ethernet: {
"40g-1": { trunk_vlans: ["netflix-internet"] },
"10g-1": { description: "netflix server 1", trunk_vlans: ["netflix-internet", "netflix-private"] },
"10g-2": { description: "netflix server 2", trunk_vlans: ["netflix-internet", "netflix-private"] },
},
},
}),
},
rules: {
edge_acl: part("acl", [
{
description: "netflix: UDP above 1G",
if: { vlan: ["transit", "exchange"], protocol: "udp", dst: "198.51.100.8/29" },
then: "accept",
rate: "1G",
},
]),
},
};ts
// Every tenant, merged whole. A new tenant joins the list.
// `empty` holds no tenant. It keeps tenants.parts and tenants.rules there for the devices when the last tenant leaves.
import { netflix } from "./netflix";
const empty = { parts: {}, rules: { edge_acl: part("acl", []) } };
export const tenants = merge([empty, netflix]);ts
// dc-1: the facts both devices write.
export const dc_1 = literal({
timezone: "Asia/Jakarta",
addresses: {
management: "10.0.0.0/24",
router_on_switches: "10.0.99.1/24",
tor_01: "10.0.99.2/24",
},
vlans: {
mgmt: { id: 99, description: "Management of the switches" },
},
});ts
// The router: the transit, the exchange, and each tenant's gateway, which comes from the tenant's own file.
import { as64500 } from "../../circuit";
import { tenants } from "../../tenants";
import { dc_1 } from "./site";
export default as64500.device({
name: "edge-01",
include: [tenants.parts],
site: "dc-1",
role: "Edge router",
platform: "routeros",
model: "CCR2216-1G-12XS-2XQ",
connection: { host: "10.0.0.1", user: "operator" },
system: {
timezone: dc_1.timezone,
ntp: { servers: ["pool.ntp.org"] },
users: { operator: { role: "admin", password: secret("EDGE_01_PASSWORD") } },
},
management: { allow: [dc_1.addresses.management], ssh: {} },
interfaces: {
ethernet: {
"1g-1": { description: "Management", addresses: ["10.0.0.1/24"] },
"25g-1": { description: "Hurricane Electric", access_vlan: "transit", ingress_acl: "edge" },
"25g-2": { description: "DE-CIX", access_vlan: "exchange", ingress_acl: "edge" },
"100g-1": {
description: "tor-01 40GE1/0/1",
speed: "40g",
trunk_vlans: ["mgmt"],
link: { device: "tor-01", port: "40g-1" },
},
},
vlan_interface: {
mgmt: { vlan: "mgmt", addresses: [dc_1.addresses.router_on_switches] },
transit: { vlan: "transit", addresses: ["203.0.113.2/30"] },
exchange: { vlan: "exchange", addresses: ["192.0.2.10/24", "2001:db8:ffff::10/64"] },
},
},
switching: {
vlans: {
mgmt: dc_1.vlans.mgmt,
transit: { id: 300, description: "IP transit from Hurricane Electric, AS6939" },
exchange: { id: 200, description: "DE-CIX peering LAN" },
},
// In the switch chip, before a packet reaches the router's CPU. Each tenant's own rules come last.
acls: {
edge: merge([
{ description: "Our own space", if: { vlan: ["transit", "exchange"], src: as64500.prefixes.ours.v4 }, then: "drop" },
{ description: "Private ranges", if: { vlan: ["transit", "exchange"], src: presets.rfc1918 }, then: "drop" },
tenants.rules.edge_acl,
]),
},
},
routing: {
router_id: "203.0.113.2",
static_routes: [
{ prefix: as64500.prefixes.ours.v4, blackhole: true, description: "Originate" },
{ prefix: as64500.prefixes.ours.v6, blackhole: true, description: "Originate" },
],
bgp: {
originated_prefixes: [as64500.prefixes.ours.v4, as64500.prefixes.ours.v6],
neighbors: {
"hurricane-electric": {
address: "203.0.113.1",
remote_as: 6939,
description: "Hurricane Electric",
role: "provider",
max_prefixes: 1_200_000,
import_policy: "transit-import",
export_policy: "export",
communities: { groups: ["transit"] },
},
"de-cix-rs-v4": {
address: "192.0.2.1",
remote_as: 6695,
description: "DE-CIX route server",
role: "rs",
max_prefixes: 100_000,
import_policy: "exchange-import",
export_policy: "export",
communities: { groups: ["exchange"] },
},
},
},
prefix_sets: {
ours: { prefixes: as64500.prefixes.ours },
"bogons-v4": { prefixes: presets.bogons.ipv4 },
"bogons-v6": { prefixes: presets.bogons.ipv6 },
},
policies: {
sanity: presets.bgp_sanity,
"transit-import": [
{ call: "sanity" },
{ description: "Bogons", if: { prefix_set: "bogons-v4" }, then: "reject" },
{ description: "Bogons", if: { prefix_set: "bogons-v6" }, then: "reject" },
{ if: { prefix_set: "ours" }, then: "reject" },
{ communities: "import" },
{ set: { local_pref: 100 }, then: "accept" },
],
"exchange-import": [
{ call: "sanity" },
{ description: "Bogons", if: { prefix_set: "bogons-v4" }, then: "reject" },
{ description: "Bogons", if: { prefix_set: "bogons-v6" }, then: "reject" },
{ if: { prefix_set: "ours" }, then: "reject" },
{ communities: "import" },
{ set: { local_pref: 200 }, then: "accept" },
],
export: [
{ communities: "export" },
{ description: "Our own space", if: { prefix_set: "ours" }, then: "accept" },
{ description: "Nothing else leaves", then: "reject" },
],
},
},
firewall: {
address_sets: {
management: [dc_1.addresses.management],
"bgp-neighbors": bgpNeighbors(),
},
filter: {
input: {
default_action: "drop",
rules: [
{ description: "Replies", if: { connection_state: ["established", "related"] }, then: "accept" },
{ description: "Ping", if: { protocol: "icmp" }, then: "accept" },
{ description: "Management", if: { src_address_set: "management" }, then: "accept" },
{
description: "BGP",
if: { src_address_set: "bgp-neighbors", protocol: "tcp", dst_port: presets.ports.bgp },
then: "accept",
},
],
},
forward: {
rules: presets.bad_tcp_flags,
},
},
},
});ts
// The top-of-rack switch: the tenants' servers, from each tenant's own file, and one uplink to the router.
import { as64500 } from "../../circuit";
import { tenants } from "../../tenants";
import { dc_1 } from "./site";
export default as64500.device({
name: "tor-01",
include: [tenants.parts],
site: "dc-1",
role: "Top-of-rack switch",
platform: "vrp",
model: "CE6855-48S6Q-HI",
connection: { host: "10.0.99.2", user: "operator" },
system: {
timezone: dc_1.timezone,
ntp: { servers: ["10.0.99.1"] },
users: { operator: { role: "admin", password: secret("TOR_01_PASSWORD") } },
},
management: { allow: [dc_1.addresses.management], ssh: {} },
interfaces: {
ethernet: {
"40g-1": { description: "edge-01 qsfp28-1-1", trunk_vlans: ["mgmt"], link: { device: "edge-01", port: "100g-1" } },
},
vlan_interface: {
mgmt: { vlan: "mgmt", addresses: [dc_1.addresses.tor_01] },
},
},
switching: {
vlans: { mgmt: dc_1.vlans.mgmt },
stp: {},
lldp: true,
},
routing: {
static_routes: [{ prefix: presets.default_routes.ipv4, next_hop: "10.0.99.1" }],
},
});An internet exchange
Two switches carry one peering LAN. Each member, such as Cloudflare or Google, has its own file with its port. Circuit runs the switches, and the route servers run their own software.
ts
// The exchange, AS64500: two fabric switches that carry one peering LAN between the members and the route servers.
import { membersDescribed } from "./lib/checks";
export const as64500 = circuit({
asn: 64500,
prefixes: {
peering_lan: { v4: "203.0.113.0/24", v6: "2001:db8:ffff::/64" },
},
sites: {
"ix-1": { description: "The exchange's one site: two switches, two route servers." },
},
checks: {
same_vlan_ids: true,
members_described: membersDescribed,
},
});ts
// Cloudflare, AS13335: one port on ix-sw-01. Its addresses on the peering LAN are for the route servers, which Circuit does not configure.
import { ix_1 } from "../sites/ix-1/site";
export const cloudflare = {
parts: {
"ix-sw-01": part("device", {
interfaces: { ethernet: { "40g-1": { ...ix_1.member_port, description: "Cloudflare, AS13335" } } },
}),
},
};ts
// Every member, merged whole. A member joins by being added here, and leaves by being removed: the next apply turns its port off.
// `empty` holds no member. It keeps members.parts there for the switches when the last member leaves.
import { cloudflare } from "./cloudflare";
import { google } from "./google";
const empty = { parts: {} };
export const members = merge([empty, cloudflare, google]);ts
// ix-1: what both switches write, and what every member's port is.
export const ix_1 = literal({
timezone: "Asia/Singapore",
management: "10.0.0.0/24",
vlans: {
mgmt: { id: 10, description: "Management, never on a member port" },
peering: { id: 100, description: "Peering LAN" },
},
/** A member's port, on the peering LAN with no spanning tree or LLDP toward the member. It takes one MAC address and only IPv4, ARP, and IPv6, and it caps flooded traffic. */
member_port: {
access_vlan: "peering",
stp: false,
lldp: false,
mac_limit: 1,
ethertypes: ["ipv4", "arp", "ipv6"],
storm_control: { broadcast: { percent: 1 }, multicast: { percent: 1 }, unknown_unicast: { percent: 1 } },
},
});ts
// The first fabric switch: members, the route servers, and the way in for management. The switches have no address on the peering LAN: they only carry it.
import { as64500 } from "../../circuit";
import { members } from "../../members";
import { ix_1 } from "./site";
export default as64500.device({
name: "ix-sw-01",
include: [members.parts],
site: "ix-1",
role: "Fabric switch",
platform: "vrp",
model: "CE6855-48S6Q-HI",
connection: { host: "10.0.0.2", user: "operator" },
system: {
timezone: ix_1.timezone,
ntp: { servers: ["10.0.0.1"] },
users: { operator: { role: "admin", password: secret("IX_SW_01_PASSWORD") } },
},
management: { allow: [ix_1.management], ssh: {} },
interfaces: {
ethernet: {
"10g-47": { description: "Route server rs1", access_vlan: "peering", stp: false },
"10g-48": { description: "Route server rs2", access_vlan: "peering", stp: false },
"40g-5": { description: "ix-sw-02 40GE1/0/5", trunk_vlans: ["peering", "mgmt"], link: { device: "ix-sw-02", port: "40g-5" } },
"40g-6": { description: "Management network", access_vlan: "mgmt" },
},
vlan_interface: {
mgmt: { vlan: "mgmt", addresses: ["10.0.0.2/24"] },
},
},
switching: {
vlans: ix_1.vlans,
stp: {},
lldp: true,
},
routing: {
static_routes: [{ prefix: presets.default_routes.ipv4, next_hop: "10.0.0.1" }],
},
});ts
// This network's own checks, beside Circuit's built-in ones. circuit.ts turns them on in `checks`.
import type { Check } from "circuit";
/** Every port on the peering LAN says whose it is, so the NOC can find a member by its port. */
export const membersDescribed: Check = (network) =>
network.devices.flatMap((device) =>
Object.entries(device.interfaces?.ethernet ?? {})
.filter(([, port]) => port?.access_vlan === "peering" && !port.description)
.map(([name]) => ({
device: device.name,
path: `interfaces.ethernet.${name}`,
message: "is on the peering LAN and says nothing about whose it is: write a description.",
}))
);