# Changing the Layout of netlab Topology Graphs

DevFeed: [Changing the Layout of netlab Topology Graphs](<https://devfeed.tech/articles/changing-the-layout-of-netlab-topology-graphs-11247.md>)

Original publisher: [Read original article](<https://blog.ipspace.net/2025/09/netlab-graphs-layout/>)

Published: 2025-09-30T05:26:00Z

Content type: tutorial

Language: en

Sources: [ipSpace.net blog](<https://devfeed.tech/sources/ipspace-net-blog.md>)

Topics: [Graphs](<https://devfeed.tech/topics/graphs.md>), [BGP](<https://devfeed.tech/topics/bgp.md>), [Network](<https://devfeed.tech/topics/network.md>)

Tags: [bgp](<https://devfeed.tech/tags/bgp.md>), [graphs](<https://devfeed.tech/tags/graphs.md>), [netlab](<https://devfeed.tech/tags/netlab.md>), [network](<https://devfeed.tech/tags/network.md>)

## AI overview

This tutorial explains how GraphViz and D2 place netlab topology graph elements and why their automatic layouts may not reflect the intended network hierarchy. It shows how changing node ordering in topology and link definitions can improve the diagram, while noting the limitations of automatic placement.

## Source excerpt

After I published the updated netlab topology graphs article, Samuel K. Lam quickly made a comment along the lines of now we know how the graph representing the following topology was made, adding a nice ASCII art that illustrated the point I was trying to make much better than my graphs: ASCII art representing the BGP leak lab Let's see how close we can get to that ideal topology diagram with GraphViz and D2 graphs. Read more ...