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

@@ -36,7 +36,7 @@ This test uses `miniupnpd` as the UPnP daemon with **NAT-PMP disabled**, so the
The router:
- Runs `miniupnpd` with UPnP IGD enabled, NAT-PMP disabled
- Does NAT (iptables MASQUERADE) for internal clients
- Reports a fake "external" IP (93.184.216.34) for testing
- Uses a public-looking "external" IP (93.184.216.34) added as alias on the external interface (miniupnpd rejects private IPs)
## Quick Start
@@ -70,12 +70,16 @@ UPnP: External address is 93.184.216.34
Using UPnP IGD: 93.184.216.34:18101
```
### Port Mapping: PARTIAL
Port mapping requests are sent correctly, but miniupnpd may return errors because:
- The fake external IP doesn't match the actual interface
- iptables rules can't be created for a non-local address
### Port Mapping: PASS
miniupnpd creates DNAT and masquerade rules via libiptc (iptables-legacy).
This is expected in the Docker test environment.
```
info: UPnP: Mapped UDP port 18101 -> 93.184.216.34:18101 (lifetime: 3600s)
```
### Connection: PASS
Full MWP hole punch completes. Both peers establish a verified connection through
the NAT router using DNAT port forwarding and hairpin masquerade.
### NAT-PMP: SKIPPED
NAT-PMP is disabled on the router (`enable_natpmp=no`), so the mwp-demo's NAT-PMP attempt fails silently and falls through to UPnP.