Remote Desktop Connection between PCs -- Must they both be in the same Subnet?

Click For Summary

Discussion Overview

The discussion revolves around the requirements and methods for establishing Remote Desktop Protocol (RDP) connections between PCs, particularly whether both devices must be on the same subnet or LAN. It also touches on alternative remote connection tools and issues related to accessing SQL Server.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Exploratory

Main Points Raised

  • Some participants suggest that RDP connections require both computers to be on the same network, questioning how a connection can be established with just a computer name.
  • Others propose that there are workarounds for connecting remotely, such as using port forwarding or VPNs, although concerns about security are raised regarding port forwarding.
  • One participant expresses a preference for Teamviewer over RDP due to its ease of setup, especially when devices are not on the same network.
  • There is a discussion about accessing SQL Server via named pipes, with some participants clarifying that named pipes are typically used for local connections only.
  • Participants discuss the challenges of connecting to SQL Server from the command line, with one noting an error message related to named pipes.
  • Some participants suggest using Azure for SQL Server access as an alternative to local setups.
  • There is a mention of using client certificates for VPN setups to enhance security.

Areas of Agreement / Disagreement

Participants do not reach a consensus on whether RDP connections require both devices to be on the same subnet, as some assert it is necessary while others provide alternative methods. The discussion about SQL Server access also remains unresolved, with differing views on the appropriate connection methods.

Contextual Notes

Participants express uncertainty regarding the specifics of their setups, such as whether they are using local or virtual machines, and the implications this has for connection methods. There are also mentions of potential security risks associated with different remote access methods.

WWGD
Science Advisor
Homework Helper
Messages
7,804
Reaction score
13,111
TL;DR
Trying to connect desktop-desktop or device-device remotely.
Hi, just looking at RDP connections
https://support.microsoft.com/en-us/help/4028379/windows-10-how-to-use-remote-desktop

It would seem the two devices would have to be within the same LAN, right? Otherwise, how is just the computer name enough information to set up a connection? It seems for a connection string we would need to know more details than just the name (I doubt all the needed information is encoded under the computer name)
 
Computer science news on Phys.org
  • Like
Likes   Reactions: WWGD
Wrichik Basu said:
You are right, both computers need to be on the same network. But there are some workarounds too; see this site, for example:
https://www.howtogeek.com/131961/how-to-access-windows-remote-desktop-over-the-internet/

I personally prefer Teamviewer for remote connections compared to Windows remote desktop. The former is easier to set up compared to the latter, especially when the machines are not on the same network.
Thank you, I agree and have tried it but I am following up on a list for a data job interview. Same for using Python Jupyter/Anaconda.

Would a connection string allow you to connect outside of the LAN/Subnet (EDIT: if permissions were granted)?
 
I am having some strange issues trying to access my SQL Server from within the command line; cannot use ODBC because my SQL Server is connecting through named pipes. Maybe I can go to configuration manager or Control Panel and change the protocols used.
 
Remote desktop is not the way forward here.

WWGD said:
... my SQL Server is connecting through named pipes.
This does not make sense - your SQL Server instance doesn't have to connect to anything. Do you mean you are using named pipes to connect a SQL Studio instance to your SQL Server instance?

Named pipes are only used for connecting locally i.e. on the same machine. Do you already know how to connect from another machine over the LAN? Connecting from a remote network is the same, except you need to let your router know what to let through and where to connect it to - this is called port forwarding. This is a home setup with a direct connection to the internet right? You aren't behind some corporate or other firewall?

What are you actually trying to do?
 
pbuk said:
Remote desktop is not the way forward here.This does not make sense - your SQL Server instance doesn't have to connect to anything. Do you mean you are using named pipes to connect a SQL Studio instance to your SQL Server instance?

Named pipes are only used for connecting locally i.e. on the same machine. Do you already know how to connect from another machine over the LAN? Connecting from a remote network is the same, except you need to let your router know what to let through and where to connect it to - this is called port forwarding. This is a home setup with a direct connection to the internet right? You aren't behind some corporate or other firewall?

What are you actually trying to do?
I was trying to access SQL Server from the command line within the same machine.

Error message was:
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server
 
How do you know the SQL Server instance is running?
 
WWGD said:
I was trying to access SQL Server from the command line within the same machine.
If you can't do that then the last thing you want to do is introduce other variables by trying to connect from outside the LAN.
 
  • #10
pbuk said:
How do you know the SQL Server instance is running?
I started it through MSSM.
 
  • #11
pbuk said:
If you can't do that then the last thing you want to do is introduce other variables by trying to connect from outside the LAN.
I understand, thanks, I was also trying to connect locally; all part of interview skills list. I don't have access to another computer to try remote access. Sorry for my sloppy way of doing things; seems confusing to all but me :).
 
  • #12
