I built an AMI (RedHat Linux) using Amazon's EC2 Image Builder service. I created a EC2 instance using this AMI, and found that there are certain firewall rules set (ran the following command iptables -nL
). Unfortunately, I was not able to find the configuration for setting these rules. Here are a couple of commands I ran to check for the configuration:
systemctl status iptables
- iptables config is not locatedsystemctl status firewalld
- returns a status ofinactive
for firewalld
I am not able to communicate with this instance from outside, though there is a public ip available. Any suggestions on how to disable these set rules? I tried disabling them using - systemctl stop firewalld
, systemctl disable firewalld
, but since the status of firewalld is inactive, the rules still existed.
Another approach I tried was creating a component in my AMI which flushes the rules in iptables:
iptables -F INPUT
iptables -F FORWARD
iptables -F OUTPUT
The AMI was created successfully, but the rules still existed when I launched an instance. However, other components (in which I was installing some packages) worked well.
Any suggestions on how to disable the firewall?