mysql listening server on two but not more IPs

I want my mysql server to listen on two IPs but not more. I got multiple IPs on server...

I want my mysql server to listen on 127.0.0.1 and 55.55.55.55 so I start mysqld with --bind-address=127.0.0.1

unfortunetly you cant specify second IP. So I was thinking to make iptables rule to route traffic from 3306 port 55.55.55.55 to 3306 on 127.0.0.1 where mysql server is running. sounds easy

iptables -A INPUT -i eth0 -s 0/0 -d 55.55.55.55 -p tcp --dport 3306 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d 55.55.55.55 --dport 3306 -j DNAT --to-destination 127.0.0.1:3306

however its not working. Any sugestions how to acomplish the task?

 

 

 

 

Top