Visualize iptables packet flow as Graphviz diagrams.
389
Visualize iptables packet flow as Graphviz diagrams. Convert iptables-save output to DOT, SVG, or PNG formats.
Inspired by AChingYo/iptables-graph
No installation required! Just pull and run:
# Pull from Docker Hub
docker pull sanghaklee/iptables-graph
# Use it
sudo iptables-save | docker run --rm -i sanghaklee/iptables-graph
# Generate SVG
sudo iptables-save | docker run --rm -i sanghaklee/iptables-graph -f svg > graph.svg
# Generate PNG
sudo iptables-save | docker run --rm -i sanghaklee/iptables-graph -f png > example.png
Create an alias for convenience:
# Add to ~/.bashrc or ~/.zshrc
alias iptables-graph='docker run --rm -i sanghaklee/iptables-graph'
# Now use it like a regular command
sudo iptables-save | iptables-graph
sudo iptables-save | iptables-graph -f svg > graph.svg
# For file input/output with Docker
docker run --rm sanghaklee/iptables-graph \
-v $(pwd):/data
-i /data/iptables-save.txt
-f svg
-o /data/diagram.svg
usage: iptables-graph [-h] [-i INPUT] [-o OUTPUT] [-f {dot,svg,png}]
iptables-save output → Graphviz converter (dot/svg/png)
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Input file (default: stdin)
-o OUTPUT, --output OUTPUT
Output file (default: stdout)
-f {dot,svg,png}, --format {dot,svg,png}
Output format: dot (default), svg, or png
Content type
Image
Digest
sha256:77537b3c7…
Size
88.9 MB
Last updated
11 months ago
docker pull sanghaklee/iptables-graph