Network connect to a local IP address from a static global IP address?

Posted on

Question :

Is there a possible way to connect to a local SQL server on a static global IP?

Let me elaborate.

Assume that there is a server with a static global IP of 12.345.678.90 which refers to a certain windows based PC which in turn hosts a Microsoft SQL Server. Said server can be accessed remotely.

The issue is the need to connect to another SQL server hosted on another PC on the same network with a “static local IP” of

Is there a way to connect to that server using a similar syntax to 12.345.678.90/

Answer :

Just tell the router that any connection on port 12345 of 12.345.678.90 should be sent to and the port number on which the other SQL server is listening.
Anyone on the outside wanting to connect to the other SQL server should connect to 12.345.678.90:12345.

You can’t connect directly to other server, unless you change your network configuration.
Still you can access the data on local server using your server visible from internet. To do this you can create a database link between these two servers (assuming that network configuration will allow to connect from public server to local server).
It will be different than directly logging to other server, but it can provide you access to all data on local server.
In this scenario you will connect to server with public IP and then you will be able to run queries using 4 part name, like:

SELECT * FROM LocalServerLinkName.dbName.schema.table

Leave a Reply

Your email address will not be published. Required fields are marked *