How is an IP role added?

663 views
Skip to first unread message

Terry McKenna

unread,
May 18, 2018, 3:08:55 PM5/18/18
to NetBox
Sorry if I've overlooked this in the docs or Github but I do not see how one adds a custom IP role; e.g., anycast, loopback, etc. in the web interface. Can someone please direct me to the document that details the steps?

Also may I suggest a default for lights-out, Out-of-Band, etc.

Thanks

Brian Candler

unread,
May 22, 2018, 5:29:40 AM5/22/18
to NetBox
There isn't a documented way to add these roles AFAIK; they are hard-coded in python.  See netbox/ipam/constants.py.

# IP address roles
IPADDRESS_ROLE_LOOPBACK = 10
IPADDRESS_ROLE_SECONDARY = 20
IPADDRESS_ROLE_ANYCAST = 30
IPADDRESS_ROLE_VIP = 40
IPADDRESS_ROLE_VRRP = 41
IPADDRESS_ROLE_HSRP = 42
IPADDRESS_ROLE_GLBP = 43
IPADDRESS_ROLE_CARP = 44
IPADDRESS_ROLE_CHOICES = (
    (IPADDRESS_ROLE_LOOPBACK, 'Loopback'),
    (IPADDRESS_ROLE_SECONDARY, 'Secondary'),
    (IPADDRESS_ROLE_ANYCAST, 'Anycast'),
    (IPADDRESS_ROLE_VIP, 'VIP'),
    (IPADDRESS_ROLE_VRRP, 'VRRP'),
    (IPADDRESS_ROLE_HSRP, 'HSRP'),
    (IPADDRESS_ROLE_GLBP, 'GLBP'),
    (IPADDRESS_ROLE_CARP, 'CARP'),
)

If you extend this list then in principle I think it should work, but you will then have effectively made your own local fork of Netbox and you'll have to maintain your changes going forward.

The concept of "lights-out / Out-of-Band" is handled in a different way in Netbox.  You do this by creating a Management (out-of-band) interface on a Device, and associating the IP address with that interface.  There is a checkbox on the interface for marking it as such.


You can't mark an IP address as being "lights out" unless it's actually associated with a specific device.
Reply all
Reply to author
Forward
0 new messages