Friday, May 8, 2026
World News Prime
No Result
View All Result
  • Home
  • Breaking News
  • Business
  • Politics
  • Health
  • Sports
  • Entertainment
  • Technology
  • Gaming
  • Travel
  • Lifestyle
World News Prime
  • Home
  • Breaking News
  • Business
  • Politics
  • Health
  • Sports
  • Entertainment
  • Technology
  • Gaming
  • Travel
  • Lifestyle
No Result
View All Result
World News Prime
No Result
View All Result
Home Business

Two New Ways to Bring NetBox Into Your CML Networks

December 14, 2025
in Business
Reading Time: 10 mins read
0 0
0
Two New Ways to Bring NetBox Into Your CML Networks
Share on FacebookShare on Twitter


I had a really busy fall this yr, and now I can’t imagine it’s been three months since my final weblog, “Bringing Some Supply of Fact to Your NetAI Agentic Playground.” That’s far longer than I had deliberate after I made my “public accountability assertion” about my subsequent weblog put up being concerning the work I had performed to carry NetBox into my CML simulations in a simple and seamless style.

However in the present day, I’m again. And wanting to reveal two new contributions to the Cisco Modeling Labs (CML) neighborhood to your fast use:

A CML node and picture definition for a NetBox server
CML2NetBox, a Python utility that auto-populates NetBox primarily based on a CML lab

Let’s dive into every of those choices and see how they work!

NetBox server node for Cisco Modeling Labs

Not each CML community I construct wants a NetBox server, however every time I’m engaged on a brand new community automation challenge, or one thing that entails creating a duplicate (or shut reproduction) of our manufacturing community—a “digital cousin,” so to talk—I’ll wish to have a supply of reality populated with information from the community simulation.

Previously, I’ve manually populated NetBox with information utilizing APIs, scripts, or CSV imports. Nonetheless, these choices aren’t nice, they usually weren’t a part of the lab itself. That’s the place this new node definition is available in.

Now I can merely drag the “NetBox” node into the topology and configure it to auto-populate from the CML lab definition itself.

Showing the new NetBox node for CML in the web GUI
Including NetBox to a community topology in CML

After that, simply begin the lab, and the node will learn the CML lab info and mechanically create websites, gadgets, IP addresses, and even cables connecting interfaces throughout all nodes within the topology.

 

Showing the NetBox web interface with data auto populated from CMLShowing the NetBox web interface with data auto populated from CML
NetBox information matches the CML topology

Fairly neat, proper? For these of you interested by some technical particulars, let’s dive in somewhat deeper.

First up, the node definition, or extra precisely, the picture definition that has been constructed and shared, relies on the Alpine 3.21 picture included on the CML 2.9 reference platform. The NetBox-Docker challenge was then used to deploy NetBox Neighborhood v4.4.5.

This NetBox server is meant to run inside CML as a part of lab topologies, and I wished it to be very straightforward to make use of in these labs. So I made some “opinionated” selections in its configuration.

To align with different default credentials for nodes inside CML, the admin consumer for NetBox has been pre-created with a username and password of cisco.

I additionally created an API token “0123456789012345678901234567890123456789” for this consumer. (You’re welcome to vary these default credentials after you begin the node, however having an admin account and API entry out there at node startup enables you to get began together with your community automation work instantly while not having to arrange NetBox your self.)

As well as, I’ve pre-populated a Producer referred to as “CML” together with Gadget Varieties for every of the CML node varieties within the reference platform, in addition to a number of further node definitions from the cml-community and my private use. Having them pre-created hastens including gadgets to NetBox. Nonetheless, if in case you have a node definition that’s NOT included within the base picture, don’t fear. The code that populates NetBox will dynamically create new Gadget Varieties as wanted.

Whereas I labored to make utilizing the NetBox node as straightforward as potential, there are necessities for including it to a lab so it could possibly entry the CML lab particulars to populate NetBox. I’ve supplied full particulars within the CML Neighborhood README for the node, and I encourage you to learn them while you arrange the brand new node by yourself CML server. I’ll cowl the highlights right here as nicely.

For starters, the NetBox node will want connectivity to the CML server’s REST API by an “exterior connector” node. It may be both a bridge or a NAT-based exterior connector; nevertheless, for a NAT-based connector, it’s essential to replace a firewall rule within the CML Cockpit interface first. Full particulars on the change required and why are documented within the README.

Subsequent, you’ll must replace the default CONFIG for the node with particulars to your CML server and the lab you wish to synchronize with. The default day 0 config supplied with the node contains detailed feedback I left to assist customers perceive the choices and use the node. You’ll discover optionally available blocks for customizing the server’s community configuration, however to mechanically populate NetBox from CML, you’ll must uncomment and supply particulars for a set of atmosphere variables.

