bbb-install icon indicating copy to clipboard operation
bbb-install copied to clipboard

Scripts detect local ip on EC2 and not external IP

Open djvanderlaan opened this issue 4 years ago • 6 comments

Hi, I am trying to setup bbb on ec2 using the install script, but I seem to be running into the problem that the install scripts detects the local IP of the instance and not the external IP. Is there some way to pass the IP address the script should use?

See below for the input and resulting output:

Checking my IP:

ubuntu@ip-172-31-YY-YYY:~$ wget -qO- http://169.254.169.254/latest/meta-data/public-ipv4 && echo
18.156.XX.XXX
ubuntu@ip-172-31-YY-YYY:~$ dig +short bbb.domain.nl
18.156.XX.XXX

Runnig the install script

root@ip-172-31-YY-YYY:~# wget -qO- https://ubuntu.bigbluebutton.org/bbb-install.sh | bash -s -- -v xenial-220 -s bbb.domain.nl -e [email protected] -g
--2020-03-24 13:42:38--  https://ubuntu.bigbluebutton.org/repo/bigbluebutton.asc
Resolving ubuntu.bigbluebutton.org (ubuntu.bigbluebutton.org)... 167.99.180.121
Connecting to ubuntu.bigbluebutton.org (ubuntu.bigbluebutton.org)|167.99.180.121|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3112 (3.0K) [application/octet-stream]
Saving to: 'STDOUT'

-                                              100%[=================================================================================================>]   3.04K  --.-KB/s    in 0s      

2020-03-24 13:42:39 (1004 MB/s) - written to stdout [3112/3112]

OK
bash: line 386:  2217 Terminated              nc -l -p 443 > /dev/null 2>&1
bbb-install: DNS lookup for bbb.domain.nl resolved to 18.156.XX.XXX but didn't match local 172.31.YY.YYY.

djvanderlaan avatar Mar 24 '20 13:03 djvanderlaan

I have the same problem.

johannes-titz avatar Mar 24 '20 14:03 johannes-titz

Ok. I found the problem. I used a security group that restricted access to the server from a limited set of IP addresses. The install scripts correctly identifies the external IP (lines 396-400). In line 426 it checkes if the external IP reaches the internal IP ifso it sets the ip of the server to the external IP. In my case this fails because of the restrictions of the security group: the server cannot reach itself through the external IP.

You can set the IP it should use by setting an environment variable IP before calling the installation script. However, I then still ran into problems with getting the certificate as the server is not reachable from the outside.

So, I now use a more open security group (I guess I can still close it down after installation).

djvanderlaan avatar Mar 25 '20 08:03 djvanderlaan

@djvanderlaan Interesting. So what exactly are your settings for the security group? In this video: https://www.youtube.com/watch?v=-E9WIrH_yTs&feature=youtu.be the settings look quite normal to me. They are basically what the manual says.

johannes-titz avatar Mar 25 '20 08:03 johannes-titz

The ones that I used that didn't work were:

Screenshot from 2020-03-25 09-29-57

The ones I use now are:

Screenshot from 2020-03-25 09-29-20

Screenshot from 2020-03-25 09-28-57

djvanderlaan avatar Mar 25 '20 08:03 djvanderlaan

@djvanderlaan Thank you! Unfortunately it still does not work for me. Setting the environment variable IP also does not help.

johannes-titz avatar Mar 25 '20 08:03 johannes-titz

I couldn't fix it, but it works on google cloud platform, so I'll go with this.

By the way testing the ports via netcat worked. All ports that are listed in the install description of BBB are open. It would be nice if the install video for EC2 would include all steps (e.g. also setting up the firewall via security groups).

johannes-titz avatar Mar 25 '20 15:03 johannes-titz