How to redirect from one local port to another local port in OS X?

I have a MySQL instance running locally on port 3306, but for some legacy applications I also want to make it available on port 3305 (don't ask). Is there an easy way to do this on OS X, so if I try to connect to 3305 or 3306, will they both go to MySQL server on 3306?

+3
source share
1 answer

You can use ipfw to configure the forwarding rule for port 3305 to send it to port 3306.

ipfw add fwd localhost,3306 tcp from any to any 3305 via en0 

My syntax may be turned off a bit, and you may have to change it to the actual IP address or add a second rule for it.

+5
source

All Articles