-
Notifications
You must be signed in to change notification settings - Fork 1
Module System
sat edited this page Jan 3, 2026
·
3 revisions
This page explains how to use modules in dot2net.
Modules extend dot2net with platform-specific functionality. Loading a module adds:
- File definitions - Platform-specific output files (e.g., topo.yaml, spec.yaml)
- FormatStyles - Pre-defined formatting rules for specific config formats
- Internal classes - Network/node/interface classes for platform integration
- Requirements - Expected config blocks or parameters from user configuration
Modules are loaded via the module section in YAML configuration:
module:
- containerlab
- frrEach module defines its output files. For example:
| Module | File | Description |
|---|---|---|
| containerlab | topo.yaml | Containerlab topology file |
| tinet | spec.yaml | TiNET specification file |
These files are generated automatically based on the network model.
Modules may provide FormatStyles for specific configuration formats:
# FRR module provides these FormatStyles
interfaceclass:
- name: ospf
config:
- name: ospf_config
format: frrVtysh # Provided by frr module
template:
- "router ospf"
- " network {{ .ip_network }} area 0"| Module | FormatStyles |
|---|---|
| frr |
frrVtysh, frrDaemons, frrVtyshConf
|
| containerlab | clabCmd |
| tinet | tinetSpecCmd |
Modules may require specific config blocks or parameters:
| Module | Required Parameters | Required Config Blocks |
|---|---|---|
| containerlab |
image, kind
|
startup (optional) |
| tinet | image |
startup (optional) |
| frr | - | - |
If requirements are not met, dot2net reports an error.
Multiple modules can be loaded together. Each module's files are generated simultaneously:
module:
- containerlab # Generates topo.yaml
- frr # Provides FormatStyles for FRR configThis generates:
-
topo.yaml- Containerlab topology with node definitions -
r1/frr.conf,r2/frr.conf- FRR configuration files (user-defined)
module:
- containerlab
- frr
file:
- name: frr.conf
path: /etc/frr/frr.conf
nodeclass:
- name: router
values:
image: quay.io/frrouting/frr:8.5.0
kind: linux
config:
- file: frr.conf
format: frrVtysh # From frr module
template:
- "hostname {{ .name }}"
- "!"
- name: startup
template:
- "vtysh -b"Result:
output/
├── topo.yaml # From containerlab module
├── r1/
│ └── frr.conf # User-defined, formatted with frrVtysh
└── r2/
└── frr.conf
| Module | Purpose | Documentation |
|---|---|---|
| containerlab | Containerlab topology generation | Module: Containerlab |
| tinet | TiNET specification generation | Module: TiNET |
| frr | FRR configuration FormatStyles | Module: FRR |
- YAML Configuration - Module Configuration
- FormatStyle Design - How FormatStyles work
- File Output - File generation control