Bilbo Baggins
Bilbo Baggins

Reputation: 3019

TURN server broken - Coturn

Just a bit of background first.

I have installed coturn server in my local machine (Behind a firewall and with local IP). I have created a port forwarding for cotrun server lets say my local ip is: 192.168.0.11:3478 is mapped with my public ip 10.1.10.212:3478.

When I use some online utility to check my public IP has this port open it? that utility shows that it is open.

I am trying to test this server using this fiddle: Code to test TURN server

I removed the stun configuration from it, and added my live ip and port. And when I try to test it, it says your TURN server is broken in console on web browser. And I see failed as output.

I have also used following commands to create a user from this link. Wiki to Coturn Configuration

// created test user
sudo turnadmin -a -u test -r  test -p test

// enabling admin support in web (not sure how to access it in browser)
sudo turnadmin -A -u test -p test

I start the turn server using following command: turnserver -L 192.168.0.11 -a -f -v -X -r test

I have enabled the "TURNSERVER_ENABLED"

/etc/default/coturn 
TURNSERVER_ENABLED=1

Screenshot of my about:webrtc: Screenshot of about:webrtc

Please find the below attached Screen shot for my about:webrtc. I am not sure what is missing.

EDIT-1 I can also see the incoming packet message processed, error 401: Unauthorized in the console of TURN server

EDIT-2 I resolved the TURN server related issue, added the turn server in client code as well, still facing issue, call is not going through, TURN CALL NOT WORKING

Update Here is what I found, the reason why it wasn't working earlier was due to a defective router in the network. This thing has harassed me for almost a month (however the internet used to work fine). But I found that there is a loss of packets and I switch to LAN cable I even avoided the firewall of the organization and there it was working just fine. Then I configured the rules in firewall and it started working as well.

Upvotes: 2

Views: 4679

Answers (2)

esoinila
esoinila

Reputation: 99

" I have created a port forwarding for CoTurn server lets say my local ip is: 192.168.0.11:3478 is mapped with my public ip 10.1.10.212:3478."

Now surely you are aware that the private address-spaces in IPV4 are (private IP ranges): 10.0.0.0 – 10.255.255.255 172.16.0.0 – 172.31.255.255 192.168.0.0 – 192.168.255.255

So, your first IP is in the last private IP range, and your so-called "public IP" is in the first private IP-range. Now you need to find your TRUE REAL public-IP address to try to connect to it from outside. I would say that it looks like your ISP has you behind a NAT. So your TURN server might be behind two NATs. Which is kind of ironic situation for a server designed to help penetrate NATs of webRTC-clients. You might want to try to put CoTurn somewhere where it is possible for it to work like AWS (special case of CoTurn friendly NAT).

Just recently got (well with lots of help -- that even did the most of the work) CoTurn to work in cloud and on local Ubuntu ;-) (never stopped me from bragging though). Though there is troubling few srflx-call-successes yet (mostly local network or relay(TURN) calls). :-D

Upvotes: 0

OrangeDog
OrangeDog

Reputation: 38777

A few issues that might be causing this:

The -X option requires an argument - the external IP if the TURN server is behind a NAT.

If you are setting all your parameters on the command line, you should include -n to ensure that it does not load an unrelated configuration file.

TURNSERVER_ENABLED=1 is to start turnserver with default configuration at system boot. You do not want this if you are starting turnserver manually from the command line.

https://github.com/coturn/coturn/blob/master/README.turnserver

Upvotes: 1

Related Questions