Sql-server – Connecting remotely to an SQL server inside a LAN

routersql serversql-server-2008

I am using SQL server 2008 inside my home lan. I've configured it to accept remote connections and I can now connect to the server from other pcs inside the lan.

The problems rises when I try connecting to the server from a computer outside of my home lan. I've disabled my router's firewall and I've configured a virtual server on port 1433 forwarding to the correct lan ip. What's wrong? why is it not working?

Thank you very much for your help~!

Edit:

This is the error I keep getting:

A network related or instance specific error occured while establishing connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that the SQL SERVER is configued to allow remote connections. (provider : Sql network interfaces, error: 25- Connection string is not valid)

OK these are my router's details: edimax br-6204wg I am not sure how I am supposed to browse google.com. can you be a bit more specific?

Best Answer

When you're outside of your home LAN, first make sure you can ping the address you're trying to connect to. For example, if your home internet connection's IP address is X.X.X.X, then open a command prompt and type:

PING X.X.X.X

The X's will be replaced by numbers like 50.60.70.80. If the numbers start with 192, then it's not the real external IP address of your home internet connection.

If you can ping the IP address successfully and get an answer back, then next try telnetting to the SQL Server. Open a command prompt and type:

TELNET X.X.X.X 1433

If it doesn't time out, then you should be able to connect with SSMS, but I'm betting it'll time out. Some internet providers filter 1433 because it was the source of a few viruses.

Here's another good connection troubleshooting link - it's for SQL 2000, but the same basic issues apply:

http://support.microsoft.com/kb/827422