WWGD said:
I started it through MSSM.
What is shown in the Named Pipes Properties dialog box in MSSM SSMS?

Edit: and what connection string are you using:
Code:
\\.\pipe\sql\query
?
 
  • Like
Likes   Reactions: WWGD
  • #13
pbuk said:
If you can't do that then the last thing you want to do is introduce other variables by trying to connect from outside the LAN.
I understand, thanks, I was also trying to connect locally; all part of interview skills list. I don't have access to another computer to try remote access.
The network protocol is set to <default> and options are not enabled:

1579225147558.png
 
  • #14
Hmmm, dunno, sorry :frown:

If you just want to play with a SQL Server instance you could open an Azure account?
 
  • #15
pbuk said:
Hmmm, dunno, sorry :frown:

If you just want to play with a SQL Server instance you could open an Azure account?
Hey, nothing to be sorry about; I've learned more from you in a few weeks than in years. Seriously, thanks so much. Will check out Azure.
 
  • #17
rbelli1 said:
Use the VPN option in that link. If you use the port forwarding option you will very quickly be hacked.

BoB
True but , it takes $$$ for quality VPN last I checked.
 
Last edited:
  • #18
WWGD said:
True but , it takes $$$$ for quality VPN last I checked.
Lol. . . what went wrong with your post ?

It should look like this. . . . 🤔

1579246059993.png


.
 
  • #19
OCR said:
Lol. . . what went wrong with your post ?

It should look like this. . . . 🤔

View attachment 255701

.
No clue. Did you guess it or how else you figured?
 
  • #20
WWGD said:
Did you guess it or how else you figured?
Refresh the page and watch. . . 😉

.
 
  • Like
Likes   Reactions: WWGD
  • #21
OCR said:
Lol. . . what went wrong with your post ?

It should look like this. . . . 🤔

View attachment 255701

.
$$ is the delimiter for a ## \LaTeX ## block so $$$$ is parsed as an empty block of ## \LaTeX ##. Use $$$ which stays as $$$.
 
  • Like
Likes   Reactions: WWGD
  • #22
Thanks, got it, but fittingly not a single $ appeared ;).
 
  • Like
Likes   Reactions: pbuk
  • #23
pbuk said:
Use $$$ which stays as $$$.
Unless $$$ you use it twice $$$ of course! Unless $$$ you use it twice $$$ of course!
 
  • Like
Likes   Reactions: WWGD
  • #24
rbelli1 said:
Use the VPN option in that link. If you use the port forwarding option you will very quickly be hacked.

BoB
How about portforwarding to a VM?
 
  • #25
WWGD said:
True but , it takes $$$ for quality VPN last I checked.

I was thinking that you could set up a VPN on your firewall. Use client certificates for the best security.

BoB
 
  • #26
rbelli1 said:
I was thinking that you could set up a VPN on your firewall. Use client certificates for the best security.

BoB
Aren't quality VPNs expensive?
 
  • #27
WWGD said:
Aren't quality VPNs expensive?
pbuk said:
Unless you use it twice of course!
Only if you use it twice. . . . 😛 .
Lol. . . . 🤦‍♂️

.
 
  • #28
OCR said:
Only if you use it twice. . . . 😛 .
Lol. . . . 🤦‍♂️

.
Actually, any odd numbers will do. I will print dollars signs 1,2,3,4,5,6. Let's see which show up:
1)$
2)$$
3)$$$
4)$$$$
5)$$$$$
 
  • #29
WWGD said:
How about portforwarding to a VM?
If you can't even access it on the same machine/VM then how are you going to access it remotely? Just to check a couple of things, you are running this console in the same OS instance as the SQL Server, yes? Or are you running the console on a host and the SQL Server instance in a VM - in which case local named pipes won't work? Have you tried accessing via a port i.e. localhost:1433?

Also, I can't see the important setting in the screenshot below:
WWGD said:
... the crucial setting is in the 'Server Properties' dialog box hidden under the 'Connection Properties' box. If you select 'Connections' it should show a list including 'Named Pipes: Enabled', and 'TCP/IP: Enabled' if you want to access via a port (i.e. localhost:1433).
 
  • #30
In other words, try all of the following in a console on whatever OS instance is running SQL Server.
Code:
sqlcmd
sqlcmd –S tcp:127.0.0.1,1433
sqlcmd –S np:\\127.0.0.1\pipe\sql\query
 

Similar threads

Replies
13
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
21K
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
5
Views
3K
Replies
10
Views
5K
  • · Replies 19 ·
Replies
19
Views
15K