coturn / coturn

coturn TURN server project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stun can't get the public ip

bestxpp opened this issue · comments

commented

I deployed coturn on 10.0.5.25. Here is my configuration information:

 cat turnserver.conf
#listening-ip=0.0.0.0

listening-port=3478

min-port=40000
max-port=60000

#verbose

external-ip=10.0.5.25

lt-cred-mech
user=root:123456

realm=10.0.5.25
log-file=/var/tmp/turn.log
simple-log

#no-stun

#no-udp-relay
#no-tcp-relay
stun-only

I also deployed a Docker container on 10.0.5.25, with the network mode set to bridge. Then, I executed the command turnutils_stunclient -p 3478 10.0.5.25 in the container, expecting to get the IP address as 10.0.5.25. However, I received the IP address of the container instead.

Is there a way for coturn to directly return the IP address 10.0.5.25 as a candidate? How should I configure it?

Hi @bestxpp
If I understand correctly what happened - you got the right answer
turnutils_stunclient runs in the same container (with the container IP) and that is the address that STUN server saw and returned

The goal of STUN is to provide the client with its address as seen by STUN - which is exactly what you got.

The external-ip is used when creating turn allocations, not when using stun binding requests to discover the client IP address as @eakraly mentioned.

I'm assuming you don't need stun requests working from inside the container but from other machines. Test it from those other machines and if it doesn't work as you expect please reopen the ticket.