Answer the question
In order to leave comments, you need to log in
Frewalld. Problems with IP limit (mysql)?
Greetings!
It is required to make a whitelist of IPs that can connect to mysql (interact with port 3306 (mysql service)).
You can of course set up privileges on mysql itself, but I want to close connections before interacting with mysql, i.e. write rules in firewalld.
How do I do.
-
Add service:
firewall-cmd --zone=public --add-service=mysql --permanent
Then add rules:
firewall-cmd --add-rich-rule 'rule family="ipv4" source address="REMOTE_IP" service name="mysql" accept' --permanent
And reload:
firewall-cmd --reload
-
But connecting from a third-party IP is allowed via telnet:
telnet IP 3306
The connection is not immediately reset, but displayed:
Version(Set of obscure characters) mysql_native_password
I.e. firewalld did not take the required action, but skipped it.
I will be grateful for your help!
Answer the question
In order to leave comments, you need to log in
I add a service:
firewall-cmd --zone=public --add-service=mysql --permanent
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question