Behind NAT not working

260 views
Skip to first unread message

Moises B. Almeida

unread,
Oct 19, 2021, 2:56:23 PM10/19/21
to meetecho-janus
I'm struggling, but I can't solve it.

my config:
rtp_port_range = "10000-20000"

turn_server = "myturn.server"
turn_port = 3478
turn_type = "udp"
turn_user = "myuser"
turn_pwd = "mypass"

my clients use the same TURN server. It works fine when testing in https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/

should I set "full_trickle = true"?

Please help me with that!

In Local everything works fine.

What should I do?

Ben Davenport

unread,
Oct 19, 2021, 3:02:51 PM10/19/21
to Moises B. Almeida, meetecho-janus
Try removing the TURN server config in Janus and use the following command arg when launching Janus:

-1, --nat-1-1=ip              Public IP to put in all host candidates,
                                  assuming a 1:1 NAT is in place (e.g., Amazon
                                  EC2 instances, default=none)

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/ab68da51-20ee-437f-814f-fb6d3e0a4136n%40googlegroups.com.

Moises B. Almeida

unread,
Oct 20, 2021, 2:25:44 PM10/20/21
to meetecho-janus
using it I got:

(process:2604): libnice-DEBUG: 18:22:19.963: Agent 0xffff2c00b2a0 : Candidate gathering FINISHED, stopping discovery timer.
(process:2604): libnice-DEBUG: 18:22:19.964: Agent 0xffff2c00b2a0: gathered UDP local candidate : [192.168.10.210]:53166 for s1/c1. U/P '(null)'/'(null)'
(process:2604): libnice-DEBUG: 18:22:19.964: Agent 0xffff2c00b2a0: gathered UDP local candidate : [mypublicip]:53166 for s1/c1. U/P '(null)'/'(null)'
(process:2604): libnice-DEBUG: 18:22:20.198: Agent 0xffff2c00b2a0: inbound STUN packet for 1/1 (stream/component) from [192.168.10.149]:56019 (100 octets) :
(process:2604): libnice-stun-DEBUG: 18:22:20.198: STUN demux: OK!
 when in local network.

(process:2604): libnice-DEBUG: 18:21:52.218: Agent 0xffff2c00b000 : Candidate gathering FINISHED, stopping discovery timer.
(process:2604): libnice-DEBUG: 18:21:52.218: Agent 0xffff2c00b000: gathered UDP local candidate : [192.168.10.210]:48784 for s1/c1. U/P '(null)'/'(null)'
(process:2604): libnice-DEBUG: 18:21:52.218: Agent 0xffff2c00b000: gathered UDP local candidate : [mypublicip]:48784 for s1/c1. U/P '(null)'/'(null)'
when behind nat

Why is this happen?

Ben Davenport

unread,
Oct 20, 2021, 2:31:59 PM10/20/21
to Moises B. Almeida, meetecho-janus
Looks as though it could be trying to make connections outside of your defined port range of 10000-20000. Make that much larger, something like 5002-65535


Moises B. Almeida

unread,
Oct 20, 2021, 4:58:32 PM10/20/21
to meetecho-janus
I wanna be able to connect to my Janus (my home) out of my local network.
Using TURN - and --nat-1-1=myip - I got nice debug changing state to COMPLETE (last line -> https://pastebin.com/cahRU1dy)
But in line 24 I got STUN 401 error.
I'm still not receiving or sending audio behind NAT.

The port range seems to solve some problems.

Some clue? Thanks for the help! (I'm really glad and needy)

Moises B. Almeida

unread,
Oct 21, 2021, 10:11:37 AM10/21/21
to meetecho-janus
Please I need help! Janus still do not working behind NAT.

https://pastebin.com/snEwQWfz -> coturn when I try out of local network.




Working fine in local networking

Ben Davenport

unread,
Oct 21, 2021, 10:38:08 AM10/21/21
to Moises B. Almeida, meetecho-janus

Moises B. Almeida

unread,
Oct 21, 2021, 10:41:28 AM10/21/21
to meetecho-janus
https://pastebin.com/vQnFRARM -> iceServers array

Ben Davenport

unread,
Oct 21, 2021, 10:45:44 AM10/21/21
to Moises B. Almeida, meetecho-janus
It may be that your non-local network you're trying to use only supports secure TURN (TURNS), which is TURN over TLS.

Have you tried using Wireshark to capture traffic?

Moises B. Almeida

unread,
Oct 21, 2021, 10:57:25 AM10/21/21
to meetecho-janus


In line 29 -> Retry may be possible, stun error code 401.

I really do not understand, because the PASSWORD is correct. I got this log in TURN server, but not shure it`s the problem. I will give a look in Wireshark and tell you what I got.

Moises B. Almeida

unread,
Oct 21, 2021, 1:42:32 PM10/21/21
to meetecho-janus
Captura de Tela 2021-10-21 às 14.41.45.png
Sounds good?

Mirko Brankovic

unread,
Oct 21, 2021, 2:10:32 PM10/21/21
to meetecho-janus
I see you are using turnadmin user, maybe it is default user and pass so not allowing you to authenticate untill you use another generated user/pass? Is it coturn?
Also better to conceal the realm from wireshark

Moises B. Almeida

unread,
Oct 21, 2021, 2:36:11 PM10/21/21
to meetecho-janus

Yes, coTURN! okay I'll change the user! How do I conceal the realm?

Mirko Brankovic

unread,
Oct 22, 2021, 4:57:59 AM10/22/21
to meetecho-janus
Just in your image sharing 😉,
I won't obuse your turn server, but some ppl out there might ;)

Moises B. Almeida

unread,
Oct 22, 2021, 10:44:15 AM10/22/21
to meetecho-janus
Well, to finish the matter: it's not an issue with Janus? It's a TURN issue? A sample Janus config should be able to work behind NAT? Thanks!
Message has been deleted

Сергей Хоменко

unread,
Jan 5, 2022, 11:03:19 AM1/5/22
to meetecho-janus
hey guys, can you please tell me what should I put into server option if my janus server using turn and deployed behind a firewall?
I want to try janus behind a firewall with force relay on, what I've done is:

I've got my local network, with janus deployed. I've also got coturn installed on a computer with public ip
I've configure janus to use TURN as described here
but I'm really can't understand what to set as a janus server, as it obviously has no public ip or domain name

const janus = new Janus({server: "?"});

thank you

пятница, 22 октября 2021 г. в 17:44:15 UTC+3, moigam...@gmail.com:
Reply all
Reply to author
Forward
0 new messages