Skip to content

Znerox/OpenWrt-ConfigVisualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OpenWrt-ConfigVisualizer

This script is a translation layer that takes standard OpenWrt config files and outputs text that can be passed to Kroki which will then generate an image or pdf, showing network interfaces, subnets and clients. It currently supports both Ethernet and WireGuard interfaces. (Kroki is using nwdiag to generate the image.)

Usage

Put NetworkDiagram.py in the same folder as these config files from your OpenWrt device

/etc/config/network
/etc/config/dhcp

Optionally also create a file named "hosts" in the same folder, and populate it in this format

hostname1 IP1
hostname2 IP2
hostname3 IP3

Run the python script

python NetworkDiagram.py

which will output something like tihs

nwdiag{Internet[shape=cloud];Internet -- OpenWrt;
  network LAN {
    address = "192.168.1.x/24";
    OpenWrt [address = "192.168.1.1"];
    PC [address = "192.168.1.10"];
    Server [address = "192.168.1.25"];
  }
  network WireGuard_network {
    address = "10.0.100.1";
    OpenWrt [address = "10.0.100.1"];
    Laptop [address = "10.0.100.2"];
    Phone [address = "10.0.100.3"];
  }
}

This output can be used by Kroki to generate your image. Either directly on kroki.io or by running Kroki locally, for example by using the official Docker image. The final result will be something like this: image

About

Create visual diagrams based on OpenWrt config files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages