BBB-2.3 and Local IP change

508 views
Skip to first unread message

Fabrice Rouillier

unread,
May 6, 2021, 3:45:49 AM5/6/21
to BigBlueButton-Setup
Hi all, 

I have installed bbb 2.3 on some scalaway "instance" with the particularity that the local IP might change each time I switch on and then off the virtual machine.

With 2.2.XX I did modify the /etc/rc.local to run a script that detect if the local IP did change since last boot and if so modifies the files :

/usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties

/opt/freeswitch/etc/freeswitch/vars.xml

/usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml

and then run bbb-conf --restart


With 2.3 the script call by /etc/rc.local (I did configure and enable the rc-local service) has only a partial effect, freeswitch is still not working properly (error 1002 at the echo test) . No problem with the webcam on the other hand.


I also did try to add the script without the last call to bbb-conf --restart in the file /etc/bigbluebutton/bbb-conf/apply-config.sh which is supposed to be executed before bbb is launched, but this drive to the same 1002 error.

Running the script by hand and then reboot solves the problem but I would like an automatic solution ....


As someone any idea ?


Militades sunfire

unread,
May 6, 2021, 3:51:17 AM5/6/21
to bigbluebu...@googlegroups.com

There are quite a few places where you got the IP in bbb configs.

Why do you even turn the server on and off regularly :-P

My guess is the best might be running the installer script every time the IP changes ...

--
You received this message because you are subscribed to the Google Groups "BigBlueButton-Setup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigbluebutton-s...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bigbluebutton-setup/920bd5ec-c3ed-4d81-81eb-2c85202733b0n%40googlegroups.com.

Fabrice Rouillier

unread,
May 6, 2021, 4:01:10 AM5/6/21
to BigBlueButton-Setup

> There are quite a few places where you got the IP in bbb configs.

Le local IP is used in the 3 places listed above. The script works when it is run by hand. The only thing is that I do not find a way to launch it properly at boot time.

Why do you even turn the server on and off regularly :-P

They are used only between 8 AM en 8 PM, it is useless to let them run (and also you do not pay the instance when it is stopped).

My guess is the best might be running the installer script every time the IP changes ...

No, it is too long and also much cause other problems.

The script works when it is run by hand and did work when it was run from /etc/rc.local so I am confident that this is probably only a question of restarting something additionally (maybe freeswitch deamon ?)

Cheers,

Fabrice;

sd...@distancelearning.cloud

unread,
May 6, 2021, 7:25:47 AM5/6/21
to bigbluebu...@googlegroups.com

Look at /etc/bigbluebutton/nginx/sip.nginx and make sure this is the external IP, and also /opt/freeswitch/conf/sip_profiles/external.xml   they need to match.

 

1002 is websockets failing.

 

Regards,

Stephen

Fabrice Rouillier

unread,
May 6, 2021, 12:37:34 PM5/6/21
to BigBlueButton-Setup

No problem with the external IP since it does not change (and it is well configured in both files you mention).

It is "only" a problem of local IP that change (DHCP) each time you switch off/on the machine.

Regards,

Fabrice.

sd...@distancelearning.cloud

unread,
May 6, 2021, 7:07:26 PM5/6/21
to bigbluebu...@googlegroups.com

You shouldn’t get 1002 if only internal is misconfigured, but the backend bbb components would fail to connect to freewitch, so joining the conference fails. But with other errors 1xxx errors

Fabrice Rouillier

unread,
May 7, 2021, 6:07:30 AM5/7/21
to BigBlueButton-Setup

You shouldn’t get 1002 if only internal is misconfigured, but the backend bbb components would fail to connect to freewitch, so joining the conference fails. But with other errors 1xxx errors

The problem is not how to correct the error (the modification of the local IP as described in my first most solve the problem) but when to correct it :  

1 - If I perform  the modifications I have listed (using a script) when the system give me the hand at the end of the boot process and then launch bbb-conf --clean it works
2 - If I use the BBB script apply-conf.sh for exactly the same purpose in order to avoid running the script by hand, the modifications are not taken into account, as if the script was run AFTER bbb is launched. Again, running manually the script when the system give me the hand corrects the problem.

Remark : everything did work with BBB 2.2.XXX

sd...@distancelearning.cloud

unread,
May 7, 2021, 7:23:10 AM5/7/21
to bigbluebu...@googlegroups.com

How do you stop the instance,  the hard power off, or putting the server in standby mode?    Do you use the apis, or the scaleway console.

 

Looks like standby mode may continue to incur charges?    I’m starting of instance and testing.

 

Regards

Stephen

 

From: bigbluebu...@googlegroups.com <bigbluebu...@googlegroups.com> On Behalf Of Fabrice Rouillier
Sent: Friday, May 7, 2021 6:08 AM
To: BigBlueButton-Setup <bigbluebu...@googlegroups.com>
Subject: Re: [bigbluebutton-setup] BBB-2.3 and Local IP change

 

 

