Customize netlab

netlab is designed to be highly extensible and customizable. Starting with the system settings, you can:

If you want to use netlab to deploy additional device configuration, you can:

You can also augment the netlab data model transformation or add new functionality with plugins.

If you want to change the provisioning or device configuration templates, you can:

  • Create your own device configuration templates: copy a system device configuration template into templates/module/device.j2 file[1] and modify it. You can have custom device configuration templates in the current directory or in the ~/.netlab directory.

  • Create your own device provisioning template: copy a system template into provider/device-domain.j2 file and modify it.

Tip

Use the ‌netlab create –debug paths command to display the components of individual search paths and the directories netlab uses when searching those paths (non-existent directories are removed from the search paths).

You can use the same command to troubleshoot template errors; the debugging printouts display every template file netlab searched for and the search path it used for the search.

Warning

The device provisioning templates can use only built-in Jinja2 filters and a subset of ‌ipaddr and ‌hwaddr filter functionality.

Finally, you might want to use external tools or devices not yet supported by netlab:

Regardless of how far you’re willing to go, we’d appreciate if you decided to contribute your changes, but it’s perfectly fine to keep them private. The best part: you don’t have to modify the netlab package to get the job done; you could use user defaults to define new stuff, and user-defined configuration templates (see above) to configure it.