Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
Why do you think you need to do this on the INPUT chain (filter table)? – Zoredache Aug 12 '09 at 0:51
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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