<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/netlab-building-a-layer-2-fabric-ipspace-net-blog-3dnh1lwau" -->

---
title: netlab: Building a Layer-2 Fabric « ipSpace.net blog
description: A walkthrough on using netlab to build a pure layer-2 leaf-and-spine data center fabric. The key insight is that netlab defaults to layer-3 interfaces, so...
canonical: https://daily.dev/posts/netlab-building-a-layer-2-fabric-ipspace-net-blog-3dnh1lwau
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: netlab: Building a Layer-2 Fabric « ipSpace.net blog | daily.dev
og:description: A walkthrough on using netlab to build a pure layer-2 leaf-and-spine data center fabric. The key insight is that netlab defaults to layer-3 interfaces, so...
og:url: https://daily.dev/posts/netlab-building-a-layer-2-fabric-ipspace-net-blog-3dnh1lwau
og:image: https://api.daily.dev/og/posts/3DNH1lwau.png
og:image:alt: netlab: Building a Layer-2 Fabric « 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.

# netlab: Building a Layer-2 Fabric « ipSpace.net blog

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

## Summary

A walkthrough on using netlab to build a pure layer-2 leaf-and-spine data center fabric. The key insight is that netlab defaults to layer-3 interfaces, so building an L2-only fabric requires using the VLAN module, creating a VLAN with mode set to 'bridge', and assigning access VLANs on all links. The post includes a complete topology file, the resulting Arista cEOS configuration, and instructions for running the lab with containerlab.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.ipspace.net/2023/01/netlab-l2-fabric>

## Questions this post answers

### How do I configure all ports as layer-2 only (no IP addresses) in a netlab topology?

To build a pure layer-2 fabric in netlab, you must use the VLAN module rather than just disabling IP addresses on address pools. Enable the VLAN module, create a VLAN with mode set to 'bridge' (otherwise VLAN interfaces get IP addresses), and assign vlan.access on every link. Simply setting ipv4: False on address pools won't work because netlab defaults to layer-3 interfaces and configures the equivalent of 'no switchport' on data center switches.

_Network engineers building L2 fabric labs with netlab track topology patterns and gotchas like this on daily.dev._

### Why does netlab assign IP addresses to VLAN interfaces even when I set ipv4 to False on address pools?

Setting ipv4: False on address pools removes IP addresses from point-to-point and LAN links, but netlab still configures layer-3 interfaces by default (equivalent to 'no switchport' on data center switches). To prevent IP addresses on VLAN interfaces, the VLAN must have its mode explicitly set to 'bridge'. Without that, netlab assigns IP addresses to all VLAN interfaces regardless of address pool settings.

_Developers working through netlab VLAN quirks find edge cases like this documented alongside community discussion on daily.dev._

## Similar posts on daily.dev

- [EVPN with SR-MPLS Core « ipSpace.net blog](https://daily.dev/posts/evpn-with-sr-mpls-core-ipspace-net-blog-taobtibzc) · ipSpace.net Blog · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/netlab-building-a-layer-2-fabric-ipspace-net-blog-3dnh1lwau)

```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":"netlab: Building a Layer-2 Fabric « ipSpace.net blog","url":"https://daily.dev/posts/netlab-building-a-layer-2-fabric-ipspace-net-blog-3dnh1lwau","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/netlab-building-a-layer-2-fabric-ipspace-net-blog-3dnh1lwau"},"datePublished":"2026-08-11T08:53:28.290Z","dateModified":"2026-08-11T09:09:31.063Z","description":"A walkthrough on using netlab to build a pure layer-2 leaf-and-spine data center fabric. The key insight is that netlab defaults to layer-3 interfaces, so...","image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","thumbnailUrl":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","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/netlab-building-a-layer-2-fabric-ipspace-net-blog-3dnh1lwau","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"networking","timeRequired":"PT4M"}
{"@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":"netlab: Building a Layer-2 Fabric « ipSpace.net blog"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/netlab-building-a-layer-2-fabric-ipspace-net-blog-3dnh1lwau#faq","mainEntity":[{"@type":"Question","name":"How do I configure all ports as layer-2 only (no IP addresses) in a netlab topology?","acceptedAnswer":{"@type":"Answer","text":"To build a pure layer-2 fabric in netlab, you must use the VLAN module rather than just disabling IP addresses on address pools. Enable the VLAN module, create a VLAN with mode set to 'bridge' (otherwise VLAN interfaces get IP addresses), and assign vlan.access on every link. Simply setting ipv4: False on address pools won't work because netlab defaults to layer-3 interfaces and configures the equivalent of 'no switchport' on data center switches. Network engineers building L2 fabric labs with netlab track topology patterns and gotchas like this on daily.dev."}},{"@type":"Question","name":"Why does netlab assign IP addresses to VLAN interfaces even when I set ipv4 to False on address pools?","acceptedAnswer":{"@type":"Answer","text":"Setting ipv4: False on address pools removes IP addresses from point-to-point and LAN links, but netlab still configures layer-3 interfaces by default (equivalent to 'no switchport' on data center switches). To prevent IP addresses on VLAN interfaces, the VLAN must have its mode explicitly set to 'bridge'. Without that, netlab assigns IP addresses to all VLAN interfaces regardless of address pool settings. Developers working through netlab VLAN quirks find edge cases like this documented alongside community discussion on daily.dev."}}]}
```

