Import IPs does not set both Primary IPv4 and Primary IPv6 #679

Closed
opened 2025-12-29 16:24:41 +01:00 by adam · 1 comment
Owner

Originally created by @candlerb on GitHub (Jan 31, 2017).

(Netbox 1.8.3). To reproduce:

  • Create a device called "testimport"

  • Create an interface on this device called "default"

  • Go to "Import IPs" and paste the following CSV

    192.0.2.1/32,,,Active,testimport,default,True,
    2001:db8::1/128,,,Active,testimport,default,True,
    
  • Browse to the device "testimport"

image

image

Results: only one of the IP addresses (the IPv6 one) has been recorded as Primary.

However if I do two separate imports, each with one line of the CSV, then both addresses are recorded as primary.

Originally created by @candlerb on GitHub (Jan 31, 2017). (Netbox 1.8.3). To reproduce: * Create a device called "testimport" * Create an interface on this device called "default" * Go to "Import IPs" and paste the following CSV ~~~ 192.0.2.1/32,,,Active,testimport,default,True, 2001:db8::1/128,,,Active,testimport,default,True, ~~~ * Browse to the device "testimport" ![image](https://cloud.githubusercontent.com/assets/44789/22474893/39680e28-e7d5-11e6-9936-4fa76eff81c9.png) ![image](https://cloud.githubusercontent.com/assets/44789/22474815/f81ea774-e7d4-11e6-8302-e28957b584d2.png) Results: only one of the IP addresses (the IPv6 one) has been recorded as Primary. However if I do two separate imports, each with one line of the CSV, then both addresses are recorded as primary.
adam added the type: bug label 2025-12-29 16:24:41 +01:00
adam closed this issue 2025-12-29 16:24:42 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 31, 2017):

This seems to happen because both IP addresses are initialized with the same copy of the device model. One saves it with a primary IPv4 and no primary IPv6, and the other saves it with a primary IPv4 and no primary IPv6. Whichever comes last in the list will be the final iteration. This can be fixed by updating the Device directly in the database for each IP.

@jeremystretch commented on GitHub (Jan 31, 2017): This seems to happen because both IP addresses are initialized with the same copy of the device model. One saves it with a primary IPv4 and no primary IPv6, and the other saves it with a primary IPv4 and no primary IPv6. Whichever comes last in the list will be the final iteration. This can be fixed by updating the Device directly in the database for each IP.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#679