Jul24

Written by:David Aldridge
7/24/2015 11:26 AM 

I had been trying to forward port 7706 to port 3306 locally to make mysql respond on two ports.
In linux this would be done with iptables, and as it turns out its almost simpler to do in Windows.

This requires ipv6 to be installed to work (it is part of that library), but that has been true of windows for a while.

To create a port forward:
netsh interface portproxy add v4tov4 listenport=7706 connectport=3306 connectaddress=1.1.1.1

Replacing 1.1.1.1 with a valid IP address on your machine.  I could not get 127.0.0.1 to work with this for some reason, it had to be a real ip.

To view the forwards you have set up:
netsh interface portproxy show all

To remove:
netsh interface portproxy delete v4tov4 listenport=7706
netsh interface portproxy reset

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment  Cancel 
You must be logged in and have permission to create or edit a blog.