Cannot add a tagged vlan to the interface via Custom Script. #17455
Unanswered
LuaLua10
asked this question in
Help Wanted!
Replies: 1 comment 1 reply
-
In your script : interface_switch = switch.interfaces.get(name=interface)
with transaction.atomic():
interface_switch.mode = "tagged"
interface_switch.save()
interface_switch.tagged_vlans.add(vlan) It is important to have the mode then save then add ! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Deployment Type
Self-hosted
NetBox Version
NetBox Community v4.1.0
Python Version
3.12
Steps to Reproduce
The code for adding VLANs to interfaces
The full version of the script
Expected Behavior
The presence of tagged vlans on the interface.
Observed Behavior
Absence of tagged vlans on the interface.
Note that non-tagged vlans are added correctly.
Beta Was this translation helpful? Give feedback.
All reactions