I am fairly new to firewalld. I want my port 27017 to be accessed only from two public ip addresses. I have added it to the ports on the public zone and added a rich rule for each of the two ip addresses. Still, i can access the ports from any IP. I have tried reloading, restarting, and also running --permanent-to-config.

Maybe related, but when i run --get-active-zones it is empty. But --get-default-zone returns public.

Here is the output of firewall-cmd --zone=public --list-all

public
  target: default
  icmp-block-inversion: no
  interfaces:
  sources:
  services: dhcpv6-client http https smtp ssh
  ports:  27017/tcp 4000/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
        rule family="ipv4" source address="xxx.xxx.xxx.xxx" port port="27017" protocol="tcp" accept
        rule family="ipv4" source address="xxx.xxx.xxx.xxx" port port="27017" protocol="tcp" accept

I am expecting my mongodb port to be accessed from only two public ips on the outside. I want to restrict the rest

0

There are 0 answers