rustdesk-server icon indicating copy to clipboard operation
rustdesk-server copied to clipboard

Why I cannot connect successfully via my synology docker hbbs/hbbr?

Open goodluck1982 opened this issue 2 years ago • 25 comments

I use the synology docker version. I try to connect from win10 at home to remote linux (ubuntu 20.04) at office. Both sides use the latest rustdesk 1.1.9. When I use the default server, I can connect. But using my self-server , I cannot connect. The IP of synology at home is 192.168.0.110, and win10 is 192.168.0.109 I have a public network IP, say A.B.C.D which can connect to home via it. I made nat to synology (192.168.0.110) for ports 21115, 21116, and 21117 I set the "ID server" at win10 rustdesk as 192.168.0.110 I set the "ID server" at remote linux rustdesk as A.B.C.D The docker command for hbbs is: hbbs -r 192.168.0.110 The docker command for hbbr is just: hbbr Both win10 and linux sides should have reached the server because the logs of hbbs and hbbr have the following clues

image However, when I connect from win10 to linux, it fails.

goodluck1982 avatar May 23 '22 10:05 goodluck1982

You'd better ask in the discord, many users have succeeded, maybe some one can help you there. But you have to type English.

rustdesk avatar May 23 '22 10:05 rustdesk

image image image

rustdesk avatar May 24 '22 03:05 rustdesk

I think I have the same problem. My provider gateway/box, doesn't do proper loopback, so every time I try to connect from/to something on the same network as my rustdesk server it doesn't work. Every computer outside of the rustdesk server works without any problems.

Teryon avatar May 26 '22 09:05 Teryon

I will put a fix for this scenario, but I have no solution for now.

rustdesk avatar May 26 '22 14:05 rustdesk

I will put a fix for this scenario.

Great! Expecting.

goodluck1982 avatar May 26 '22 14:05 goodluck1982

@goodluck1982 what ip address does hbbs see for the connection from office?

rustdesk avatar May 27 '22 04:05 rustdesk

@goodluck1982 what ip address does hbbs see for the connection from office?

114.246.202.99

goodluck1982 avatar May 27 '22 04:05 goodluck1982

I have no problem using it, happy...

youhers avatar May 27 '22 13:05 youhers

nice

dengyunsheng250 avatar Jun 06 '22 13:06 dengyunsheng250

安装设置后提示 ID不存在 image

txunda avatar Jun 11 '22 09:06 txunda

Would like to see a solution to this.

phoenixwarrior95 avatar Jun 13 '22 00:06 phoenixwarrior95

Sadly, my router does not have this problem. I am ok to access my PC at home (hbbs runs on the same machine) from my phone with 4G (wifi turned off).

rustdesk avatar Jul 14 '22 08:07 rustdesk

I will put a fix for this scenario, but I have no solution for now.

I think a good solution for this scenario is using DNS instead of IP addresses. Let me explain.

Suppose you own the mydomain.com domain; you add a DNS record rustdesk.mydomain.com pointing to the external IP address of your home. So from the point of view of an external viewer, everything works by using rustdesk.mydomain.com as "ID server".

This doesn't work from inside your home because your router doesn't support "hairpin nat": your application (via a DNS request) resolves that rustdesk.mydomain.com is your external ip address and tries to use that address to access the rustdesk server, but the router doesn't allow that.

So you circumvent that by "faking" the DNS. You need a DNS server inside your network (like pi-hole or the one that comes with your Synology). You have to configure the DNS to forward all the queries to external DNS (google 8.8.8.8, quad9 9.9.9.9, cloudflare 1.1.1.1) and you have to add an override just for one host rustdesk.mydomain.com which should return the internal IP address of your NAS (hosting rustdesk). Remember to update DHCP configuration: the DHCP server should send the IP address of this DNS server to all (interested) clients.

paspo avatar Jul 14 '22 10:07 paspo

There's always the chance that your router has a config option somewhere to enable NAT reflection or to add a NAT rule specific for the LAN traffic.

What's your router brand/model ?

paspo avatar Jul 14 '22 10:07 paspo

Closed because of no response.

rustdesk avatar Jul 27 '22 07:07 rustdesk

I will put a fix for this scenario, but I have no solution for now.

I have this issue as well. What is the tracking number for the feature request?

