I would like to know how to block an IP to use smtp service on a server with centos 7 firewall . I try to use something like this :
firewall-cmd --permanent --zone="public" --add-rich-rule='rule family=ipv4 source address=[ipadress] --remove-service=smtp'
but is not the right syntax
Or should I block the TCP ports 25, 465 and 587?
also if anyone could tell me how to automatically do this getting de ip from a file (if possible) would be great
The correct syntax, as described in the
firewalld.richlanguage(5)
manpage, is:Note that this applies to incoming traffic to port 25/tcp, as described in the service file
/usr/lib/firewalld/services/smtp.xml
: