• Stars
    star
    528
  • Rank 83,941 (Top 2 %)
  • Language
    Shell
  • Created over 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Networking lab using root-less VM

Various network related labs

I use those labs to test various stuff. Most of them are tailored to my need. The most recent ones are more likely to work than the older ones.

They are expected to run without being root on top of an up-to-date Debian sid. Some of them are using User-Mode-Linux, some other are using KVM.

lab-generic should always contain the latest iteration of the lab and be used as a base for other labs.

For labs exposing some serial console, you can use socat to connect:

socat $(tty),raw,echo=0 UNIX-CONNECT:/tmp/tmp.N3BTQ07qSG/vm-IOS1-serial2.pipe

Previously, labs were self-contained. This was done to avoid any breakage when introducing "new features". However, this didn't work as expected and labs become broken because of external changes (kernel changes, systemd changes, etc.). Therefore, new labs are now sourcing some common files (in common/). This means that older labs may broke due to more recent changes. In this case, get the latest commit for a lab (git log --oneline -1 lab-generic for example) and get a checkout for it (git checkout 22f22864632a).

This lab doesn't work on Ubuntu because they are missing VDE support in QEMU. The easiest way is to use schroot to work on a Debian Buster:

#!/bin/sh
sudo debootstrap buster buster
cat <<EOF | sudo tee /etc/schroot/chroot.d/lab
[lab]
type=directory
description=Network lab
directory=$PWD/buster
users=$USER
shell=$SHELL
profile=default
EOF
sudo schroot -c lab apt install \
    qemu-system-x86 sudo tmux busybox ssh vde2 python3 binutils \
    dosfstools mtools ansible jq linux-image-amd64 nginx

You may need to uncomment /dev/shm line in /etc/schroot/default/fstab. You also have to add yourself to kvm group (sudo adduser $USER kvm). Then, run:

schroot -c lab ./setup /boot/$(schroot -c lab ls /boot | grep vmlinuz | head -1)

The ./setup script takes a Linux kernel as first argument. Have a look at eudyptula-boot's minimal-configuration script to compile a kernel that should work with the lab as well.

License

All the labs are distributed under the ISC license:

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Other tools

There exist many other tools to run network labs that may not be as hacky as this one:

  • CORE. It uses Linux network namespaces and provides a GUI tool. This is a very good tool. Please, have a look at it. It doesn't use disk images and the whole lab configuration fits into a single file that's easy to share. Integration with Quagga or BIRD is very good.

  • GNS3. It uses virtual machines and emulators to build the network. It also comes with a GUI tool. You can emulate Cisco, Juniper, Arista and other brands network equipments. However, it relies heavily on disk images for anything else than Cisco devices and it makes it harder to share your work on GitHub.

You will find a more comprehensive list (with tests) on Brian Linkletter's blog.

More Repositories

1

dashkiosk

Managing dashboards on various displays (especially those running on Android)
JavaScript
354
star
2

hellogopher

Makefile to build a Go project
Makefile
301
star
3

rfc5077

Various tools for testing RFC 5077
C
241
star
4

nodecastor

Experiment to implement a sender API for Chromecast in Node.js
JavaScript
180
star
5

snimpy

interactive SNMP tool with Python
Python
180
star
6

video2hls

Prepare a video to be streamed with HLS
Python
171
star
7

awesome-configuration

My ~/.config/awesome directory
Lua
127
star
8

eudyptula-boot

Boot a Linux kernel in a VM without a dedicated root filesystem.
Shell
112
star
9

pragmatic-debian-packages

Pragmatic Debian packaging
Makefile
98
star
10

serverspec-example

Advanced use example of serverspec
JavaScript
98
star
11

jchroot

a chroot with more isolation
C
96
star
12

wiremaps

layer 2 network discovery application
Python
89
star
13

zshrc

My .zshrc
Shell
84
star
14

bootstrap.c

Boilerplate for small C projects (autotools)
C
74
star
15

i3wm-configuration

Python
72
star
16

