Another one for the Things To Remember category … after creating a new Amazon Linux 2 instance, it’s important to update firewalld to allow http & https traffic.
To do this, you need to use the firewall-cmd CLI command:
sudo firewall-cmd --zone=public --add-service=http --permanent sudo firewall-cmd --zone=public --add-service=https --permanent sudo firewall-cmd --reload
What would you need http for?
http to https redirection.
Do you know if this is still relevant as of today?
firewall-cmd doesn’t seem to be installed on Amazon Linux 2 by default, and isn’t available on in the yum package manager or in amazon-linux-extras.
It’s relavent as far as I can tell.
firewalld is availale as part of the amzn2-core repo.
But not installed by default and if you install it, it doesn’t setup the rules to block http/https.
Well, you don’t want it to setup rules by default.
When you start a firewall, it should allow all traffic except what block.