add_vlan
Create a MikroTik RouterOS VLAN interface with a name, 802.1Q VLAN ID, and parent interface. Preview changes first, then confirm to apply; duplicate names are rejected.
Instructions
Create a VLAN interface (/interface/vlan add): name (the new
RouterOS interface name, e.g. "vlan100"), vlan_id (1-4094, the
IEEE 802.1Q tag), interface (the parent interface it rides on top
of, e.g. "bridge1"/"ether2" - not verified to exist here; RouterOS
itself rejects an unknown one at write time). mtu/comment are
optional.
WRITE tool, guarded: blocked entirely unless the server is running
with MIKROTIK_ALLOW_WRITE=true. Call with confirm=False (the
default) to get a before/after preview without changing anything;
call again with confirm=True to actually create it. Errors clearly
(without creating anything) if name already exists on the device -
it never creates a duplicate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mtu | No | ||
| name | Yes | ||
| comment | No | ||
| confirm | No | ||
| vlan_id | Yes | ||
| interface | Yes | ||
| device_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||