FreePBX not keeping static IP address when running on an AWS EC2 instance

configuration
Tags: #<Tag:0x00007fb47cb67348>

#1

I have installed freePBX on an AWS EC2 instance. I try to assign a static IP address but it keeps reverting back to the private IP address assigned by EC2.


#2

An EC2 instance cannot have a public IP address. AWS forwards traffic received on the public IP through a firewall to the instance private IP. Set the firewall to allow the desired ports.

In Asterisk SIP Settings, set External Address to the public IP and Asterisk will put that in SIP and SDP as needed.


#3

I am talking about the elastic IP assigned to the instance


#4

Can you be more specific (something you see on the console, something that ifconfig shows, etc.)?

When it has ‘reverted back’, can you get to a root shell prompt on the instance?
If so, can you ping 8.8.8.8 ?
Can you ping google.com ?
Does
curl checkip.dyndns.org
show a private address, the assigned public address, a different public address, or get an error?


#5

How can I put a screenshot here?


#6

Drag / drop the image onto the compose window, or click the upload button.


#7


#8

When I change the static IP, the network settings are not changed.


#9

Why do you want to change it? Since you can access the GUI from your phone, it must have a valid private address (that AWS assigned to it) that it obtained by DHCP. Also, AWS must be correctly forwarding the public address you are using to the instance; otherwise the web interface wouldn’t work.

In Asterisk SIP settings, set External Address and Local networks correctly. The Detect Network Settings will likely do this for you. Then Submit, Apply Config, and restart Asterisk. You also need to set up the AWS firewall to pass desired SIP and RTP traffic, as well as the FreePBX firewall (if you have enabled it).

Do you have access to a Windows, Mac or Linux desktop or laptop? If so, you will find that much more convenient than your phone for working with the command line.


#10

I’m only using the phone when writing in this forum.

The freePBX wiki said to change it but you’re right, can access the GUI with the elastic ID I assigned to the instance.


#11

Assume that the network is working properly and continue with the rest of your setup.


#12

Where can I see a security group that is set up for FreePBX or can I bypass the security group and just use the freePBX responsive firewall


#13

I recommend using both. Enable SIP and RTP in the security group, and if needed UCP, provisioning, etc. Then use FreePBX firewall to finely control access.


(Itzik) #14

Unrelated. Your PBX seems to be very outdated.