A walkthrough of building a DMVPN test lab using netlab, contributed by Anne Baretta. The solution leverages netlab's tunnel interface support (added in release 1.5.2), custom node attributes for DMVPN parameters (NHRP and IPsec keys), and hierarchical group definitions to separate hub and spoke configurations. Jinja2 templates handle per-device tunnel configuration, iterating over tunnel interfaces and neighbors to set NHRP authentication, NHS addresses, and tunnel destinations. The full example is available on GitHub.
Questions this post answers
How do I define custom node attributes in netlab 1.5.0 and later?
Starting with netlab 1.5.0, custom node attributes must be declared under system defaults. For example, to add a dictionary attribute called 'dmvpn', add 'defaults.attributes.node.dmvpn: dict' to your topology file. You can optionally define the internal key structure for stricter validation instead of just specifying the type. Network engineers building netlab topologies track attribute changes like these on daily.dev.
How do I create tunnel interfaces in a netlab topology file?
Use 'type: tunnel' on a link definition in your topology's links section, then specify the members and a prefix. Netlab will create tunnel interfaces on each node with IP addressing and supported parameters like OSPF routing. Tunnel-specific parameters such as NHRP or IPsec settings must be applied via custom Jinja2 configuration templates. Teams automating network labs with netlab find relevant examples and release notes on daily.dev.