linux - MySQL on two ports using IPTables - self-access -
i'm trying make mysql available 2 ports: 3306 , 3339 added rule iptables:
iptables -t nat -a prerouting -i bond0 -p tcp --dport 3339 -j redirect --to-port 3306
and everythin great remote connections. if i'm trying connect locally, i'm getting error:
mysql -u username -ppassword --port=3339 -h host.name error 2003 (hy000): can't connect mysql server on 'host.name' (111)
any ideas how can edit iptables local access via 3339 port?
since prerouting isn't used loopback interface have add 1 more rule:
iptables -t nat -i output -p tcp -o lo --dport 3339 -j redirect --to-ports 3306
Comments
Post a Comment