| title | author | date |
|---|---|---|
README |
Todd Wintermute |
2023-12-21 |
rtr docker image for simple lab testing applications.
Docker Hub: https://hub.docker.com/r/toddwint/rtr
GitHub: https://github.com/toddwint/rtr
Docker image for a quick single physical interface router which can route multiple connected subnets plus static routes.
Pull the docker image from Docker Hub or, optionally, build the docker image from the source files in the build directory.
Create and run the container using docker run commands, docker compose commands, or by downloading and using the files here on github in the directories run or compose.
NOTE: A volume named upload is created the first time the container is started. Modify the files in that directory. Specify connected interfaces in addrs.csv and static routes in routes.csv. Then restart the container.
Manage the container using a web browser. Navigate to the IP address of the container and one of the HTTPPORTs.
NOTE: Network interface must be UP i.e. a cable plugged in.
Example docker run and docker compose commands as well as sample commands to create the macvlan are below.
- Ubuntu base image
- Plus:
- fzf
- iproute2
- iputils-arping
- iputils-ping
- python3-minimal
- tmux
- tzdata
- ttyd
- View the terminal in your browser
- frontail
- View logs in your browser
- Mark/Highlight logs
- Pause logs
- Filter logs
- tailon
- View multiple logs and files in your browser
- User selectable
tail,grep,sed, andawkcommands - Filter logs and files
- Download logs to your computer
Create the docker macvlan interface.
docker network create -d macvlan --subnet=169.254.255.240/28 --gateway=169.254.255.241 \
--aux-address="mgmt_ip=169.254.255.253" -o parent="eth0" \
--attachable "rtr01"Create a management macvlan interface.
sudo ip link add "rtr01" link "eth0" type macvlan mode bridge
sudo ip link set "rtr01" upAssign an IP on the management macvlan interface plus add routes to the docker container.
sudo ip addr add "169.254.255.253/32" dev "rtr01"
sudo ip route add "169.254.255.240/28" dev "rtr01"docker run -dit \
--name "rtr01" \
--network "rtr01" \
--ip "169.254.255.254" \
-h "rtr01" \
-v "${PWD}/upload:/opt/rtr/upload" \
-p "169.254.255.254:8080:8080" \
-p "169.254.255.254:8081:8081" \
-p "169.254.255.254:8082:8082" \
-p "169.254.255.254:8083:8083" \
-e TZ="UTC" \
-e MGMTIP="169.254.255.253" \
-e GATEWAY="169.254.255.241" \
-e HUID="1000" \
-e HGID="1000" \
-e HTTPPORT1="8080" \
-e HTTPPORT2="8081" \
-e HTTPPORT3="8082" \
-e HTTPPORT4="8083" \
-e HOSTNAME="rtr01" \
-e APPNAME="rtr" \
--cap-add=NET_ADMIN \
"toddwint/rtr"name: rtr01
services:
rtr:
image: toddwint/rtr
hostname: rtr01
ports:
- "169.254.255.254:8080:8080"
- "169.254.255.254:8081:8081"
- "169.254.255.254:8082:8082"
- "169.254.255.254:8083:8083"
networks:
default:
ipv4_address: 169.254.255.254
environment:
- MGMTIP=169.254.255.253
- GATEWAY=169.254.255.241
- HUID=1000
- HGID=1000
- HOSTNAME=rtr01
- TZ=UTC
- HTTPPORT1=8080
- HTTPPORT2=8081
- HTTPPORT3=8082
- HTTPPORT4=8083
- APPNAME=rtr
privileged: true
cap_add:
- NET_ADMIN
volumes:
- "${PWD}/upload:/opt/rtr/upload"
tty: true
networks:
default:
name: "rtr01"
external: true