Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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

share|improve this answer
    
The detailed answer was here sqlteam.com/forums/topic.asp?TOPIC_ID=146274 but you pointed me in right direction. Thank you! –  Tomas Mar 13 '12 at 7:55
    
You are most welcome... –  MikeAWood Mar 26 '12 at 22:18

This isn't port forwarding. When you specify remote port in a firewall rule, it is the source port from the client's workstation.
If you want a service to listen on a different port, reconfigure the service to do so.

share|improve this answer
    
The 1433 port is already taken by another instance of MSSQL Server(MyIp1:1433) and now I want to host second MSSQL Server(MyIp2:1434) instance on 1434 but let it access from outside using 1433 port. –  Tomas Mar 12 '12 at 19:40

Your Answer

 
discard

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.