NetBox GeoIP v1.0
π§ NetBox GeoIP Plugin β v1.0
βοΈ Requirements
Release Date: February 2025
Requires: NetBox 4.0.5 - 4.1.3 β’ Python β₯ 3.10
π Initial Release
The first public release of the NetBox GeoIP Plugin, providing IP geolocation data management directly within NetBox.
β¨ Key Features
-
GeoIP Data Model
- Store and manage geolocation metadata for IP Addresses and Prefixes.
- Includes fields for:
CountryRegionSubdivision CodeCitySubnetStatus
-
Integration with NetBox Custom Fields
- Adds four custom fields to IP Addresses and Prefixes:
geoip_feedβ Enable or disable GeoIP for the object.countryβ Linked toCountrymodel.regionβ Linked toRegionmodel.cityβ Text field for specifying the city name.
- Automatically groups these under a "GeoIP Info" section.
- Adds four custom fields to IP Addresses and Prefixes:
-
Built-in Country and Region Data
- Preloaded CSV data for all ISO country and region codes.
- Data automatically imported during migration.
-
Dynamic Region Filtering
- When selecting a country, the Region dropdown dynamically filters available regions.
-
Automatic Field Creation
- Migration
0004_create_custom_fields.pyautomatically creates GeoIP-related custom fields in NetBox.
- Migration
-
IPAM URL Integration
- Migration
0005_update_ipam_urls.pyautomatically editipam.urls.py. - This is to extend NetBoxβs Prefix and IPAddress add/edit pages to include GeoIP fields to have Dynamic Region Filtering.
+ from netbox_geoip import views as netbox_geoip_views # added on the top # Prefixes ... + # path('prefixes/add/', views.PrefixEditView.as_view(), name='prefix_add'), + path('prefixes/add/', netbox_geoip_views.CustomPrefixAddView.as_view(), name='prefix_add'), ... + # path('prefixes/edit/', views.PrefixBulkEditView.as_view(), name='prefix_bulk_edit'), + path('prefixes/edit/', netbox_geoip_views.CustomPrefixBulkEditView.as_view(), name='prefix_bulk_edit'), ... # IP addresses ... + # path('ip-addresses/add/', views.IPAddressEditView.as_view(), name='ipaddress_add'), + path('ip-addresses/add/', netbox_geoip_views.CustomIPAddressAddView.as_view(), name='ipaddress_add'), ... + # path('ip-addresses/edit/', views.IPAddressBulkEditView.as_view(), name='ipaddress_bulk_edit'), + path('ip-addresses/edit/', netbox_geoip_views.CustomIPAddressBulkEditView.as_view(), name='ipaddress_bulk_edit'),
- Migration
π» Installation
NetBox Configuration
Add the plugin to the NetBox config. ~/netbox/configuration.py
PLUGINS = ["netbox_geoip"]Installation
$ source /opt/netbox/venv/bin/activate
(venv) $ pip install /path/netbox-geoipTo add the netbox_geoip tables to NetBox database:
(venv) $ python manage.py migrate netbox_geoip