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

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.

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.

1 Like

I am talking about the elastic IP assigned to the instance

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 ?
Can you ping ?
show a private address, the assigned public address, a different public address, or get an error?

How can I put a screenshot here?

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

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

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.

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.

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

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

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.

Unrelated. Your PBX seems to be very outdated.