# export VIRL2_URL=https://192.168.255.1
# export VIRL2_USER=admin
# export VIRL2_PASS=1234QWer
# export VIRL2_VERIFY_SSL=False
# export LAB_NAME=”My CML Lab”

These values are wanted as a result of, whereas the NetBox server runs on the CML server, there isn’t a approach for the node to mechanically “know” these particulars concerning the server. So we offer them as ENVs so the scripts that connect with CML know the deal with, credentials, and which lab on the CML server to synchronize with. I count on that you simply’ll synchronize the identical lab that the NetBox node is operating on, however you don’t must.  You may synchronize any lab from the CML server.

Talking of scripts, you’ll see references to 2 scripts on the finish of the configuration. These scripts first guarantee NetBox is up and operating, then connect with and sync from CML. The output from each of those scripts is saved on the node in two log recordsdata that you would be able to evaluate after the node finishes booting. Simply connect with the NetBox server’s console and evaluate the contents of the recordsdata.

((.venv) ) netbox-server:~$ cat startup_log.txt

Checking if NetBox (http://localhost) is responding…
Web site not responding, ready 5 seconds… (try 1/48)
.
Web site not responding, ready 5 seconds… (try 14/48)
Web site is responding! (try 15)

Checking if CML Controller (https://192.168.255.1) is reachable…
Web site is responding! (try 1)

Writing VIRL2 atmosphere variables to /house/cisco/.profile…
Making an attempt to sync topology to NetBox…
🔄 Beginning lab topology synchronization…
📡 CML Server: https://192.168.255.1
🗄️ NetBox Server: http://localhost
🧪 Lab Title: Instance NetBox Server Topology

Starting lab synchronization now.
Including 6 nodes from CML lab ‘Instance NetBox Server Topology’ to NetBox
📊 Processed 5/6 gadgets…
Including cables for six nodes from CML lab ‘Instance NetBox Server Topology’ to NetBox
📊 Processed cables for five/6 gadgets…

Topology synced efficiently.

When you are on the console, you’ll be able to re-run the sync like this.

((.venv) ) netbox-server:~$ cml2netbox sync lab

🔄 Beginning lab topology synchronization…
📡 CML Server: https://192.168.255.1
🗄️ NetBox Server: http://localhost
🧪 Lab Title: Instance NetBox Server Topology
Starting lab synchronization now.
Including 7 nodes from CML lab ‘Instance NetBox Server Topology’ to NetBox
📊 Processed 5/7 gadgets…
Including cables for 7 nodes from CML lab ‘Instance NetBox Server Topology’ to NetBox
📊 Processed cables for five/7 gadgets…

You would possibly marvel why you’d wish to re-run the sync? In the event you add extra nodes to the CML topology after it begins, or add hyperlinks between gadgets, these modifications will likely be mechanically added to NetBox.  In the event you’ve deleted nodes or cables, the script received’t clear these out; you’ll must delete them manually.

And you may also marvel what cml2netbox is? Nicely, that’s the underlying “magic” that makes this node work. And it’s the topic we’re going to speak about subsequent!

CML2NetBox: A Python utility for EVERYONE!

I notice that a few of you may want your CML lab information in NetBox, however not in a NetBox occasion operating within the CML lab; reasonably, in a NetBox server you have already got operating. If that sounds such as you, then don’t fret, simply pip set up cml2netbox and have enjoyable!

The reality is that the NetBox server node makes use of cml2netbox underneath the hood; it’s packaged immediately into the node/picture definition and mechanically configured and run throughout node initialization. However now let’s take a look at how we are able to use the utility immediately.

Much like the node configuration, you’ll want to supply values for the CML server you’ll be synchronizing from, and additionally, you will must configure the small print for the NetBox server you’ll be synchronizing to. An instance .env file is supplied with the code on GitHub.

# CML2NetBox Configuration Instance
# Copy this file to .env and fill in your values

# CML Lab Particulars
LAB_NAME=”Your CML Lab”
LAB_ID=”your-lab-id-uuid-if-needed”

# CML Server Configuration
# May use VIRL2_* variants for backward compatibility
CML2_URL=https://your-cml-server.instance.com
CML2_USER=your-username
CML2_PASS=your-password
CML2_VERIFY_SSL=True

# NetBox Server Configuration
NETBOX_URL=https://your-netbox-server.instance.com
NETBOX_API_TOKEN=your-api-token-here
NETBOX_VERIFY_SSL=True

Simply copy this file and supply the info to your personal servers.

For completeness’ sake, you too can present all this information as command-line choices when operating cml2netbox, however I discover setting them in a file is easier than typing them each time I run the command.

Let’s see what choices exist for the device.

cml2netbox sync –help
Utilization: cml2netbox sync [OPTIONS] COMMAND [ARGS]…

Synchronization instructions for CML and NetBox integration.

Choices:
–help Present this message and exit.

Instructions:
device-types Sync CML gadget varieties with NetBox gadget varieties.
lab Sync CML lab topology with NetBox.

There are two choices. Good.

You possibly can “put together” a NetBox server by creating the CML producer and gadget varieties for all node definitions with cml2netbox sync device-types. Nonetheless, this isn’t required. In the event you run cml2netbox sync lab earlier than syncing the gadget varieties, the device will create gadget varieties for every node within the lab. It will take somewhat longer the primary time, as new device-types are created. But it surely does imply solely the required gadget varieties will likely be created.

However the true enjoyable comes while you sync a lab like this.

cml2netbox sync lab

🔄 Beginning lab topology synchronization…
📡 CML Server: https://100.75.36.232
🗄️ NetBox Server: http://100.75.36.232:6999
🧪 Lab Title: CCNA Prep 2025 S3E3 Superior ACL Exploration
Starting lab synchronization now.
Including 8 nodes from CML lab ‘CCNA Prep 2025 S3E3 Superior ACL Exploration’ to NetBox
📊 Processed 5/8 gadgets…
Including cables for 8 nodes from CML lab ‘CCNA Prep 2025 S3E3 Superior ACL Exploration’ to NetBox

On this instance, I synchronized a 2nd CML lab from the topology above into the NetBox server to show what occurs while you sync a number of CML labs into the identical NetBox server and the way they’re differentiated.

Sites view of the NetBox web interface showing two sites, one for each CMl topology synchronized.Sites view of the NetBox web interface showing two sites, one for each CMl topology synchronized.
Every CML topology corresponds to a NetBox Web site

CML2NetBox will create a brand new NetBox Web site for every CML lab synchronized.  Which means you should use a single NetBox server to carry information from 1, 10, and even 100 CML topologies!

And one final observe… cml2netbox will create a .log file for every run of the device. By default, the logging degree is INFO, however should you run in “verbose” mode, you’ll get DEBUG degree logging within the file. This may be useful if/when one thing goes fallacious in a sync job, so you’ll be able to work out what occurred. In my testing, this most frequently occurs when you will have a number of labs on a single NetBox server and encounter duplicate or conflicting objects.

cml2netbox -v sync lab

tail -n 10 ./20251202-140246-cml2netbox.log


2025-12-02 14:03:13 – httpcore.http11 – DEBUG – response_closed.began
2025-12-02 14:03:13 – httpcore.http11 – DEBUG – response_closed.full
2025-12-02 14:03:13 – urllib3.connectionpool – DEBUG – http://100.75.36.232:6999 “GET /api/dcim/gadgets/?title=server-sw&site_id=2&restrict=0 HTTP/1.1” 200 1924
2025-12-02 14:03:13 – urllib3.connectionpool – DEBUG – http://100.75.36.232:6999 “GET /api/dcim/interfaces/?device_id=14&title=port0&restrict=0 HTTP/1.1” 200 2333
2025-12-02 14:03:13 – cml2netbox_pkg.netbox_helpers – INFO – Interface port0 already has a cable: 11
2025-12-02 14:03:13 – cml2netbox_pkg.netbox_helpers – INFO – No cables created for node server-sw
2025-12-02 14:03:13 – cml2netbox_pkg.netbox_helpers – INFO – Connecting cables for CML node setup-installation
2025-12-02 14:03:13 – cml2netbox_pkg.netbox_helpers – DEBUG – Skipping hyperlink the place present node will not be interface_a
2025-12-02 14:03:13 – cml2netbox_pkg.netbox_helpers – INFO – No cables created for node setup-installation
2025-12-02 14:03:13 – cml2netbox_pkg.cli – INFO – Accomplished synchronization of 8 nodes to NetBox

And performed!

Let it not be mentioned that Hank doesn’t preserve his guarantees… it simply would possibly take me 3 months to get to it 😉

Anyway, I hope you loved this weblog put up, and much more so, that you simply make the most of one or each of the choices I shared.

In case you are new to CML, please take a look at Introduction to Community Simulations with Cisco Modeling Labs | CMLLAB Studying Path in Cisco U.  You can even get began with Cisco Modeling Labs – Free Version fast and straightforward.

Till subsequent time!

Join Cisco U. | Be part of the  Cisco Studying Community in the present day totally free.

Study with Cisco

X | Threads | Fb | LinkedIn | Instagram | YouTube

Use  #CiscoU and #CiscoCert to hitch the dialog.

Converse Your Lab into Existence with AI-Pushed Cisco Modeling Labs and MCP

Utilizing CI/CD Pipelines for Infrastructure Configuration and Administration



Source link

Tags: AutomationbringCisco Modeling LabsCMLNetboxnetdevopsNetworksWays
Previous Post

A New Study Challenges the Way We Screen for Breast Cancer

Next Post

The Game Awards 2025 – Our Reactions To The Biggest Reveals | The Game Informer Show

Related Posts

UK drivers could be denied car finance compensation as firms lodge legal battle
Business

UK drivers could be denied car finance compensation as firms lodge legal battle

May 8, 2026
After Addiction and Ironman Failure, This Founder Adopted a Rule That Changed Everything
Business

After Addiction and Ironman Failure, This Founder Adopted a Rule That Changed Everything

May 8, 2026
Blue chips falter amid wait for Middle East deal
Business

Blue chips falter amid wait for Middle East deal

May 7, 2026
Cisco Networking App Marketplace Partners at Cisco Live 2026
Business

Cisco Networking App Marketplace Partners at Cisco Live 2026

May 8, 2026
Revealed: The five high street banks with the most customer complaints
Business

Revealed: The five high street banks with the most customer complaints

May 7, 2026
Month of Developer Productivity: Build and Forget
Business

Month of Developer Productivity: Build and Forget

May 7, 2026
Next Post
The Game Awards 2025 – Our Reactions To The Biggest Reveals | The Game Informer Show

The Game Awards 2025 - Our Reactions To The Biggest Reveals | The Game Informer Show

FDA Announces Nationwide Recall of Nasal Spray Due to Bacterial Contamination

FDA Announces Nationwide Recall of Nasal Spray Due to Bacterial Contamination

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Trending
  • Comments
  • Latest
Kyrgyzstan Under the Khanstitution: 5 Years On

Kyrgyzstan Under the Khanstitution: 5 Years On

January 12, 2026
The 10 Most Beautiful Women in History According to AI

The 10 Most Beautiful Women in History According to AI

October 16, 2025
Injection π23 Tabula Rasa Brings Classic Survival Horror to Xbox Series X|S – Xbox Wire

Injection π23 Tabula Rasa Brings Classic Survival Horror to Xbox Series X|S – Xbox Wire

December 29, 2025
Tourism sector creates nearly 1 million direct jobs in South Africa

Tourism sector creates nearly 1 million direct jobs in South Africa

April 5, 2026
Ashton Kutcher Talks About Demi Moore Years After Divorce Left Her Heartbroken – Perez Hilton

Ashton Kutcher Talks About Demi Moore Years After Divorce Left Her Heartbroken – Perez Hilton

January 16, 2026
Commercialisation ≠ sales: Understanding the difference early matters more than it seems | e27

Commercialisation ≠ sales: Understanding the difference early matters more than it seems | e27

January 26, 2026
New photos show stranded cruise ship passengers passing time as health workers watch for hantavirus symptoms

New photos show stranded cruise ship passengers passing time as health workers watch for hantavirus symptoms

May 8, 2026
Austrian Darts Open: Mensur Suljovic into second round as Michael Smith and Raymond van Barneveld suffer early exits

Austrian Darts Open: Mensur Suljovic into second round as Michael Smith and Raymond van Barneveld suffer early exits

May 8, 2026
A father’s sacrifice: Saving his son, losing his life and the heartbreaking choice left behind

A father’s sacrifice: Saving his son, losing his life and the heartbreaking choice left behind

May 8, 2026
Alabama takes step toward a new congressional map while awaiting court action

Alabama takes step toward a new congressional map while awaiting court action

May 8, 2026
UK drivers could be denied car finance compensation as firms lodge legal battle

UK drivers could be denied car finance compensation as firms lodge legal battle

May 8, 2026
UFO files spanning decades are released by Defense Department

UFO files spanning decades are released by Defense Department

May 8, 2026
World News Prime

Discover the latest world news, insightful analysis, and comprehensive coverage at World News Prime. Stay updated on global events, business, technology, sports, and culture with trusted reporting you can rely on.

CATEGORIES

  • Breaking News
  • Business
  • Entertainment
  • Gaming
  • Health
  • Lifestyle
  • Politics
  • Sports
  • Technology
  • Travel

LATEST UPDATES

  • New photos show stranded cruise ship passengers passing time as health workers watch for hantavirus symptoms
  • Austrian Darts Open: Mensur Suljovic into second round as Michael Smith and Raymond van Barneveld suffer early exits
  • A father’s sacrifice: Saving his son, losing his life and the heartbreaking choice left behind
  • About Us
  • Advertise With Us
  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Policy
  • Terms and Conditions
  • Contact Us

© 2025 World News Prime.
World News Prime is not responsible for the content of external sites.

No Result
View All Result
  • Home
  • Breaking News
  • Business
  • Politics
  • Health
  • Sports
  • Entertainment
  • Technology
  • Gaming
  • Travel
  • Lifestyle

© 2025 World News Prime.
World News Prime is not responsible for the content of external sites.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In