F
F
fman22016-04-04 12:35:50
MySQL
fman2, 2016-04-04 12:35:50

How to restrict access to mysql through iptables in Debian?

Good afternoon, actually the question is in the question :)
in my.cnf set bind-address=0.0.0.0
to MySQL you need to connect from two IP addresses, the question is how to skip them, and block everything else that knocks on 3306?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2016-04-04
@fman2

# iptables -A INPUT -s первый_ip/32 -p tcp -m tcp --dport 3306 -j ACCEPT
# iptables -A INPUT -s второй_ip/32 -p tcp -m tcp --dport 3306 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp --dport 3306 -j DROP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question