<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/introducing-netlab-plugins-ipspace-net-blog-augokg4gz" -->

---
title: Introducing netlab Plugins « ipSpace.net blog | daily.dev
description: A walkthrough of building a netlab plugin to remove unwanted IBGP sessions in a BGP anycast lab. The plugin uses Python Box and netlab API modules, hooking...
canonical: https://daily.dev/posts/introducing-netlab-plugins-ipspace-net-blog-augokg4gz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Introducing netlab Plugins « ipSpace.net blog | daily.dev
og:description: A walkthrough of building a netlab plugin to remove unwanted IBGP sessions in a BGP anycast lab. The plugin uses Python Box and netlab API modules, hooking...
og:url: https://daily.dev/posts/introducing-netlab-plugins-ipspace-net-blog-augokg4gz
og:image: https://api.daily.dev/og/posts/AUgOkg4gz.png
og:image:alt: Introducing netlab Plugins « ipSpace.net blog
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introducing netlab Plugins « ipSpace.net blog

**[ipSpace.net Blog](https://daily.dev/sources/ipspace)** · 5 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of building a netlab plugin to remove unwanted IBGP sessions in a BGP anycast lab. The plugin uses Python Box and netlab API modules, hooking into the post_transform stage to filter out IBGP neighbors from anycast nodes. The post explains the plugin hook system, how to inspect netlab data structures using `netlab create -o yaml`, and how to safely traverse nested dictionaries with Python Box.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.ipspace.net/2022/01/netsim-plugins>

## Questions this post answers

### How do I write a netlab plugin to modify BGP neighbors after topology transformation?

A netlab plugin uses hook functions like `init` and `post_transform`, both receiving the full lab topology as a Python Box object. In `post_transform`, you iterate over `topo.nodes`, check for a custom attribute (e.g., `bgp.anycast`), then filter `node.bgp.neighbors` using a list comprehension — for example, keeping only entries where `n.type != 'ibgp'`. Import `Box` from the `box` package and `api` from `netsim`.

_Network engineers automating labs with netlab track plugin patterns and BGP tricks on daily.dev._

### How can I inspect the netlab data model to know what to modify in a plugin?

Run `netlab create -o yaml` to dump the fully transformed lab topology as YAML. This shows the complete data model after all transformations, including node BGP parameters, neighbor lists, and session types. You can also limit output to specific components. Once you understand the structure, you can target the exact keys to read or modify in your plugin hook.

_Developers building netlab plugins find real-world data model examples on daily.dev._

## Similar posts on daily.dev

- [Compress netlab Lab Topologies with Dot Notation « ipSpace.net blog](https://daily.dev/posts/compress-netlab-lab-topologies-with-dot-notation-ipspace-net-blog-johomwxka) · ipSpace.net Blog · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#networking](https://daily.dev/tags/networking), [#bgp](https://daily.dev/tags/bgp)

[View this post on daily.dev](https://daily.dev/posts/introducing-netlab-plugins-ipspace-net-blog-augokg4gz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Introducing netlab Plugins « ipSpace.net blog","url":"https://daily.dev/posts/introducing-netlab-plugins-ipspace-net-blog-augokg4gz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/introducing-netlab-plugins-ipspace-net-blog-augokg4gz"},"datePublished":"2026-08-11T08:54:09.887Z","dateModified":"2026-08-11T09:14:32.823Z","description":"A walkthrough of building a netlab plugin to remove unwanted IBGP sessions in a BGP anycast lab. The plugin uses Python Box and netlab API modules, hooking...","image":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","thumbnailUrl":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","isAccessibleForFree":true,"articleSection":"ipSpace.net Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ipSpace.net Blog","logo":"https://media.daily.dev/image/upload/s--xS7E82MT--/f_auto,q_auto/v1786438303/logos/ipspace?_a=BAMAMicg0","url":"https://daily.dev/sources/ipspace"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/introducing-netlab-plugins-ipspace-net-blog-augokg4gz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,networking,bgp","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ipSpace.net Blog","item":"https://daily.dev/sources/ipspace"},{"@type":"ListItem","position":3,"name":"Introducing netlab Plugins « ipSpace.net blog"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/introducing-netlab-plugins-ipspace-net-blog-augokg4gz#faq","mainEntity":[{"@type":"Question","name":"How do I write a netlab plugin to modify BGP neighbors after topology transformation?","acceptedAnswer":{"@type":"Answer","text":"A netlab plugin uses hook functions like `init` and `post_transform`, both receiving the full lab topology as a Python Box object. In `post_transform`, you iterate over `topo.nodes`, check for a custom attribute (e.g., `bgp.anycast`), then filter `node.bgp.neighbors` using a list comprehension — for example, keeping only entries where `n.type != 'ibgp'`. Import `Box` from the `box` package and `api` from `netsim`. Network engineers automating labs with netlab track plugin patterns and BGP tricks on daily.dev."}},{"@type":"Question","name":"How can I inspect the netlab data model to know what to modify in a plugin?","acceptedAnswer":{"@type":"Answer","text":"Run `netlab create -o yaml` to dump the fully transformed lab topology as YAML. This shows the complete data model after all transformations, including node BGP parameters, neighbor lists, and session types. You can also limit output to specific components. Once you understand the structure, you can target the exact keys to read or modify in your plugin hook. Developers building netlab plugins find real-world data model examples on daily.dev."}}]}
```

