Thursday, January 13, 2011

Any Port? VPNs and SQL Server 2008

I’ve had problems with the VPN to my hosting server for a little while now and, thankfully, it’s all sorted.  I’ll not get into the “O2 updated their router remotely and it broke all VPNs” discussion but needless to say that I wasn’t best pleased.

Now that it’s working again I found that I couldn’t connect to the SQL Server 2008 through the VPN.  I’d not changed any rules for the firewall but any connection to the database server was failing with a network error.  SVN and MySQL would connect perfectly but for some reason SQL Server wouldn’t.

Trying to track it down was a bit of a problem but in the end I stumbled upon the problem.  Since I last connected across the VPN I’d installed a second instance of SQL Server on the hosting server and the SQL Server Browser was now running.  So as well as opening up port 1433 to connect to the default instance I had to open up port 1434 as well.  Once I’d done that it connected like a charm.

Now I’m not sure why I needed to open the extra port – the default instance of SQL Server is still saying that it’s binding to port 1433 in the logs so I’d have thought that you could connect to it without hitting port 1434.  But apparently not.

No comments: