Automation · NetBox
VLANs
Cheat sheet · https://pcornel.dk/topic.php?topic=5880
Answer
VLANs in NetBox have VID, name, status and scope by site or VLAN group, and are assigned to interfaces and prefixes so switch configuration can be generated from them.
Remember
- VLANs have VID, name and scope.
- VLAN groups limit where IDs are unique.
- Assign VLANs to interfaces and prefixes.
First checks
curl -s -H 'Authorization: Token <t>' 'https://<netbox>/api/ipam/vlans/?group=<g>'— VLANs- VLAN groups for scope — uniqueness
- Interface tagged/untagged VLANs — assignments
Verify in this order
VLAN → interface assignments → switch config
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5880