Small test clients/servers based on RPI-zero

Since i started my ccna homelab i wanted a small but powerfull device that i could use for client/server emulating. Now i have finally found something that is both cheap enough and small enough to easily use it while working on the network gear. Because it is running on a raspberry pi with docker you can add multiple other services or different hardware to make it fit your needs, my plan is to add a small oled screen later to easily find the ip address of the device. The current setup consists of the following hardware:

  • Raspberry pi zero or zero w
  • Waveshare eth/usb hub hat
  • Custom 3D printed case(still designing it)

The price for the current setup is only ~21 euro at this time. For that you get a small linux based computer that can easily run a couple of test docker images. Currently i run an nginx demo image for my web-server and an dns server. To make it easier to add extra devices i have made an docker-compose file that will pull/build/run the required images to create these test clients. With the addition of the eth/ush hat the device now also has an ethernet ports to be used to connect it to my switches.

To build these clients i started with flashing raspbian lite on an sd card and enabled SSH. Using the headless ssh configuration i can just place the SD card in the raspberry, connect it to my local network and finish the configuration from there. To install docker-compose i used the steps on the following site: How To Install Docker and Docker-Compose On Rasperry Pi. When i have more time i will add the steps to this post aswell.

After completing the installation of docker-compose you create a file called 'docker-compose.yaml' and paste in the following configuration

version: '3'
services:
 http:
  image: nginxdemos/hello
  restart: always
  ports:
   - "80:80"
 dns:
  image: defreitas/dns-proxy-server:2.19.0-arm7x86
  restart: always
  ports:
   - "53:53"
   - "5380:5380"
  volumes:
   - /opt/dns-proxy-server/conf:/app/conf
   - /var/run/docker.sock:/var/run/docker.sock
   - /etc/resolv.conf:/etc/resolv.conf

Save the file and let docker create the containers using the following command:

sudo docker-compose -f docker-compose.yaml up -d

Test the configuration by opening a browser window and entering the ip address of your raspberry pi. if that is working you can configure the dns server by opening the http website running on port 5380. Here you can add dns records that can be used while testing different network settings.