Containerlab topology endpoint links don't match Netbox data
Hello,
I have a device in Netbox that looks like this:
When I render the ContainerLab topology, I get this:
The script looks like its aware of these interfaces
However, it seems like the default.j2 interface_name template is just incrementing the interface name based on an index in a list, which doesn't seem like its actually using the data its getting from netbox to generate this section. Is there something I'm doing incorrectly here? Thanks in advance!
In the default.j2 interface_names template, replacing {{ index+1 }} with {{ interface }} seems to fix this. Looking more at the codebase, this is probably by design. Perhaps creating and referencing a non-default template specifically for ceos with that variable could be a possible solution.
created ceos.j2
Produces the following:
Thank you for maintaining this project, this is incredibly useful in NetDevOps pipelines when using Netbox and ContainerLab
Hi @amlicht89 , sorry for the delayed response. Currently, nrx relies on ceos interface mapping feature described here: https://containerlab.dev/manual/kinds/ceos/#user-defined-interface-mapping, instead of using the real interface names from netbox. There is an alternative method of naming interfaces that was not available before, this one: https://containerlab.dev/manual/kinds/ceos/#additional-interface-naming-considerations, but it is a bit more complicated due to special handling of / separator. Could you check if mapping would work for you? In general, it works out of the box