NetBox Tutorial – From scratch to correlated service…

There’s a lot of NetBox tutorials out there, but I’ve often struggled to find one that shows from scratch -> service. NetBox is often seen as a ‘just’ an infrastructure tool, but really the power of things like custom fields and tags allow for much more.

In this tutorial we’ll go from an empty NetBox to 4 devices, linked together, with basic “DIA” service – that is, 2 routed interfaces, with a floating IP, and two switch access ports.

You could apply this to service provider or enterprise land in reality.

Our Topology

I’ve kept our topology very simple for this example. We have a common layer 2 network underneath 2 routers, and 2 switches with access ports

Prefix Usage
1.1.1.1/24Shared IP Between Devices
1.1.1.2/24router1 – et-0/0/1.2
1.1.1.3/24router2 – et-0/0/1.2
Table showing using with the 1.1.1.0/24 Prefix

Creating the Topology within NetBox

Creating Pre-Requisites

I’m going to assume here you have a completely empty NetBox and take you through the absolute basics.. so before we do anything, we need to create some pre-requisites for the objects we want to create.

The way to recognise these is via NetBox bolded fields, for example if you try to create a device, you’ll see these:

So for a device, we know role, device type (shown) and site are all pre-requisites

I’ve summarised the pre-requisites below

ObjectRequired Objects
DeviceDevice Role, Device Type, Site
Device TypeManufacturer

In this context I’m going to base our Devices on Juniper devices, this could be anything, however of late I’ve been working with Juniper – lets create our ‘required’ objects now.

Manufacturer

Create a manufacturer with name Juniper, slug juniper … from Devices -> Manufacturers, then click Create.

Site

From organisation -> sites, click on the + button and create the site below

Role

Lets create 2 device roles, router and switch

Device Types

I’m going to use 2 real world device types here from Juniper, an MX204 (4x 100GE QFP28 Interfaces + 8x 10Gb SFP+) and a QFX-5100-48T-6Q (48x 100/1Gb/10Gb + 6x 40GE QSFP+), lets do this now.

MX204

Firstly, create a base Device Type (from Devices -> Device Types) with the following, leave all other fields blank and click Create.

When completed NetBox will drop you into the new MX204 itself. From the top row of buttons select Add-Components -> Interfaces.

Lets add the 100Gb interfaces using a range to quicken creation:

and then the 10Gb interfaces:

This completes our “base” MX204 Device Type. Yes we could add far more (loopbacks, etc) but we’re keeping this simple.

Our interfaces should look like the below:

This image has an empty alt attribute; its file name is image-8-1024x523.png
QFX5100-48T-6Q

Again, as per the MX204 – a base device type

to this, add the 48 100/1Gb/10Ge:

and finally the 6x QSFP+

Congrats, we’ve modelled 2 Juniper devices. Now we need to create our actual Device Instances from those device types.

Creating Our Devices

Lets create 4 devices, 2 routers, and 2 switches summarised by the table below:

NameTypeRoleSite
router1MX204RouterMy Site
router2MX204RouterMy Site
Switch1QFX5100-48T-6QSwitchMy Site
Switch2QFX5100-48T-6QSwitchMy Site

Lets create router1

Now do the same for router2, switch1 and switch2, based on the table above, which should give us the 4 devices as shown:

Linking Our Devices

Within our topology are devices are cabled together via the following interfaces

SourceDestination
Router1 – et-0/0/1Switch1 – et-0/0/48
Router2 – et0/0/1Switch2 – et-0/0/48
Switch1 – et-0/0/49Switch2 – et-0/0/49

Firstly, lets to go Router -> Interfaces and connect et-0/0/1 to an interface, using the green button then connection type “interface”

Connect this to et-0/0/48 of switch 1

then repeat this process for the second and third links in the table above.

Verify both links by going to connections -> cables:

Create a Tag

We going to use tags to collate the service data together, Tags are an amazing feature of NetBox that lets us group random elements together, so lets initially create a tag for our service, from Customisation -> Tags