Metadata-Version: 2.4
Name: netbox-routing-plugin
Version: 1.0.3
Summary: A NetBox Routing Plugin
Author: Daniel Sheppard
Maintainer: Arturo
License-Expression: Apache-2.0
Project-URL: Upstream, https://github.com/dansheps/netbox-routing
Project-URL: Documentation, https://github.com/baldoarturo/netbox-routing-plugin/blob/main/README.md
Project-URL: Source, https://github.com/baldoarturo/netbox-routing-plugin
Project-URL: Tracker, https://github.com/baldoarturo/netbox-routing-plugin/issues
Keywords: netbox-plugin
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 6
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Telecommunications Industry
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: System
Classifier: Topic :: System :: Hardware
Classifier: Topic :: System :: Hardware :: Mainframes
Classifier: Topic :: System :: Networking
Classifier: Topic :: System :: Networking :: Firewalls
Classifier: Topic :: System :: Operating System
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django-polymorphic
Requires-Dist: regex
Dynamic: license-file

# Netbox Routing Plugin

[![PyPI](https://img.shields.io/pypi/v/netbox-routing-plugin.svg?v=2)](https://pypi.org/project/netbox-routing-plugin/)
[![Python](https://img.shields.io/pypi/pyversions/netbox-routing-plugin.svg?v=2)](https://pypi.org/project/netbox-routing-plugin/)
[![NetBox](https://img.shields.io/badge/NetBox-4.7%2B-success.svg)](https://github.com/netbox-community/netbox)
[![CI](https://github.com/baldoarturo/netbox-routing-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/baldoarturo/netbox-routing-plugin/actions/workflows/ci.yml)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/LICENSE)

A plugin for tracking all kinds of routing information

<p align="center">
  <img src="https://raw.githubusercontent.com/baldoarturo/netbox-routing-plugin/main/docs/images/device-routing-tab.png" alt="The Routing tab of a device, with its static routes, OSPF instances and IS-IS instances" width="900">
</p>

Every routing protocol of a device in one Routing tab: static routes, OSPF, IS-IS, BGP and EIGRP.

> [!WARNING]
> **Work in progress, not production ready.** The data model, the API and the migrations can still change between versions. 1.0.0 is the first release on PyPI.

## About this project

This plugin was originally created by Daniel Sheppard ([`dansheps`](https://github.com/dansheps/netbox-routing)), who holds the copyright of his original code under the Apache 2.0 license. This repository is an independent fork of his project, maintained by Arturo ([`baldoarturo`](https://github.com/baldoarturo)). It is not the upstream project and is not endorsed by Daniel Sheppard: for the original project, see his repository. This fork is developed with the help of AI, using [Claude Code](https://claude.com/claude-code) to speed up development: Claude writes the code, tests and documentation, and the maintainer sets the direction and reviews and approves the changes.

## Documentation

The documentation for operators and users (every protocol and feature, with the RFC it comes from) is in [`docs/`](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/index.md). Start with [Using the plugin](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/using.md); the [RFC index](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/rfc-index.md) goes from an RFC to the features that use it, and [Development](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/development.md) explains how to work on the docs.

## Features

### Ready

* [Routing objects](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/routing-objects.md)
  * [Prefix lists](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/routing-objects.md#prefix-lists)
  * [AS paths](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/routing-objects.md#as-paths)
  * [Communities](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/routing-objects.md#communities) and [community lists](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/routing-objects.md#community-lists)
* [Route policies](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/routing-objects.md#route-policies) (match and set, jump to another policy, final deny, search tool; used by OSPF, IS-IS and EIGRP)
* [Static routes](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/protocols/static.md) (special next hops, interface, route leaking)
* [OSPF, versions 2 (IPv4) and 3 (IPv6)](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/protocols/ospf.md) (instances, areas, interfaces, authentication with key rollover, redistribution, virtual links, ranges, neighbors, traffic engineering, segment routing, fast reroute)
* [IS-IS](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/protocols/isis.md) (instances, levels, interfaces, authentication, redistribution, route leaking, segment routing, Flex-Algo, SRv6)
* [BGP](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/protocols/bgp.md) (instances, address families, peer groups, peers, listen ranges, redistribution, originated networks and aggregates, route policy; RFC 4271 and its extensions)
* [BFD profiles](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/bfd.md) (timers, Simple Password and Keyed MD5 authentication, single-hop and multihop mode, echo interval; RFC 5880, 5881, 5882, 5883; used by BGP, OSPF and IS-IS)
* [EIGRP](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/protocols/eigrp.md) (named mode only; routers, address families with autonomous system and K values, networks, interfaces with timers, authentication, stub, passive default and bandwidth, summaries, redistribution; RFC 7868)

### Work in progress

Not production ready; the model and the migrations can still change. Each one has a tracking issue.

* Segment routing ([tracking #201](https://github.com/baldoarturo/netbox-routing-plugin/issues/201))

# Requirements

* NetBox 4.7+
* Python 3.12+

## Installation

The plugin requires NetBox 4.7 or later and Python 3.12 or later. It is published on [PyPI](https://pypi.org/project/netbox-routing-plugin/) as `netbox-routing-plugin`. The steps below use the release from PyPI; to install the development version from GitHub, replace `netbox-routing-plugin` with `git+https://github.com/baldoarturo/netbox-routing-plugin.git`.

Plugins are described in the [NetBox plugin installation procedure](https://netboxlabs.com/docs/netbox/plugins/#installing-plugins). Pick the section that matches how you run NetBox.

### Bare metal

The steps below assume NetBox is installed in `/opt/netbox`; adjust the paths to match your installation.

1. Install the package into NetBox's virtual environment:

   ```shell
   source /opt/netbox/venv/bin/activate
   pip install netbox-routing-plugin
   deactivate
   ```

2. Add it to `local_requirements.txt`, so that NetBox's upgrade script installs it again after an upgrade:

   ```shell
   echo "netbox-routing-plugin" >> /opt/netbox/local_requirements.txt
   ```

3. Enable the plugin in `/opt/netbox/netbox/netbox/configuration.py`:

   ```python
   PLUGINS = [
       'netbox_routing_plugin',
   ]
   ```

   The plugin has no required settings. To change the defaults, add a `PLUGINS_CONFIG` entry; see [Configuration](#configuration).

4. Apply the database migrations and collect the static files:

   ```shell
   source /opt/netbox/venv/bin/activate
   python3 /opt/netbox/netbox/manage.py migrate
   python3 /opt/netbox/netbox/manage.py collectstatic --no-input
   deactivate
   ```

5. Restart NetBox and its worker:

   ```shell
   sudo systemctl restart netbox netbox-rq
   ```

6. Check that it works: sign in to NetBox as an administrator and open **Admin → Plugins**. *Netbox Routing Plugin* is listed, and the **Routing** menu appears in the navigation bar.

To upgrade, activate the virtual environment and run `pip install -U netbox-routing-plugin`, then repeat steps 4 and 5. Read the [CHANGELOG](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/CHANGELOG.md) for the changes of each version.

### Docker

Plugins are not installed with `pip` inside a running container: they are added to a custom image, built on top of the official `netboxcommunity/netbox` image. The steps below follow the layout of [netbox-docker](https://github.com/netbox-community/netbox-docker); the [netbox-docker plugin instructions](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins) describe the same thing in more detail.

1. In the directory where your `docker-compose.yml` is, create `plugin_requirements.txt` with the package:

   ```text
   netbox-routing-plugin
   ```

2. Create `Dockerfile-Plugins`. The `FROM` line must be the same NetBox image tag you run in `docker-compose.yml`:

   ```dockerfile
   FROM netboxcommunity/netbox:v4.7

   COPY ./plugin_requirements.txt /opt/netbox/
   RUN /opt/netbox/venv/bin/pip install --no-warn-script-location -r /opt/netbox/plugin_requirements.txt
   ```

3. Create `docker-compose.override.yml`, so that the NetBox services are built from that file. Use the same image name for the three services:

   ```yaml
   services:
     netbox:
       build:
         context: .
         dockerfile: Dockerfile-Plugins
       image: netbox-custom:4.7
     netbox-worker:
       image: netbox-custom:4.7
     netbox-housekeeping:
       image: netbox-custom:4.7
   ```

   If your `docker-compose.yml` has a different service name for the worker or the housekeeping container, use that name.

4. Enable the plugin in `configuration/plugins.py`:

   ```python
   PLUGINS = [
       'netbox_routing_plugin',
   ]
   ```

5. Build the image and start the containers:

   ```shell
   docker compose build --no-cache
   docker compose up -d
   ```

   The migrations and `collectstatic` run when the container starts, so there is no separate step.

6. Check that it works: sign in to NetBox as an administrator and open **Admin → Plugins**. *Netbox Routing Plugin* is listed.

To upgrade the plugin, change the version in `plugin_requirements.txt` (or leave it unpinned), then run `docker compose build --no-cache` and `docker compose up -d` again.

## Configuration

None

## Usage

See [Using the plugin](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/docs/using.md): the menu, how the objects relate to each other, bulk import and validation.

## Additional Notes

TBD

## Contribute

Contributions are always welcome!  Please open an issue first before contributing as the scope is going to be kept
intentionally narrow

Install the pre-commit hooks once in your clone (`pip install pre-commit`, then `pre-commit install`): they run Ruff
and Black on every commit with the same configuration as the CI, which runs `pre-commit run --all-files` on every pull
request. See [`dev/README.md`](https://github.com/baldoarturo/netbox-routing-plugin/blob/main/dev/README.md) to run NetBox and the tests.