ll3N1GmAll avatar Aug 01 '22 06:08 ll3N1GmAll

so far from my investigation, it is not a problem which we can solve from our software side. it is more related to your router. my router does not have this issue.

rustdesk avatar Aug 01 '22 06:08 rustdesk

If the software allowed the input of 2 servers in the ID and relay fields, this could resolve the issue. Both the internal and external addresses could be input and the software could then try both. As long as one matches, then the connection could go through. It appears to fail if the server address in the fields dont match between the 2 clients connecting to each other. Even if all networking configurations are correct. It appears to simply an issue of the software seeing client 1 having a relay address of A and client 2 having a relay server address of B. Even if A and B are the exact same server and both clients can reach the server. This indicates a logical processing issue in the way the software checks the connection. This multiple server option could also enable multi-site load balancing for those with the desire and infrastructure to do so.

ll3N1GmAll avatar Aug 01 '22 21:08 ll3N1GmAll

https://en.wikipedia.org/wiki/Network_address_translation#NAT_hairpinning

https://discord.com/channels/804630702657110016/804630702657110018/1012390993544351844 image

rustdesk avatar Sep 01 '22 09:09 rustdesk

I had the same situation, but it was resolved.Stated below:

LAN:home computer windows 10(ip is ...10/24),rustdesk server(in debian docker, use the host mode)(ip is ...20/24) WAN: I have public IP and did ddns for abc.com route:I made NAT to ..*.20 for ports 21115, 21116(TCP/UDP), and 21117 clients:Laptop at office and android mobile( wtih 4G ) ps: There is a VPN between the home router and work computers

first, I set the "ID server" at ...10 rustdesk as ...20 . I set the "ID server" at laptop rustdesk as abc.com as same as android mobile. The results: The mobile phone can connect to the laptop, but not to the home computer, and the home computer can not connect to the laptop. They all work when I use a vpn. So I confirm that the problem is in the rustdesk setting of the home computer or the NAT problem of the home computer.

When laptop could not connect to the home computer , the rustdesk client told me that can not connect relay server. But mobile can connect to laptop with 4G , indicating that there is no problem that the relay serves for the public network. In https://rustdesk.com/docs/en/self-host/install/ Enter the hbbs host or IP Address in the ID Server input box (local side + remote side). The other two addresses can be left blank, RustDesk will automatically deduce (if not specially set), and the Relay Server refers to hbbr (port 21116).

I think when I set "ID server" at rustdesk as ...20 at home computer , rustdesk autoset the relay server as ...20 .Therefore, there is a problem in this area. The relay server obtains the IP address of the home computer as a lan address, but the controller has a public IP address. There should be a problem in forwarding the data stream. So I manually filled in relay server as abc.com on my home computer, and the result was very good. The phone could connext to the laptop and the home computer, the laptop and the home computer could also connect to each other without using VPN.

When client and server on the same LAN,this client should be filled "server LANip" or ddns url (or public ip ) to ID server and must the ddns url (or public ip ) for relay server

bluestar800 avatar Oct 10 '22 10:10 bluestar800

On a QNAP Docker installation enviroment I was having the same issue but:

So I manually filled in relay server as abc.com on my home computer, and the result was very good

This fixes it.

So once I filled the Relay Server on my LAN computers, they begun to be acessible from outside.

Thanks to [bluestar800] for this fix.

pedroa75 avatar Nov 18 '22 11:11 pedroa75

Which load balancer is used for self hoted Rustdesk in ubuntu 20.04 os

sivayakkati avatar May 03 '23 12:05 sivayakkati

Which load balancer is used for self hoted Rustdesk in ubuntu 20.04 os

if you're self-hosting, you should know that there's no load balancing for hbbs, but you can have multiple hbbr

paspo avatar May 03 '23 12:05 paspo

Can you please send me the related doc for attaching a load balancer for self-hosted Rustdesk

sivayakkati avatar May 03 '23 12:05 sivayakkati

Here is the doc:

There's no way to load-balance for hbbs process or hbbr process.

When there's a connection request from a client to hbbs, this uses a list of hbbr instances for a reply. Usually only a single hbbr instance is needed, you can scale in future if the load is too high.

paspo avatar May 03 '23 12:05 paspo