Question

blocking mysql access for an ip I have unscrupulous incoming connections to my mysql database server and I want to block it, so I add the following line in /etc/sysconfig/iptables and restarted it

    -A INPUT -s 206.xxx.xx.xx -j DROP

but the ip connection is still able to access my mysql database server and perform queries. why? how do I effectively block it?

Was it helpful?

Solution

If your using with Firewalls (IPTABLES) Please specify the Port in which Mysql server is listening on.

The following rule will provide specific network only will be listening on Only the 192.168.100.0/24 network people can access your mysql. Here i have specified the default mysql port 3306

iptables -A INPUT -i eth0 -p tcp -s 192.168.100.0/24 --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT

To DROP IP Address

iptables -A INPUT -i eth0 -p tcp -s 206.xxx.xx.xx --dport 3306 -m state --state NEW,ESTABLISHED -j DROP
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top