bbb-install
bbb-install copied to clipboard
Fix TURN server configuration for TURN servers behind NAT gateways
Commit 1b19b0 (Updated for installing coturn on 20.04 - Jan 17 2021) added coturn configuration options (listening-ip, relay-ip, external-ip) that aren't properly set if the TURN server is behind a NAT gateway.
In the NAT case, both listening-ip (the address the TURN server binds to) and relay-ip (the address the TURN server transmits on) should be the private IP address.
If listening-ip and relay-ip are improperly set to the external IP address, then we get error messages (like those reported on Issue #577) that the TURN server can't bind to the public IP address.
Fixes and closes Issue #577.
Just testing this -- it seems that ${INTERNAL_IP:-$IP}
will only put the first INTERNAL_IP
.
# cat test.sh
#!/bin/bash
INTERNAL_IP=1.1.1.1
IP=2.2.2.2
echo "listening-ip=${INTERNAL_IP:-$IP}"
#./test.sh
listening-ip=1.1.1.1
Just testing this -- it seems that
${INTERNAL_IP:-$IP}
will only put the firstINTERNAL_IP
.
That's the desired behavior. It uses INTERNAL_IP
in the NAT case, and IP
in the non-NAT case.
listening-ip
is the address that the TURN server actually binds to and listens for packets on, so it needs to be an address that is actually configured on the machine. In the NAT case, INTERNAL_IP
is the private address and IP
is the public address, while in the non-NAT case, INTERNAL_IP
isn't set and IP
is the public address, that is also the address actually configured on the machine.