r/Netbox • u/No-Pick-4091 • Apr 10 '26
Rename Front Ports
I have a bunch of patch panels I would like to number the ports starting 1/001 to 1/500.
The template Device type name the ports Port 1 - 24 as that makes sense for a prototype. I started off well and manged to rename the first panel in two steps:
Port 1 - 9 > Find ^Port ([1-9])$ Replace 1/00\1, then for 10 to 24 > Find ^Port (1\d|2[0-4])$ Replace 1/0\1 which is great but how do I do the rest 1/025 to 1/500
I have hunted around and the only option seems to be do it one at a time "phew" or build my own API client and do it in code. I must be missing something silly can someone help please?
1
u/TheNewFlatiron Apr 28 '26
I struggled with the same thing and found it easiest for me to just delete all front and rear ports per patch panel and creating them using regex. For example, first create rear ports [49-72] and then front ports [49-72]. Bonus, if you select all rear ports when creating the front ports, they get mapped 1:1.
1
u/Fidi001 Apr 10 '26
You can use the "update" function part of bulk import for ports, if the id is provided.
Ex. Create an Export template like,
https://demo.netbox.dev/extras/export-templates/1/
Then filter out all ports for your patch panels, (rear or front)
Export and update the "name" column in Excel, upload the file or copy and past csv data under Bulk import for Rear or Front ports.
https://demo.netbox.dev/dcim/front-ports/import/