fix MWP hole punch for production use. bind to 0.0.0.0 instead of

published IP, resend packets every 500ms instead of single-shot, fix
Docker iptables-legacy chains so miniupnpd port mapping fully works
without warnings
This commit is contained in:
2026-02-10 11:26:57 -03:00
parent 33730fed8a
commit 2fe03cb855
12 changed files with 356 additions and 56 deletions

View File

@@ -44,7 +44,7 @@ echo "miniupnpd is running"
# Show router state
echo ""
echo "Router NAT table:"
docker compose exec router iptables -t nat -L -n | head -20
docker compose exec router iptables-legacy -t nat -L -n | head -20
echo ""
echo "[4/4] Running peer tests..."
@@ -99,7 +99,7 @@ docker logs test-peer-b 2>&1 | tail -30
# Check for success indicators
ALICE_NATPMP=$(docker logs test-peer-a 2>&1 | grep -c "NAT-PMP:" || true)
BOB_NATPMP=$(docker logs test-peer-b 2>&1 | grep -c "NAT-PMP:" || true)
CONNECTION=$(docker logs test-peer-b 2>&1 | grep -c "Connected\|SUCCESS" || true)
CONNECTION=$(docker logs test-peer-b 2>&1 | grep -c "CONNECTION ESTABLISHED" || true)
echo ""
echo "=========================================="
@@ -122,4 +122,13 @@ else
fi
echo ""
echo "Test complete."
# Final pass/fail
ALICE_CONNECTED=$(docker logs test-peer-a 2>&1 | grep -c "CONNECTION ESTABLISHED" || true)
if [ $ALICE_CONNECTED -gt 0 ] && [ $CONNECTION -gt 0 ]; then
echo "PASS: Both peers established connection through NAT"
elif [ $ALICE_CONNECTED -gt 0 ] || [ $CONNECTION -gt 0 ]; then
echo "PASS: At least one peer established connection through NAT"
else
echo "FAIL: No connection established"
exit 1
fi