Method to import VLAN / Interface mappings?

1,054 views
Skip to first unread message

Andrew Slater

unread,
Apr 1, 2021, 6:21:52 AM4/1/21
to NetBox
HI All,

Trying to find a way of bulk importing / updating interface VLAN mappings.

For example, a switch with 24 interfaces, I can see a way of updating descriptions and mode with the usual import csv. I can't see a way of bulk updating the access vlan or tagged VLAN list?

Any ideas or does this need to be done programatically?

Thanks
Andy

Brian Candler

unread,
Apr 1, 2021, 7:16:04 AM4/1/21
to NetBox
CSV does not support any updating of existing objects - only creating new objects from scratch.  Even for importing new interfaces, it doesn't support setting the access VLAN or list of tagged VLANs.

Your best bet is to write something either using the REST API, or using the Django model (e.g. via nbshell)

Andrew Slater

unread,
Apr 1, 2021, 7:17:46 AM4/1/21
to NetBox
Ok thought as much, thanks anyway!

Heinz Meier

unread,
Apr 1, 2021, 9:03:15 AM4/1/21
to NetBox
Hi,

I write an interface importer for devices. Please see https://blog.sys4.de/onboarding-interfaces-with-netbox-en.html

My ideas was to call the script via a webhook from netbok every time it sees a new device i.e. from onboarding.

Since it is a simple script, you can improve it to update also VLAN, LAG and other information.

Michael

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/fdc7d13e-d8fc-421c-bc85-1176660c9b33n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages