golangci-lint CodeQL

iftree

CLI, easy way to illustrate local network interface.

The intent is for understanding container networks πŸ˜€

networ-devices

features

  • visualize Veth/bridge connections
  • support graphviz
  • rich text
  • ascii graph
  • support more networking device

usage

graph

Create an ouput image with graphviz compatible renderer. e.g: online editor: https://dreampuf.github.io/GraphvizOnline

# sudo go run cmd/iftree/main.go --graph 

generate image using dot(http://www.graphviz.org/download/)

# sudo go run cmd/iftree/main.go --graph | dot -Tpng  > output.png

text

# sudo go run main.go

----------------------------------------------------
BRIDGE: br0    up
netnsName      veth    peerInNetns    netnsID
└────/var/run/netns/netns0
     β”œβ”€β”€β”€β”€veth0    ceth0    4

----------------------------------------------------
BRIDGE: docker0    up
netnsName          veth    peerInNetns    netnsID
└────/var/run/docker/netns/883628ab52b7
     β”œβ”€β”€β”€β”€veth4f13cd2    eth0    5

----------------------------------------------------
BRIDGE: cni_bridge0    up
netnsName              veth    peerInNetns    netnsID
└────/var/run/netns/123456
     β”œβ”€β”€β”€β”€veth57e09f05    eth13    0
└────/var/run/docker/netns/0de88faa84ac
     β”œβ”€β”€β”€β”€veth31bc095b    eth0    1
     β”œβ”€β”€β”€β”€veth12d98148    eth1    1

----------------------------------------------------
BRIDGE: cni_br    up
netnsName         veth    peerInNetns    netnsID
└────/var/run/netns/321
     β”œβ”€β”€β”€β”€veth6328d76d    eth1    3
└────/var/run/netns/123
     β”œβ”€β”€β”€β”€veth5e41415a    eth1    2
     β”œβ”€β”€β”€β”€veth90c9f5fa    eth2    2
     β”œβ”€β”€β”€β”€veth385ac3bb    eth3    2

----------------------------------------------------
unused veth pairs
VETH        PEER        NETNSID
veth-tt1    veth-tt     -1
veth-tt     veth-tt1    -1

GitHub

View Github