Search code examples
sql-serverweb-hostingwhitelist

sql whitelisting not working when connected to a university intranet


I have been having troubles to establish database connection using the MS SQL Management Studio. It was working fine when I was using a local internet service provider. However, when I began to use the university internet, I am not able to connect to the db, although I sql-whitelist the ip. I have no ideas how to manage this issue. I have to connect to the db to manage it, but I am receiving "A network-related or instance-specific error occurred while establishing a connection to SQL Server..." Do you have any idea? Is this something that my hosting company should figure out?

Thanks!


Solution

  • There is a reasonably good chance you are being blocked by a firewall at the university. They probably block/allow based on IP. Universities should not allow all IP's in the University net to have access by default.

    You may have had a firewall exception for the old address. You can check if port is blocked by using the telnet command from any windows client command line.

    telnet 127.0.0.1 1433 -- substitute your sql server ip address or name

    telnet 127.0.0.1 22334 -- no reason for the this port to be open

    This is what a blocked port looks like

    C:\>telnet localhost 22334
    Connecting To localhost...Could not open connection to the host, on port 22334:
    Connect failed
    
    C:\>
    

    If 1433 is open and associate with ms-sql you get a different behavior (although it is pretty odd) -- you may have to close the command prompt or kill the telnet process. In any case, this confirms the port is open or closed. If port is open and you can't connect, you have a connection string problem or something obscure.