Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test coturn server with this cofiguration file ? #3

Open
trinhxhai2000 opened this issue Jun 20, 2022 · 6 comments
Open

How to test coturn server with this cofiguration file ? #3

trinhxhai2000 opened this issue Jun 20, 2022 · 6 comments

Comments

@trinhxhai2000
Copy link

Hi, i can't test my server, i think there are something to do with my configure file (i installed turnserver-4.5.2) to make this work. Can you check my config file ? Thank you very much.

Here is how i test and the output:

$ ./turnhammer {my public ip}:3478 test test123 -J

The test would do approx 0.011 Mbit/s and consume 0.006 megabytes of traffic
My external address: 1.55.210.102:38194
Allocated 1 TURN clients
{"status":"no_packets_received"}
Stopping TURN clients

Here my config file:

realm={MYDOMAIN}

listening-port=3478

tls-listening-port=5349

listening-ip=0.0.0.0

external-ip={MY PUBLIC IP}/172.31.16.1

min-port=49152
max-port=65535

verbose

lt-cred-mech
user=test:test123

log-file=/var/tmp/turn.log
log-binding
syslog

Here is my turnserver log

Jun 20 03:13:07 turnserver[81188]: 1444: : session 001000000000000010: closed (2nd stage), user <> realm > origin <>, local 0.0.0.0:3478, remote 1.55.210.102:38194, reason: allocation watchdog determined stale session state
Jun 20 03:17:04 turnserver[81188]: 1681: : handle_udp_packet: New UDP endpoint: local addr 0.0.0.0:3478, remote addr 1.55.210.102:51328
Jun 20 03:17:04 turnserver[81188]: 1681: : session 001000000000000012: realm > user <>: incoming packet BINDING processed, success
Jun 20 03:17:04 turnserver[81188]: 1681: : handle_udp_packet: New UDP endpoint: local addr 0.0.0.0:3478, remote addr 1.55.210.102:11424
Jun 20 03:17:04 turnserver[81188]: 1681: : session 001000000000000013: realm > user <>: incoming packet message processed, error 401: Unauthorized
Jun 20 03:17:04 turnserver[81188]: 1681: : IPv4. Local relay addr: 172.31.16.75:62442
Jun 20 03:17:04 turnserver[81188]: 1681: : session 001000000000000013: new, realm=>, username=, lifetime=600
Jun 20 03:17:04 turnserver[81188]: 1681: : session 001000000000000013: realm > user : incoming packet ALLOCATE processed, success
Jun 20 03:17:04 turnserver[81188]: 1681: : session 001000000000000013: peer 1.55.210.102:51328 lifetime updated: 600
Jun 20 03:17:04 turnserver[81188]: 1681: : session 001000000000000013: realm > user : incoming packet CHANNEL_BIND processed, success
Jun 20 03:17:04 turnserver[81188]: 1681: : session 001000000000000013: peer 1.55.210.102:51328 lifetime updated: 600
Jun 20 03:17:04 turnserver[81188]: 1681: : session 001000000000000013: realm > user : incoming packet CHANNEL_BIND processed, success
Jun 20 03:17:13 turnserver[81188]: 1690: : session 001000000000000013: refreshed, realm=>, username=, lifetime=0
Jun 20 03:17:13 turnserver[81188]: 1690: : session 001000000000000013: realm > user : incoming packet REFRESH processed, success
Jun 20 03:17:14 turnserver[81188]: 1691: : session 001000000000000013: usage: realm=>, username=, rp=5, rb=540, sp=5, sb=436
Jun 20 03:17:14 turnserver[81188]: 1691: : session 001000000000000013: peer usage: realm=>, username=, rp=0, rb=0, sp=0, sb=0
Jun 20 03:17:14 turnserver[81188]: 1691: : session 001000000000000013: closed (2nd stage), user realm > origin <>, local 0.0.0.0:3478, remote 1.55.210.102:11424, reason: allocation timeout
Jun 20 03:17:14 turnserver[81188]: 1691: : session 001000000000000013: delete: realm=>, username=
Jun 20 03:17:14 turnserver[81188]: 1691: : session 001000000000000013: peer 1.55.210.102:51328 deleted

@vi
Copy link
Owner

vi commented Jun 20, 2022

Are you sure the TURN server node is configured correctly? Maybe firewall blocks UDP ports besides 3478?

external-ip={MY PUBLIC IP}/172.31.16.1

This looks like an AWS setup. You need to forward additional ports to 172.31.16.1, not just 3478 for TURN server to work properly.

Suggested range of ports is:

min-port=49152
max-port=65535

@trinhxhai2000
Copy link
Author

It's working now, after i change external-ip={MY PUBLIC IP}/172.31.16."75" - the correct one, sorry for my mistake. Btw, can you tell me how to do this please, i can find any resources instructs to do this in the config file.

This looks like an AWS setup. You need to forward additional ports to 172.31.16.1, not just 3478 for TURN server to work properly.

@vi
Copy link
Owner

vi commented Jun 20, 2022

Btw, can you tell me how to do this please

this

To do what? To open firewall ports? Or to change external-ip to 75?

AWS firewall configuration is not done from within coturn's configuration file. Easiest way to do it is using the AWS console in browser. Here is some article, for example.

@trinhxhai2000
Copy link
Author

i mean how to

forward additional ports to 172.31.16.1

@vi
Copy link
Owner

vi commented Jun 20, 2022

Add the same rule as for port 3478, but also for the range of ports 49152-65535.
As turnhammer test and coturn logs show, port 3478 is forwarded correctly. Now just add other ports.

@trinhxhai2000
Copy link
Author

i got it, thank you a lot @vi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants