Skip to content

Add network-xray external tool - #3953

Merged
ipspace merged 2 commits into
ipspace:devfrom
rclab-dev:network-xray-tool
Oct 22, 2026
Merged

ipspace merged 2 commits into
ipspace:devfrom
rclab-dev:network-xray-tool

Conversation

@rclab-dev

Copy link
Copy Markdown
Contributor

As discussed by e-mail, this adds network-xray as an opt-in Docker tool for containerlab labs, with documentation and an entry in the external-tools list.

It displays the lab topology and reads routing state from FRR and SR Linux containers. Other devices can appear in the topology without router-state details. This integration uses clab.yml and the default container naming convention.

Enable it with:

tools:
  network-xray:

netlab up starts the tool and prints its URL (netlab connect network-xray prints it again). The web port is 8600, or 8600 plus the multilab instance ID. netlab down removes the container.

Changes:

  • netsim/tools/network-xray.yml -- tool definition (ghcr.io/rclab-dev/network-xray:1)
  • docs/extool/network-xray.md -- tool description
  • docs/extools.md -- added to the list of external tools

The documentation explains the Docker socket's host-level privileges and the unauthenticated web interface. This definition does not export validation data or integrate netlab validate results; I plan to use the JSON output of netlab validate for that once it is available.

Because the tool name contains a dash, it cannot be enabled with a NETLAB_TOOLS_..._ENABLED environment variable; use the lab topology or ~/.netlab.yml (tools.network-xray.enabled: True). I am happy to rename it if you prefer a different name.

Tested with this branch (clab provider) and ghcr.io/rclab-dev/network-xray:1 (v1.0.5) using FRR and SR Linux labs: netlab up starts the container and prints the URL, the page shows the lab including the BGP state of the SR Linux node, and netlab down removes the container.

network-xray (https://github.com/rclab-dev/network-xray) displays a
containerlab topology and routing state collected from FRR and SR Linux
routers. Adds the tool definition, the tool description, and an entry in
the list of external tools.

@ipspace ipspace left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignoring the "true name of clab.yml" issue for the moment, please rename the tool to "network_xray". If you use dashes in the tool name, it cannot be enabled with an environment variable (see https://ipspace.github.io/netlab/extools.html#enabling-tools-in-user-defaults)

Comment thread docs/extool/network-xray.md Outdated
(extool-network-xray)=
# network-xray

[network-xray](https://github.com/rclab-dev/network-xray) displays a containerlab topology and routing state collected from FRR and Nokia SR Linux routers.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reword this as "displays a lab topology" ... "from FRRouting and Nokia SR Linux containers" to emphasize it's containers only.

Comment thread docs/extool/network-xray.md Outdated

```
tools:
network-xray:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tool needs to be renamed to "network_xray", or we can't enable it with an environment variable (which cannot contain a dash). Applies to numerous references in documentation.

Comment thread docs/extool/network-xray.md Outdated

**Notes:**

* network-xray requires the *clab* provider: it reads the lab name from the generated `clab.yml` file and expects the default `clab-<lab>-<node>` container names (a custom `prefix` is not supported).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reword "requires... " as "works only with containerlab-only topologies". Then we also get away from the clab.yml versus clab-augment.yml problem.

A tool name containing a dash cannot be enabled with an environment
variable. Rename the tool definition and its documentation page, and
update the references in the documentation.

Reword the tool description to emphasize that network-xray works with
FRRouting and Nokia SR Linux containers only, and that it works only with
containerlab-only topologies.
@rclab-dev

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've pushed a commit that addresses all three points:

  • Renamed the tool to network_xray (netsim/tools/network_xray.yml, docs/extool/network_xray.md) and updated the references in the documentation. The container image keeps its name (ghcr.io/rclab-dev/network-xray:1).
  • Reworded the description: "displays a lab topology and routing state collected from FRRouting and Nokia SR Linux containers".
  • Replaced the "requires..." note with "works only with containerlab-only topologies".

I tested the renamed tool with netlab up, netlab connect network_xray and netlab down on bgplab basic/1-session, enabling it both in the topology (tools: network_xray:) and with NETLAB_TOOLS_NETWORK__XRAY_ENABLED=True (double underscore).

One related question: the bgplab defaults.yml (bgplab#82) still defines the tool as network-xray. Shall I send a small PR to rename it to network_xray as well, so that both use the same name?

@ipspace

ipspace commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Thanks for the review! I've pushed a commit that addresses all three points:

Thank you!

One related question: the bgplab defaults.yml (bgplab#82) still defines the tool as network-xray. Shall I send a small PR to rename it to network_xray as well, so that both use the same name?

No worries, I'll fix that as I also have to add a bit of documentation to explain how to start external tools.

@ipspace ipspace left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ipspace
ipspace merged commit 7cd5b14 into ipspace:dev Oct 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants