How to auto-detect NAT_HARVESTER_PUBLIC_ADDRESS

I had to configure /etc/jitsi/videobridge/sip-communicator.properties with:

org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=192.168.123.456
org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=1.2.3.4

How can I replace those values by a resolvable FQDN or subshell call for autodetection?

For auto detection you can use these two properties and values:


Hi,
Did not get your point!
I have the same problem, the public IP is changing every 24 hours. Does you post points to two scripts which change the org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS to a new IP? How do I execute these scripts?

Maybe silly questions, but I can’t figure it out, sorry.

Thx in advance!

Add these as settings instead of private and public address:

org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER=true
org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES=meet-jit-si-turnrelay.jitsi.net:443

And whenever your IP changes just restart jvb and then jicofo.

To not depend on jitsi.net or another third-party, I suppose a STUN server must be implemented somewhere.
Maybe Jitsi client could make this information job (new feature)?

Latest packages install a stun/turn server and you can change it to use that.

Sorry for my ignorance about stun/turn services:
Is stun/turn server useful at same Jitsi server? (without being on another Internet place)
How cant it be enabled & started on a default Debian setup?
Some tcp/udp port to be forwarded?

Thank you.

Hi Damencho!
Works perfectly fine, thanks!

Just a side note, in addition to the stun config - if you still want to have the local and public IPs, in most cloud platforms there is a way to discover the VM’s details, including private and public addresses.

For example in AWS a simple call to http://169.254.169.254/latest/meta-data/public-ipv4 gives you the public IP and to http://169.254.169.254/latest/meta-data/local-ipv4 gives you the private one.

With some automation scripts you can pre-populate the configs, with cron you can keep them updated in case IPs change.

1 Like

I’ve found a hosting-independent way to get public address, by only using external DNS. Let’s suppose we use a public DNS 1.2.3.4 from Internet:

host $(hostname -f) 1.2.3.4 | grep -e 'has address'

an easier to remember to get public ip is curl http://icanhazip.com