The lab topology is described in a YAML file using a dictionary format. You could use hierarchical attribute names as dictionary keys to make the topology file more readable.
The three major components that should be present in every topology file are:
- nodes -- lab devices (nodes)
- links -- links between the lab devices
- defaults -- topology-wide defaults like default device type
(topology-reference-top-elements)= Other topology elements include:
- addressing -- IPv4 and IPv6 pools used to address management, loopback, LAN, P2P and stub interfaces
- components -- reusable components that you can include in multiple places in the lab topology
- groups -- optional groups of nodes
- module -- default list of modules used by this network topology. You can use device-level module attribute to override this setting for individual nodes.
- plugin -- list of plugins used by this topology.
- prefix -- named IP prefixes that can be used to address links and VLANs or in prefix lists or validation expressions.
- tools -- dictionary of external network management tools deployed after the lab has been started and configured.
- validate -- lab validation tests
(topology-reference-extra-elements)= Finally, you can set these topology-level parameters:
- provider -- virtualization provider (default: libvirt)
- message -- a help message to display after successful netlab initial or netlab up commands. You can use that message to tell the end-user how to use the lab (example: VLAN integration test cases).
- name -- topology name (used in bridge names)
- version -- minimum netlab version required to use this lab topology1. You can use either a simple version number or Python module version specification (example:
>= 1.6.3
). See for more details.
Notes:
- All elements apart from nodes are optional -- missing links element indicates a topology without inter-node links (just the management interfaces)
- Default values of defaults and addressing elements are taken from default settings.
- List of modules is used to specify additional initial configuration elements (example: OSPF routing)
- Default topology name is the directory name2.
You'll find sample topology files in the tutorials.
.. toctree::
:caption: Topology Components
:maxdepth: 2
nodes.md
links.md
groups.md
addressing.md
modules.md
custom-config-templates.md
extools.md
plugins.md
prefix.md
providers.md
components.md
defaults.md
topology/hierarchy.md
topology/validate.md
customize.md
Footnotes
-
This functionality was implemented in release 1.6.3. Older netlab releases will report an invalid top-level parameter, ancient releases might just ignore the version top-level parameter. ↩
-
The first twelve characters of the directory name are used. Spaces and dots within the directory name are replaced with underscores. ↩