I had firewalld rules that opened a port, but the port was still closed.
I changed up the order of my rules and it started working- dont understand why.
This is what I had before:
cat /etc/firewalld/direct.xml
<?xml version="1.0" encoding="utf-8"?>
<direct>
<rule priority="50" table="filter" ipv="ipv4" chain="INPUT">-p ipv4-icmp -m comment --comment ipv4_icmp -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv6" chain="INPUT">-p ipv6-icmp -m comment --comment ipv6_icmp -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv4" chain="INPUT">-p tcp -m tcp -m multiport --dports 22 -m comment --comment 'Allow SSH' -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv6" chain="INPUT">-p tcp -m tcp -m multiport --dports 22 -m comment --comment 'Allow SSH' -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv4" chain="INPUT">-m state --state RELATED,ESTABLISHED -m comment --comment established -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv6" chain="INPUT">-m state --state RELATED,ESTABLISHED -m comment --comment established -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv4" chain="INPUT">-p tcp -m tcp -m multiport --dports 5000:5200 -m comment --comment 'my app' -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv6" chain="INPUT">-p tcp -m tcp -m multiport --dports 5000:5200 -m comment --comment 'my app' -j ACCEPT</rule>
</direct>
Now ports 5000-5200 were not open and I could not access them
Then I changed the order to this and it started working:
cat /etc/firewalld/direct.xml
<?xml version="1.0" encoding="utf-8"?>
<direct>
<rule priority="50" table="filter" ipv="ipv4" chain="INPUT">-p tcp -m tcp -m multiport --dports 5000:5200 -m comment --comment 'my app' -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv6" chain="INPUT">-p tcp -m tcp -m multiport --dports 5000:5200 -m comment --comment 'my app' -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv4" chain="INPUT">-p ipv4-icmp -m comment --comment ipv4_icmp -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv6" chain="INPUT">-p ipv6-icmp -m comment --comment ipv6_icmp -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv4" chain="INPUT">-p tcp -m tcp -m multiport --dports 22 -m comment --comment 'Allow SSH' -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv6" chain="INPUT">-p tcp -m tcp -m multiport --dports 22 -m comment --comment 'Allow SSH' -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv4" chain="INPUT">-m state --state RELATED,ESTABLISHED -m comment --comment established -j ACCEPT</rule>
<rule priority="50" table="filter" ipv="ipv6" chain="INPUT">-m state --state RELATED,ESTABLISHED -m comment --comment established -j ACCEPT</rule>
</direct>
Why it do dat?