Sign inSign up

italovalcy/mininet-dind

By italovalcy

•Updated 4 months ago

Forked version of mininet with Docker node support

Image
Networking
Security
0

310

italovalcy/mininet-dind repository overview

Please be advised that this is a fork version from original Mininet. This version includes integration with Docker to allow having Docker Nodes inside Mininet. You can also run Mininet as Docker, and then you can have a Docker-in-Docker scenario.

More information: https://github.com/italovalcy/mininet⁠

Exemple running in interactive mode:

docker run --privileged -it --rm \
  -v $(pwd)/docker:/var/lib/docker \
  -v /lib/modules:/lib/modules \
  italovalcy/mininet-dind:latest /bin/bash

Then once the container starts, you can run your mininet scenario with docker nodes, for instance this Linear,3 topology below where hosts are docker nodes:

# mn --topo=linear,3 --host=docker,image=alpine:latest,volume=/tmp/xpto:/tmp/xpto,volume=/tmp/foobar:/tmp/foobar,env=DATA=FoobarXpto,env=DATA2="algo diferente"
*** Error setting resource limits. Mininet's performance may be affected.
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3
*** Adding switches:
s1 s2 s3
*** Adding links:
(h1, s1) (h2, s2) (h3, s3) (s2, s1) (s3, s2)
*** Configuring hosts
h1 h2 h3
*** Starting controller

*** Starting 3 switches
s1 s2 s3 ...
*** Starting CLI:
mininet> h1 ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0@if23: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 7e:0c:6f:81:71:8b brd ff:ff:ff:ff:ff:ff
27: h1-eth0@if26: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether aa:cd:c8:ee:bb:27 brd ff:ff:ff:ff:ff:ff
mininet> h2 env
HOSTNAME=h2
DATA=FoobarXpto
SHLVL=1
HOME=/root
DATA2=algo diferente
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/

Tag summary

Content type

Image

Digest

sha256:2bde4f55d…

Size

310.5 MB

Last updated

4 months ago

docker pull italovalcy/mininet-dind