Use Janus with dynamic IP and dyndns

922 views
Skip to first unread message

sisnia...@gmail.com

unread,
Nov 14, 2018, 12:49:09 PM11/14/18
to meetecho-janus
Hello,

I am deploying Janus within an instance that does not have a public IP address assigned to it. 
However, I can use DynDNS or some similar service to get a static DNS.
Can I configure a domain name within the nat_1_1_mapping parameter? 
Is there any other parameter for it?

Thanks

Lorenzo Miniero

unread,
Nov 15, 2018, 5:49:14 AM11/15/18
to meetecho-janus
No, nat_1_1_mapping expects an IP address. Even if it supported name resolution, though, it would be "frozen" to what your dynamic DNS points to at startup, and so would not autoupdate when your IP changes. If your IP is really that dynamic during the Janus lifetime, it might have more sense to configure a STUN server for Janus instead (even thougn it's usually better to avoid that when possible).

Lorenzo

Alessandro Toppi

unread,
Nov 15, 2018, 6:20:47 AM11/15/18
to meetecho-janus
That parameter only accepts a IP address value and it is designed to add a static IP candidate. This is only useful when behind particular NATs.
As Lorenzo said, try enabling the STUN for Janus IP discovery and/or just let ICE do its magic. Chances are that your application might just work thanks to ICE peer-candidates.


Il giorno mercoledì 14 novembre 2018 18:49:09 UTC+1, sisnia...@gmail.com ha scritto:

sisnia...@gmail.com

unread,
Nov 15, 2018, 7:42:12 AM11/15/18
to meetecho-janus
Thanks Lorenzo. I tried to use different STUN servers in Janus but it doesn't work. ICE failed if I don't set nat_1_1_mapping parameter.

sisnia...@gmail.com

unread,
Nov 19, 2018, 3:36:09 AM11/19/18
to meetecho-janus
Should it work by removing the nat_1_1_mapping parameter and adding a stun server in janus.cfg?

I've tried that but ICE failed again.

Only it works with nat_1_1_mapping parameter.

Best regards

Alessandro Toppi

unread,
Nov 19, 2018, 6:14:15 AM11/19/18
to meetecho-janus
Check the candidates that Janus has gathered, either on Janus or client side.
Is the IP discovered by STUN the one you're expecting (very likely the one you're setting in nat_1_1 parameter) ?

sisnia...@gmail.com

unread,
Nov 19, 2018, 8:13:46 AM11/19/18
to meetecho-janus
No, I am using admin API to see the candidates and when I use STUN without setting the parameter nat_1_1_mapping in the local-candidates I see the private IP address inside my NAT, not the public one. 
How do I fix it? Did I forget something?
Thanks!

Alessandro Toppi

unread,
Nov 19, 2018, 10:44:12 AM11/19/18
to meetecho-janus
Works fine here.
Setting stun_server = stun.voip.eutelia.it I've got these candidates on Janus (hiding addresses for privacy concerns)

"local-candidates": [
   
"1 1 udp 2013266431 192.168.1.169 46018 typ host",
   
"2 1 udp 2013266430 192.168.1.170 37758 typ host",
   
"3 1 udp 1677722111 93.44.xxx.yyy 51073 typ srflx raddr 192.168.1.169 rport 46018",
   
"4 1 udp 1677722110 93.44.xxx.yyy 62708 typ srflx raddr 192.168.1.170 rport 37758"
 
],

Notice the srflx tag for STUN discovered IPs.
Check with Wireshark if Janus is executing the STUN request toward the server you have chosen, and what the response from server is.

sisnia...@gmail.com

unread,
Nov 19, 2018, 11:40:03 AM11/19/18
to meetecho-janus
I have tested with stun.voip.eutelia.it and with my STUN. It's the same.

When I launch Janus, in wireshark I can see the STUN request and the STUN response from the server. The mapped address value here is OK. I can see the public address of the Janus instance.

However, when I run a demo (e.g. videoroom), in the local-candidates, I only can see the first one (similar than you), but I can't see any candidates with srflex tag. In wireshark at this moment, I only see Binding request (same user) from Janus to different IPs: privates and publics. But no answer, I don't know if it's normal.

Thanks

sisnia...@gmail.com

unread,
Nov 20, 2018, 7:18:19 AM11/20/18
to meetecho-janus
I've tried the latest version of Janus and I have the same problem.

Here the candidates I can see in a videoroom handle:

-  172.31.ZZZ.ZZZ (Janus private IP behind NAT)
51.38.ZZZ.ZZZ (Janus public IP)
84.125.ZZZ.ZZZ (Client public IP)
192.168.ZZZ.ZZZ (Client private IPs)

Any idea why IEC still fails?

Alessandro, could you provide me your janus.cfg file as example? I am only setting up stun_host and stun_port parameters.

Thanks


El lunes, 19 de noviembre de 2018, 16:44:12 (UTC+1), Alessandro Toppi escribió:

Alessandro Amirante

unread,
Nov 20, 2018, 7:29:56 AM11/20/18
to sisnia...@gmail.com, meetech...@googlegroups.com
Which version of libnice are you using?

Also, are you by any chance deploying Janus in a Docker container?

A.

--
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.
For more options, visit https://groups.google.com/d/optout.

Alessandro Toppi

unread,
Nov 20, 2018, 7:31:29 AM11/20/18
to meetecho-janus
Here is my diff with standard configuration.
https://pastebin.com/4wfKg3NM

Which version of libnice are you using? Can you try with latest master?

sisnia...@gmail.com

unread,
Nov 20, 2018, 9:07:54 AM11/20/18
to meetecho-janus
I just tested a clean installation using the latest version of libnice and it works for me. I was using libnice-dev_0.1.7-1

So, what are the advantages of using nat_1_1_mapping versus stun in the janus side or vice versa? Do you get the same result?

Thanks!

Alessandro Toppi

unread,
Nov 20, 2018, 9:31:57 AM11/20/18
to meetecho-janus
STUN will always work in case of dynamic IP, as for every handshake a STUN request will be sent to the STUN server.
nat_1_1_mapping is ok only for static IP, and simply appends the defined address to the list of Janus local candidates.

sisnia...@gmail.com

unread,
Nov 20, 2018, 5:16:06 PM11/20/18
to meetecho-janus
Ok Alessandro, thank you very much!

I will use a STUN server for my dynamic IP address. Thanks!
Reply all
Reply to author
Forward
0 new messages