interface_device
Create and manage OPNsense interface devices: 802.1Q VLANs and loopbacks, with actions to list, delete, and set IP addresses.
Instructions
Create the devices interfaces are built on: 802.1Q VLANs and loopbacks. Call action='help' for each action's fields and rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pcp | No | [create_vlan] Priority code point | |
| tag | No | [create_vlan] VLAN id, 1 to 4094 | |
| uuid | No | Record to act on, identified by a list action. | |
| apply | No | Apply now rather than leaving the change staged. The default differs by action; action='help' reports each one. | |
| action | Yes | Operation to run. 'help' lists fields. | |
| device | No | [delete_loopback] Device name, e.g. lo1. Given, the tool refuses to delete a device an interface is still assigned to | |
| parent | No | [create_vlan] Parent device, for example ax0 | |
| reason | No | [set_address] Recorded in the configuration history | |
| address | No | [set_address] IPv4 or IPv6 address | |
| confirm | No | Token returned by the previous call, to confirm. | |
| interface | No | [set_address] Interface identifier, e.g. opt12, from the assignment list | |
| description | No | Free-text note stored on the record. | |
| subnet_bits | No | [set_address] Prefix length; 32 or 128 for a loopback. 0 is refused: it would claim the whole address space on the interface | |
| planned_address | No | [create_loopback] An address you intend this loopback to carry. Not written here — OPNsense has no per-interface addressing API — but echoed back as the exact step to perform. Use set_interface_address to actually write one | |
| planned_subnet_bits | No | [create_loopback] Prefix length for planned_address, normally 32 or 128 |