DPG provides an expandable networking sanbox in which the user can practice basic routing.
Packages can be routed from one client to another over a bridge.
The user is given the ability to connect to any container from inside a container via SSH.
Various monitoring tools are installed on each container.
- tshark
- iftop
- mtr
The goal of this project is to create a network environment via docker which
enables students to practice basic networking.
To achieve this the network should have the following traits:
- Scalability
- Static Ip Adresses
- User friendlyness
git clone https://github.com/MrWelsch/dpg
Use Homebrew Cask to download the app by running these commands:
brew update
brew install --cask docker
The Main Repository of debian provides the Docker package.
apt-get update
apt-get install docker
Docker is available via the community repository and can be iinstalled as instructed below:
sudo pacman -Syu
sudo pacman -S docker
The app can be installed via Chocolatey by using the Docker Package.
choco upgrade
choco install docker-desktop
To use the docker Playground you need to be in the source directory.
Inside that directory execute the following command:
docker compose up --build --remove-orphans -d
This will build the configured networks and services as well as run them.
To shut down the previously built playground execute:
docker compose down
Description | Command |
---|---|
Show Containers | docker compose ps |
Show Networks | docker network ls |
Show Logs | docker compose logs |
Enter a Container | docker exec -it container_name /bin/sh |
To establish a ssh connection to another container use:
ssh user_name@ip_adress
e.g.
ssh client@10.2.0.2
The IP Adress of each Network Interface can be inspected by executing:
ip a
All configuration is done in the docker-compose.yml
file.
Various environment variables can be set which are needed to configure the
network.
The IP Adress of each container can be set as follows:
environment:
IP_ADRESS: 10.1.0.2/16
To configure a route one has to define the destinated network as well as an IP
Adress to be routed over. The corresponding environment variable has to be named
after the convention ROUTING_routename
.
environment:
ROUTING_A: 10.1.0.3/16,10.2.0.0/16
The left side (10.1.0.3/16
) indicates the Bridge via which the packages are routed to the
destinated network, which is set on the right side (10.2.0.0/16
) of the ,
.
One can create a password protected user.
If no user name(USER_NAME
) is set the default user client
or
bridge
depending on the container type will be created with the default
password (USER_PASSWORD
) if not otherwise defined.
environment:
USER_NAME: example
USER_PASSWORD: dummy
version: '3'
services:
s10:
container_name: container_a
build:
context: ./client
dockerfile: Dockerfile
environment:
IP_CONTAINER: 10.1.0.2/16
ROUTING_A: 10.1.0.3/16,10.2.0.0/16
USER_NAME: client
USER_PASSWORD: playground
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- network_a
ports:
- 1010:22
restart: on-failure
s20:
container_name: bridge
build:
context: ./bridge
dockerfile: Dockerfile
environment:
BRIDGE_IP_NETWORK_A: 10.1.0.3/16
BRIDGE_IP_NETWORK_B: 10.2.0.3/16
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- network_a
- network_b
restart: on-failure
s30:
container_name: container_b
build:
context: ./client
dockerfile: Dockerfile
environment:
IP_CONTAINER: 10.2.0.2/16
ROUTING_A: 10.2.0.3/16,10.1.0.0/16
USER_NAME: client
USER_PASSWORD: playground
stdin_open: true
cap_add:
- NET_ADMIN
networks:
- network_b
ports:
- 2020:22
restart: on-failure
networks:
network_a:
driver: bridge
network_b:
driver: bridge
- BGP
- FTP
- Documentation
- Instructions