add NAT-PMP for automatic port mapping and external address discovery
This commit is contained in:
25
docker-tests/nat-pmp/peer-test.sh
Executable file
25
docker-tests/nat-pmp/peer-test.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "=== NAT-PMP 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 NAT-PMP discovery..."
|
||||
|
||||
# Run MWP demo (it will try NAT-PMP automatically)
|
||||
exec mwp-demo \
|
||||
--name "$PEER_NAME" \
|
||||
--port "$PEER_PORT" \
|
||||
--deterministic \
|
||||
"$@"
|
||||
Reference in New Issue
Block a user