add UPnP IGD for automatic port mapping and external address discovery

This commit is contained in:
2026-02-09 17:49:44 -03:00
parent cf5eb0d5fd
commit 33730fed8a
13 changed files with 1364 additions and 7 deletions

25
docker-tests/upnp/peer-test.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -e
echo "=== UPnP IGD Peer Test ==="
echo "Peer: $PEER_NAME"
echo "Port: $PEER_PORT"
echo "Gateway: $GATEWAY_IP"
# Set default route through the NAT router
echo "Setting default route through NAT router..."
ip route del default 2>/dev/null || true
ip route add default via $GATEWAY_IP
echo "Current routes:"
ip route
echo ""
echo "Testing UPnP IGD discovery..."
# Run MWP demo (NAT-PMP will fail since it's disabled, then UPnP will be tried)
exec mwp-demo \
--name "$PEER_NAME" \
--port "$PEER_PORT" \
--deterministic \
"$@"