You shouldn’t get 1002 if only internal is misconfigured, but the backend bbb components would fail to connect to freewitch, so joining the conference fails. But with other errors 1xxx errors

--

You received this message because you are subscribed to the Google Groups "BigBlueButton-Setup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigbluebutton-s...@googlegroups.com.

Fabrice Rouillier

unread,
May 7, 2021, 7:27:14 AM5/7/21
to BigBlueButton-Setup

How do you stop the instance,  the hard power off, or putting the server in standby mode?    Do you use the apis, or the scaleway console.

 

Hard power off (otherwise the internal IP does not change and there is no problem).  

All the best,

Fabrice.

sd...@distancelearning.cloud

unread,
May 7, 2021, 8:49:42 AM5/7/21
to bigbluebu...@googlegroups.com

Can you share the script that changes the internal IP is all the locations for 2.3, I have scaleway instance running to test, will try to get the config files changed before any of the systemd services startup.

I believe your rc. Script is doing it after bbb is up if I had to guess.

 

Regards,

Stephen

 

From: bigbluebu...@googlegroups.com <bigbluebu...@googlegroups.com> On Behalf Of Fabrice Rouillier
Sent: Friday, May 7, 2021 7:27 AM
To: BigBlueButton-Setup <bigbluebu...@googlegroups.com>
Subject: Re: [bigbluebutton-setup] BBB-2.3 and Local IP change

 

 

How do you stop the instance,  the hard power off, or putting the server in standby mode?    Do you use the apis, or the scaleway console.

 

--

You received this message because you are subscribed to the Google Groups "BigBlueButton-Setup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigbluebutton-s...@googlegroups.com.

Fabrice Rouillier

unread,
May 7, 2021, 9:11:53 AM5/7/21
to BigBlueButton-Setup
You will find it here :https://gitlab.inria.fr/rouillie/bbb/-/blob/master/bbb_config/scripts/change_internal_ip.sh

With bbb 2.2.XXX it was run in the file /etc/rc.local as described here for Scaleway cloud :


All  the best,

Fabrice.

sd...@distancelearning.cloud

unread,
May 7, 2021, 1:16:45 PM5/7/21
to bigbluebu...@googlegroups.com

So here is what I did for 2.3 to get the stop/start to fully work In Scaleway.

No need to run bbb-conf –restart.

 

The systemd files are starting all the bbb services immediately,  if you tail /opt/freeswitch/log, you will see the error where freeswitch sip profiles fail to load because of old IP not able to bind.

 

My solution

 

Create   /var/lib/cloud/scripts/per-boot/change-insternal-ip-on-boot.sh and do a chmod +x on it so it is executable

 

#!/bin/bash

ifconfig >/tmp/changeinternal

old_internal=`cat /usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml | grep localIpAddress | sed 's/localIpAddress: //'`

new_internal=`scw-metadata PRIVATE_IP`

echo "OLD $old_internal NEW $new_internal Internal" >>/tmp/changeinternal

sed -i "s/$old_internal/$new_internal/g" /opt/freeswitch/etc/freeswitch/vars.xml

sed -i "s/$old_internal/$new_internal/g" /usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml

changed_internal=`cat /usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml | grep localIpAddress | sed 's/localIpAddress: //'`

echo "Changed to $changed_internal" >>/tmp/changeinternal

/opt/freeswitch/bin/fs_cli -p $(xmlstarlet sel -t -m 'configuration/settings/param[@name="password"]' -v @value /opt/freeswitch/etc/freeswitch/autoload_configs/event_socket.conf.xml) -x "reload mod_sofia" >>/tmp/changeinternal

 

Pretty much same as yours, im doing it in cloud-init, per boot.

 

You can eliminate the red5 sip.properties line is yours, not needed for 2.3

 

Also notice the last line… I let BBB start as normal,  then I reload mod_sofia to get the profiles loaded with the new internal IP.

 

Tested half dozen times, and starting allows for both full, listen only audio to work, as well as camera/screenshare immediately on start up.

 

You could mess with the systemd files im sure to wait for change be bore starting freeswitch, but this approach has no changes to bbb package, and the services are up sooner.

Fabrice Rouillier

unread,
May 8, 2021, 4:24:14 AM5/8/21
to BigBlueButton-Setup
Hi Stephen.

At then end, putting my script in the directory  /var/lib/cloud/scripts/per-boot/ makes the job.

May be we could thing about having a generic solution for all situation of the local is obtained dynamically ?

Thanks for the trick for restarting only freeswitch, this might speed up the process.

So, for those who are interested, I have updated the installation scripts there : http://gitlab.inria.fr/rouillie/bbb and in particular make them compatible with both 2.2 and 2.3 thanks to  a detection of the operating system.


All the best.

Fred Dixon

unread,
May 8, 2021, 7:46:29 AM5/8/21
to BigBlueButton-.
Thanks for sharing this Fabrice!

Regards,... Fred



--
BigBlueButton Developer

Like BigBlueButton?  Tweet us at @bigbluebutton
Reply all
Reply to author
Forward
0 new messages