I've got a mySQL machine I need to establish a remote connection to. The problem is that the outbound connection machine is on a network which blocks port 3306 outgoing, and the mySQL process is shared with other applications/developers.

My current thinking is to use iptables wizardry to get it to change ports as its listening on them. I've found

I've found iptables commands which work on a NAT-based level e.g.

iptables -A PREROUTING -t nat -p tcp --dport 8080 -j REDIRECT --to-port 3306

I'm having a hard time finding an appropriate iptables target which works on INPUT

  • Why do you think you need to do this on the INPUT chain (filter table)? – Zoredache Aug 12 '09 at 0:51

Ummm... You already have the answer there :-)

If thats not working, maybe you are blocking those ports on the INPUT chain. You need to add accept rules for those as well (both 8080 and 3306 I think). The PREROUTING chain is before the INPUT chain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.