No Voice & Video behind NAT (DynDNS) [semi-solved]

Maybe we’re halfway there but an help is needed.

OS: Ubuntu 18.04
Jitsi-meet: last revision (Quick-Installation)
Behind NAT … without the need of any “Advanced Configuration” [great value-added from last revision !!]

ISSUE: at the beginning everything works like a charm.
Then, partecipants on LAN can see & hear each other … but audio & video are not available with people from WAN (using both Smartphone and Pc/Mac)

Partial Origin: Public-IP has changed for some reasons.

Are you using a DynDNS service?
It’s not enough having DDNS up to date.

I’ve recently found that my jitsi server (coturn) wasn’t able to work properly until the update of the external-IP recorded during the installation in /etc/turnserver.conf. That’s static .

Now, making use of a DDNS client such ad ddClient or inadyn can solve both issues.

Once configured, they update the DDNS with the new IP so that jitsi server is still reachable.
And if you assign them a script, you are able to get up to date also the above mentioned external-ip, re-enabling coturn to do its job.

For our purpose I’ve modified a script suggested elsewhere in the forum from xentity :

#!/bin/bash

DNSNAME=“mydomain.tld"

# get the actual IP from the Internet
IPint=$(host -tA $DNSNAME 8.8.8.8 | grep address | cut -d " " -f4 )

# get the configured IP of Jitsi
IPjitsi=$(grep 'external-ip' /etc/turnserver.conf |  grep -oE "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+")

#remove echo after debug
if [ "$IPjitsi" == "$IPint" ]
then
        echo "IP has not been changed!"
        exit 0
else
        echo "... actual IP: $IPjitsi"
        echo "... NEW IP: $IPint"
fi

#clear config
sed -i '/external-ip/d' /etc/turnserver.conf

#get IP and renew line
echo external-ip =$IPint >>  /etc/turnserver.conf

sudo service jicofo restart
sudo service jitsi-videobridge2 restart

MANUALLY executing the script … the “Voice & Video” problem (with partecipants from the WAN) is solved (for me), but I’m stopped here for some of my mistakes.

I’m in trouble with ddClient ver. (3.8.3-1.1ubuntu1) [ universe]:
'cause I’m not able to have it executing any script.

And I’m in trouble with inadyn (ver. 1.99.4-1build1) too.
This one is able to execute a script esplicitally assigned … but I’m not able to correctly customize the –system parameter for having it working with my DDNS provider.

Hope somebody could help us on the "last step” …
a) having the script working w/ ddClient, or
b) having inadyn customized to work for “generc” DDNS providers.

1 Like

I have seen, even though it is not documented that turn server works with adding dns for external-ip. You may try that, it is that the you will need restart every now and then … to update it, but the same is and for jvb.

1 Like

@damencho … many thanks for your prompt answer … and apologize for my absence
:wink:

SOLVED

I’m gonna packing all steps …:

  • correctly configuring ddCient,
  • adding the above illustraded code, and
  • adding an entry to crontab (sometimes ddclient deads …)
    jitsi-meet is always on with a DDNS .

Hi, I’m back.
Here are few steps I’ve adopted for having JITSI-MEET "always on" while using a DDNS:

  1. Install & configure ddClient
  2. Add an sh script
  3. Have ddClient executes it
  4. have cron checking the PublicIP and forcing the ddClient process.

Let’s start.

1. Install the last ddClient release:

apt-get install ddclient

For who’s not familiar with it, configure it with parameters obtained from your DDNS service provider

  • Server: reference to the server that receives the update DNS requests
  • Protocol: maybe dyndns2
  • your Login account
  • you Password
  • your hostname

Make some tests until it works, using:

sudo /usr/sbin/ddclient -daemon=0 -noquiet -debug -verbose

Check the output here:

cat /var/log/syslog

Check the status of ddClient here:

sudo systemctl status ddclient

Restart it, if needed, with

sudo systemctl restart ddclient

At this point, having ddClient deamon up and running, anytime your Public-IP will change it will be updated into your DDNS.

But … for having Jitsi-meet knowing about the new Public-IP we’ll use it’s capability to execute a script.

2. Copy my attached sh script ddclient_update_reference_to_publicIP.txt (815 Bytes) as:

sudo nano /etc/ddclient_update_reference_to_publicIP.sh

where 8.8.8.8 DNS Service is not mandatory (you can use your preferred one).

3. Have ddClient.conf knowing about its new job:

sudo nano /etc/ddclient.conf

… by adding this line:

postscript=/etc/ddclient_update_reference_to_publicIP.sh

exit & save (using ctrl-x).

Let’s have the script executable:

sudo chmod +x /etc/ddclient_update_reference_to_publicIP.sh

And have the routine working with privileges (but without the need of digiting the password):

sudo visudo

… add a line which looks like that (where user is the account executing the script)

user ALL=(ALL) NOPASSWD: /etc/ddclient_update_turnserver_IP.sh

When finished, try manuali the script

sudo /etc/ddclient_update_reference_to_publicIP.sh

Makes some tests.

4. last step: force (anyway) cron for checking the Public IP every 5 seconds:

sudo crontab -e

… and add the following line at the end of the file:

*/5 * * * * /usr/sbin/ddclient

Since now, every time (for any reason) your DynDNS will change … in no more than 5 minutes Jitsi-meet is “on” again .

Cheers