Skip to content

Assign IPAddress to a Virtual interface issue #7047

Answered by candlerb
evsoares-meli asked this question in Q&A
Discussion options

You must be logged in to vote

As of Netbox v2.9.0, Interface was split into Interface and VMInterface.

Hence there is no longer an interface attribute on IPAddress, there is assigned_object. This is because an IPAddress can be linked to either an Interface or a VMInterface, and it uses a generic relation for this.

Here is some working code:
https://github.com/netbox-community/reports/blob/master/scripts/create_vm.py#L88

It creates a VirtualMachine, a VMInterface and an IPAddress, and links them together.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ryanmerolle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants