Add an additional tool to the toolkit of avid homelabbers or individuals who might not have direct access to port forward services on their router. Networks that support UPnP will be able to expose internal services to the WAN with little effort. This project was motivated by Google WiFi not supporting port forwarding to an ARP based Virtual IP (VIP). Trying to achieve High Availability without the ability to forward to a shared VIP proves to make for a lacking homelab.
docker pull projectinitiative/upnp-service:latest
# OR
docker pull ghcr.io/projectinitiative/upnp-service:latest
All settings for running the container live in the upnp.json
file (see next section). When running the container, the host
network needs to be attached. This is achieved with --network host
for the docker
command, or network_mode: host
in compose files.
The config JSON lives in /etc/upnp-service/upnp.json
. This file will need to be mounted or edited in the container. Here is a sample of the data required to run properly:
{
"apps":
[
{
"app_name": "app1",
"redirections": [
["801", "TCP"],
["80801","80801","TCP"],
["80801","80801","UDP"]
]
},
{
"app_name": "app2",
"redirections": [
["4333","TCP"],
["4332","4334","TCP"]
]
}
]
}
cd $PROJ_DIR
docker build -t $TAG -f $PROJ_DIR/docker-image/Dockerfile $PROJ_DIR/docker-image
Original credit and inspiration to ofepk's Stack Overflow answer detailing a basic UPnP service docker container.