Mastering network interface tags
Errors or typos? Topics missing? Hard to read? Let us know!
Get to grips with the nitty-gritty of network interface tags in MAAS. Note that network tags do not vary by MAAS version.
Network tags (UI)
Note: In the operations that follow, autocomplete might be scarce, as interface tags don’t usually carry over between machines with different MAC addresses.
Creating and tagging network interfaces
To slap a tag onto an interface:
- Navigate to Machines.
- Choose the machine linked to the target interface.
- Go to Network.
- Hit Edit physical on the row for your chosen interface.
- Look for the Tags field.
- Type in your new tag.
- Finalise by clicking Save interface.
Erasing tags
To remove a tag from an interface:
- Navigate to Machines.
- Choose the machine linked to the target interface.
- Go to Network.
- Hit Edit physical on the row for your chosen interface.
- Look for the Tags field.
- Click the X next to the tag you want gone.
- Seal the deal by clicking Save interface.
Peering into tagland
To scrutinise the tags on an interface:
- Navigate to Machines.
- Choose the machine linked to the target interface.
- Go to Network.
- Hit Edit physical on the row for your chosen interface.
- Observe the Tags field.
- Click Cancel when done marvelling.
Network tags (CLI)
Discover your interface’s ID
Identify your network interfaces with a command akin to this:
maas $PROFILE interfaces read $SYSTEM_ID \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
Example:
maas admin interfaces read xn8taa \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
Expect output like:
mac_address type id tags
----------- ---- -- ----
00:16:3e:18:7f:ee physical 9 andrpko plinko cochise
Tag it up, CLI style
Tag your network interface with this command format:
maas $PROFILE interface add-tag $SYSTEM_ID $INTERFACE_ID tag=$TAG_NAME
Example:
maas admin interface add-tag xn8taa 9 tag=farquar
You’ll see a verbose JSON output revealing the changes.
CLI tag deletion
To exterminate a tag:
maas $PROFILE interface remove-tag $SYSTEM_ID $INTERFACE_ID tag=$TAG_NAME
Example:
maas admin interface remove-tag xn8taa 9 tag=farquar
You’ll be greeted with a JSON output that confirms the tag’s removal.
Tag census
List all tags with:
maas $PROFILE interfaces read $SYSTEM_ID \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
Example:
maas admin interfaces read xn8taa \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
Expect output like:
mac_address type id tags
----------- ---- -- ----
00:16:3e:18:7f:ee physical 9 andrpko plinko cochise farquar
Single-interface tag viewing
To scope out tags on a specific interface:
maas $PROFILE interface read $SYSTEM_ID $INTERFACE_ID \
| jq '.tags'
Example:
maas admin interface read xn8taa 9 | jq '.tags'
Anticipate a JSON output displaying the tags.
Last updated a month ago.