hdtroll
By:
hdtroll

Looking for help with firewalld configuration for restricting access to an IP

June 28, 2017 322 views
Firewall CentOS

Running CentOS 7

I'd like to make sure I understand the zones correctly and how this all functions.

My case is via firewalld to allow only a specific IP ssh access but allow the http https to go through normally

the default zone is public, so if I remove ssh access from there and all other zones, then on one zone allowing the ssh service and add the rich rules for my IP would that be the ideal setup for that and other services that I want to allow only from my IP?

Or do I have to specify the service in the rich-rule?

Also the How To Set Up a Firewall Using FirewallD on CentOS 7 tutorial referenced interfaces and I'm not seeing the eth0 eth1 as interfaces on any of the zones. (if I do remove a service from the default zone though, that access is removed) so I don't think this is a problem and just something to note.

1 Answer

Hi @hdtroll

I don't know much about FirewallD, but you need to move the ssh service to a different rule and create allowed sources on that - have a look at this:
https://serverfault.com/questions/680780/block-all-but-a-few-ips-with-firewalld#680789

Have another answer? Share your knowledge.