I have a centos 7.1 and firewalld installed.
There are 4 distinct services on that server: mysqld, mongod, jabberd, httpd
I need to configure that server to allow connections to jabberd and httpd from anywhere and mysqld and mongod from 2 addresses 10.0.0.1, 10.0.0.2
At the moment the public zone is active and default, bond interface is assigned here. httpd and jabberd are there and everything is working.
I have tried creating my own zone with specific sources and mongod/mysqld. I have also tried adding that to existing "trusted"/"internal" zones. But services are not reachable in this way. The only way to reach those services is to add them to "public".
I even tried to add rich rules to that public zone to allow those services from specific addresses. Still fails.
public (default, active) interfaces: bond0 enp2s0f0 enp2s0f1 sources: services: dhcpv6-client ssh ports: 5223/tcp 80/tcp 5280/tcp 11211/tcp 3306/tcp 27017/tcp 5269/tcp 5222/tcp masquerade: no forward-ports: icmp-blocks: rich rules:
servers interfaces: sources: 127.0.0.1/32 192.168.0.5/32 192.168.0.4/32 192.168.0.6/32 services: ports: 3306/tcp 27017/tcp 11211/tcp masquerade: no forward-ports: icmp-blocks: rich rules:
If I remove 27017 or 3306 or 11211 from public they become unreachable from any of the IPs listed in "servers" zone.
– t1nkerer Jun 04 '15 at 11:47firewall-cmd --new-zone=myzone; firewall-cmd --zone=myzone --add-source=203.0.113.0/24– Michael Hampton Dec 22 '15 at 16:14