Skip to content

NAT Outside IP not modifyable after being assigned as Primary to NAT Inside Device/VM #6896

@moonrail

Description

@moonrail

NetBox version

v2.11.10

Python version

3.9

Steps to Reproduce

  1. Create a VM firewall1 with Interface interface1
  2. Create a VM virtualmachine1 with Interface ens192
  3. Create 2 IPs: 111.111.111.2/28, 10.0.0.4/24
  4. Assign IP 111.111.111.2/28 to firewall1 interface1
  5. Assign IP 10.0.0.4/24 to virtualmachine1 ens192
  6. Modify IP 111.111.111.2/28 to be the NAT Outside of IP 10.0.0.4/24
  7. Modify VM virtualmachine1 to use NAT-IP 111.111.111.2/28 as Primary IPv4
  8. Try to modify IP 111.111.111.2/28

Expected Behavior

IP 111.111.111.2/28 can be modified

Observed Behavior

IP 111.111.111.2/28 can not be modified.

Both UI and API return 400 "IP address is primary for virtual machine xyz but not assigned to it!"

It can only be deleted without error.

NetBox API:
Screenshot_20210805_163834

NetBox UI:
Screenshot_20210805_163720

The issue is found here in the model of IPAddress, where only direct assignments without respecting NAT assignments are fetched:

# Check for primary IP assignment that doesn't match the assigned device/VM

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