vincent.bernat.ch

My own website
HTML
71
star
17

extend-netsnmp

Various examples on how to extend NetSNMP agent
C
46
star
18

ssl-dos

Various tools related to SSL denial of service
C
46
star
19

python-script

Sample self-contained Python script
Python
36
star
20

systemtap-cookbook

Some tools using systemtap
Python
29
star
21

vbeterm

Custom terminal based on VTE
C
21
star
22

xssproxy

Forward freedesktop.org Idle Inhibition Service calls to Xss
C
20
star
23

ip_vs_mh

Backport of ip_vs_mh for Linux (consistent hashing with Google's Maglev algorithm)
C
17
star
24

lanco

task launcher which does not want to be an init program
C
16
star
25

bootstrap.c-web

Boilerplate for small C projects (autotools) exporting a REST+SSE+WS API
C
14
star
26

puppet-workstation

Puppet setup to install my own workstation
Puppet
14
star
27

udpproxy

a Netfilter powered UDP proxy
C
13
star
28

cve-2015-3456

Experiments related to CVE-2015-3456
C
12
star
29

puppet-eizo

Puppet repository for "eizo"
Shell
12
star
30

ethtool-snmpd

Export ethtool stuff through SNMP
C
12
star
31

dot.emacs

My Emacs (and Gnus) configuration files
Emacs Lisp
12
star
32

fvwm-configuration

My configuration for fvwm
Shell
11
star
33

dashkiosk-android

Android application for Dashkiosk
Java
9
star
34

ansible-custom-module-examples

See https://vincent.bernat.ch/en/blog/2020-custom-ansible-module
Python
9
star
35

haproxy-debian-repository-wizard

Web application to select the appropriate Debian repository for HAProxy
HTML
9
star
36

junos-mode

Emacs major mode for JunOS configuration file
Emacs Lisp
9
star
37

ripe-atlas-lowest-latency

RIPE Atlas tool to determine the endpoint with the lowest latency
Python
8
star
38

ip_vs_csh

Consistent source hashing scheduler for Linux IPVS
C
8
star
39

ro-ro-tcp

performance enhancing proxy for TCP over links with high latency and moderate error rates
C
8
star
40

vpnoo

an IPSEc + XAuth client for Mac OS X
C
8
star
41

asn2org

AS numbers to organization names
Python
7
star
42

nixops-take1

Playground for NixOps
Nix
7
star
43

quagga

Quagga is free software that manages various IPv4 and IPv6 routing protocols.
C
5
star
44

flappy-bird-reborn-multiplayer

A "Flappy Bird" clone with multiplayer ability.
JavaScript
4
star
45

old-turbo-pascal-programs

Old programs that I wrote when I was a kid.
Pascal
4
star
46

cdktf-take1

Musing around CDKTF
TypeScript
3
star
47

splitpkcs12

PKCS#12 certificate splitter
C
3
star
48

net-snmp

Net-SNMP (not official)
C
3
star
49

ipoo

gather information about IP and hostnames
Python
3
star
50

dosbox

DOSBox, an x86 emulator with DOS. ⚠️ Not official. Not a complete mirror. Not updated.
C++
3
star
51

last-resort-gateway

Manage a last resort gateway
Go
2
star
52

pulumi-vultr

Pulumi provider for Vultr (based on the Terraform one), not official
Python
2
star
53

pygments-junos

JunOS lexer for pygments
Python
2
star
54

pygments-ios

IOS lexer for pygments
Python
2
star
55

homemanager-configuration

home-manager configuration for use with Debian Sid
Nix
2
star
56

www.une-oasis-une-ecole.fr

Source code for http://www.une-oasis-une-ecole.fr
HTML
2
star
57

Kitero

Interface and QoS switcher for router
Python
2
star
58

pulumi-gandi-old

Pulumi provider for Gandi, based on Terraform, not official
Python
1
star
59

pygments-haproxy

HAProxy lexer for Pygments
Python
1
star
60

QCss-3

load-balancer web service
Python
1
star