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've recently found myself in the position of quickly deploying a production app on SQL Server 2008 (EXPRESS), and I've been having some issues with configuring firewall rules between our web server running the ASP.NET app and our database server.

Everything that I can find on the internet claims that I should only need to have TCP ports 1433/1434 and UDP port 1434 accessible on the database server. However, we were unable to get connectivity going between the web app and the database with just those ports. With the help of one of the guys in our datacentre, we discovered that there was traffic also going to TCP port 2242 on the database server. After opening this port, everything worked, but we're not sure why.

Later on, I had to reinstall SQL Server due to some disk space issues, and found that the problem had resurfaced - after another session with the packet sniffer, we discovered that this time traffic was going to TCP port 4541 on the database server. My question is, is there some configuration option that I'm missing in SQL server that's making it choose random ports? I'd like to have our firewall rules locked down as much as possible, and of course we'd like to avoid any future mysterious connectivity issues, especially once the app is live.

Both servers are running Windows 2003 R2 X64.

share|improve this question

3 Answers 3

To answer my own question, it seems that by default SQL Server might use port 1433, but on my setup it was set to use dynamic ports. This article explains how to configure a fixed port:

http://msdn.microsoft.com/en-us/library/ms345327%28v=SQL.100%29.aspx

share|improve this answer
    
Express always uses dynamic ports by default. Having 1434 open will let you get to it, but not if the dynamic port number is blocked. If you want it on 1433 follow those steps in that link with that port number. If you have more than one isntance you will need ports for those too. –  Bratch May 16 '10 at 3:11

Well, by default the listener on port 1433 is disabled. You need to enable the 1433 listener before anything will work. Also, if you're using the "sa" account, i think that account is disabled by default. You basically only need the 1433 port to be open on TCP. Unless you're doing something different, you dont need to open the 1434 udp port through the firewall.

share|improve this answer
    
When you say "enable the 1433 listener" are you referring to just enabling the TCP/IP protocol? Because I did that. I was still having troubles with the server using dynamic ports afterwards. Thanks for the tip on the 1434 UDP port though. –  mmacaulay Apr 9 '10 at 16:51

A quick way to check what port SQL Server is running on is to check in the SQL Server error log. There is a line that says SQL Server is listening on .... Is this instance default or a named instance? SQL installs default instance with 1433/1434 for default and every consecutive instance with dynamic ports.

share|improve this answer

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.