Skip to content

CSV Import IP Addresses - Can set as primary IP on device without specifying an interface #7647

@rhyser9

Description

@rhyser9

NetBox version

v3.0.4

Python version

3.8

Steps to Reproduce

Only tested v3.0.4, but don't see any relevant changelogs on more recent versions.

  1. Create a device
  2. Import an IP address via CSV, and specify 'device' and 'is_primary'
address,status,device,is_primary
1.1.1.1/32,active,my_device,true

Expected Behavior

The CSV import should fail if is_primary is defined without a valid device and interface pair being defined.

or

Primary IPs should not be dependent on being assigned to an interface, but rather any defined IP object should be valid.

Observed Behavior

Created IP address object does not indicate that it is assigned to a device:
image

Device shows that a primary IP is assigned, despite that IP not being assigned to an interface.
image
image

Editing my_device details results in the primary IP being removed.

Bulk editing a range of devices that includes my_device (i.e. to add a tag) results in the error my_device failed validation: The specified IP address (1.1.1.1/32) is not assigned to this device.

Deleting the imported IP does properly remove the primary IP from the device (I half expected that to fail somehow).

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions