Welcome to our new portal experience - if you need any assistance or have questions, please click here.

Relocate multiple subnets to a parent subnet

Modified on: Tue, 31 Mar, 2026 at 4:09 PM

Edit subnet page has an option to "relocate" subnet for individual subnet. To do this in bulk, you can follow following steps.

?name=subnet_relocate_01.png

Export current subnets

Tools > Export > Subnet to get the CSV file. You can grab these from /api/1.0/subnets/ instead.
Also, you can skip these and directly enter the data in csv file as described below.

Create CSV file

?name=subnet_relocate_02.png

Create a csv file with 3 required headers: network, mask_bits and vrf_group_id. You can add name, description as extra columns if need be.
Network and mask_bits can be copied from CSV exported file in above step.
VRF group ID can be obtained via GUI, when you hover over the vrf group name, the last # in the url in status bar is the ID. (or you can export VRF groups from tools > exports > VRF)

Delete subnets to be re-imported

?name=delete_subnets.png

Since we will be re-adding these in right subnet, you need to delete the existing subnets(only those that will be re-imported). If IPs will be auto-discovered, then ignore the IPs. Otherwise, you can export IPs from Tools > Export or Reports > Report > Add Report > IP (and re-import IPs later).

Edit Python Script and execute

?name=python_script.png

Grab csv2d42apis.py from https://github.com/device42/API_Helpers.
Change the lines as highlighted above.
You can then execute the script and it will re-create the subnets under the right parent.

?name=subnet_relocated.png