I have Windows 2008 box and would like to set port forward rule in Windows Firewall for MSSQL Server.
I have created Firewall rule
Profile: Any
Enabled: Yes
Action: Allow
Program: Any
Local Address: xxx.xxx.xxx.xxx (My MSSQLServer IP address)
Remote Address: Any
Protocol: TCP
Local Port: 1434
Remote Port: 1433
and I can't connect to xxx.xxx.xxx.xxx, 1433
using MSSQL Management Studio
but if I leave remote port Any then I can connect to xxx.xxx.xxx.xxx, 1434
using 1434
Port.
Profile: Any
Enabled: Yes
Action: Allow
Program: Any
Local Address: xxx.xxx.xxx.xxx (My MSSQLServer IP address)
Remote Address: Any
Protocol: TCP
Local Port: 1434
Remote Port: Any
Why port forwarding is not working in my case?
Best Answer
Windows firewall isn't capable of doing what you are asking.
The firewall rule you added basicall tells the firewall to listen on port 1434 with a remote client using the port 1433. Typically you wouldn't use both in and out port specifications (generally).
You are really looking for RRAS to do NAT instead. You will need to enable the "Network Policy and Access Services" role and go through the process of setting a NAT rule to listen inbound on port 1433 and redirect it to port 1434 on the network adapter that you are using to talk to that SQL instance.
Though typically you can have more than one instance run under the same port. So you might need to see why your SQL install is listening on two ports instead of one. It should allow you to use the same port for both instances on the same box. Maybe start here and do a bit of reading. You probably don't need the NAT at all. http://support.microsoft.com/kb/823938