devon-mar / netbox-kea

Manage Kea DHCP leases in NetBox.
Apache License 2.0
73 stars 3 forks source link
netbox netbox-plugin

NetBox plugin for the Kea DHCP server

This plugin allows you to view Kea status, leases and subnets in NetBox. Go directly from a NetBox device/VM to a DHCP lease and back!

Features

Screenshot of DHCP leases

Limitations

Requirements

Compatibility

Installation

  1. Add netbox-kea to local_requirements.txt.

  2. Enable the plugin in configuration.py

    PLUGINS = ["netbox_kea"]
  3. Run ./manage.py migrate

Custom Links

You can add custom links to NetBox models to easily search for leases.

Make sure to replace <Kea Server ID> in the link URL with the object ID of your Kea server. To find a server's ID, open the page for the server and look at the top right corner for netbox_kea.server:<Server ID Here>.

Show DHCP leases for a prefix

Content types: IPAM > Prefix

Link URL: https://netbox.example.com/plugins/kea/servers/<Kea Server ID>/leases{{ object.prefix.version }}/?q={{ object.prefix }}&by=subnet

Show DHCP leases for a device/VM interface (by MAC):

Content types: DCIM > Interface, Virtualization > Interface

Link URL (DHCPv4): https://netbox.example.com/plugins/kea/servers/<Kea Server ID>/leases4/?q={{ object.mac_address }}&by=hw

Link URL (DHCPv6): https://netbox.example.com/plugins/kea/servers/<Kea Server ID>/leases6/?q={{ object.mac_address }}&by=hw

Show DHCP leases for a device/VM (by name):

Content types: DCIM > Device, Virtualization > Virtual Machine

Link URL (DHCPv4): https://netbox.example.com/plugins/kea/servers/<Kea Server ID>/leases4/?q={{ object.name|lower }}&by=hostname

Link URL (DHCPv4): https://netbox.example.com/plugins/kea/servers/<Kea Server ID>/leases6/?q={{ object.name|lower }}&by=hostname

You may also use a custom field by replacing {{ object.name|lower }} with {{ object.cf.<your custom field>|lower }}.