vnetbuild(1)

πŸ“¦
version 3.1.8 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– vnetbuild β€” an easy to use but powerful namespace setup tool πŸ’–

okay bestie, sit DOWN, because vnetbuild is about to become your new hyperfixation. it's a lil tool from the VNetBuild fam (manual vnetbuild(1), version 3.1.8) that builds whole networks out of namespaces and it is so good. no VMs, no real machines, just vibes and netns. πŸ¦‹


✨ SYNOPSIS ✨

sudo vnetbuild CONFIGFILE { start | stop | status }

vnetbuild CONFIGFILE graphviz OUTFILE.{gv|png|pdf|ps}

🌸 DESCRIPTION 🌸

so like. VNetBuild is a program that helps you set up groups of interconnected network namespaces, so you can simulate networks of literally any complexity without resorting to using real or virtual machines. no cap. 🫢

it's ideal for testing complex multi-host configurations with a minimal amount of resources, all on a single machine:

  • each namespace can have its own network setup, including firewall and QOS configuration. πŸ’…
  • commands can be run in the namespace and will have that specific view of the network, including running standard network tools and daemons. πŸ‘‘

and if you run it with no arguments at all, vnetbuild will present some help on usage. she's helpful like that.


πŸŽ€ COMMANDS πŸŽ€

  • start β€” sets up a series of network namespaces as defined in CONFIGFILE. vnetbuild creates interconnected network devices as specified in the configuration, sets up routing, and runs any custom commands that are given within the namespace. the whole glow-up, in one command. ✨
  • stop β€” removes any devices from the namespaces defined in CONFIGFILE, and kills any processes running with the namespaces, then removes the namespaces themselves. it's giving "we don't talk anymore". πŸ’€
  • status β€” for each namespace defined in CONFIGFILE, shows if it is active, and if so, its network devices and their configuration. the vibe check command. πŸ”₯
  • graphviz OUTFILE β€” generates a graph of the network defined in CONFIGFILE. and here's the bestie perk: this does not need root access, nor does it require the namespaces to have been started. you can just look at the pretty picture. 🌈

OUTFILE can be png, pdf or ps. if the extension gv is given, the output is a graphviz(7) file which you can process separately. iykyk.


πŸ¦‹ RUNNING COMMANDS IN A NAMESPACE πŸ¦‹

once you have created a set of network namespaces, you can easily run any commands you want within them. like, any commands. main character energy for your netns. πŸ‘‘

say for instance you defined three hosts β€” host_a with IP 10.0.0.1, host_b with IP 10.0.0.2 and host_c with IP 10.0.0.3 β€” connected via a common switch sw0. here's the group chat receipts:

# ping host_b and host_c from host_a
sudo ip netns exec host_a ping 10.0.0.2
sudo ip netns exec host_a ping 10.0.0.3

# use netcat to listen on host_a and send data from host_b
# (use two terminals to run the commands simultaneously)
sudo ip netns exec host_a nc -l -p 23
sudo ip netns exec host_b nc -q 0 10.0.0.1 23 < /etc/hosts

# capture traffic passing through the switch, then view it
sudo ip netns exec sw0 tcpdump -i switch -w capfile
wireshark capfile

# Use 'firehol panic' in host_b to block all traffic
# (you could equally load a full config etc.)
sudo ip netns exec host_b firehol panic

# this is now blocked
sudo ip netns exec host_a ping 10.0.0.2

# not blocked (host_b not involved)
sudo ip netns exec host_a ping 10.0.0.3

# obtain a shell for your regular user, only "in" host_c
sudo ip netns exec host_c sudo -i -u $USER
ip a | grep 10.0.0.3

the way that sudo ip netns exec just teleports you into a whole other network?? iconic. periodt. πŸ’…


🌟 SEE ALSO 🌟

  • vnetbuild.conf(5) β€” VNetBuild configuration file
  • firehol(1) β€” FireHOL program
  • fireqos(1) β€” FireQOS program
  • FireHOL Website
  • VNetBuild Online PDF Manual
  • VNetBuild Online Documentation

go read them, bestie, they're all bangers. πŸ“šβœ¨


πŸ’œ AUTHORS πŸ’œ

FireHOL Team. absolute legends, fr fr. πŸ™Œ


and that's the whole page, gorgeous. this was the VNetBuild Reference, built 13 Apr 2025, documenting vnetbuild(1) at version 3.1.8. now go build some namespaces and slay. πŸ’–πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from