rustdesk / rustdesk-server

RustDesk Server Program
https://rustdesk.com/server
GNU Affero General Public License v3.0
6.46k stars 1.35k forks source link

No connection from outside of our LAN #200

Closed Banane6077 closed 1 year ago

Banane6077 commented 1 year ago

Hello i want to deploy a Ubuntu Server with rustdesk!

I ran the script which was given by https://rustdesk.com/docs/en/self-host/install/ and it works in our LAN but not from outside.

I made a NAT with our the public IP to the intern IP.

I opened the ports:

tcp 21115-21119; 80; 8000 and 443

udp: 21116-21119

and made a subdomain which is directing to the right IP.

I tested it already with my phone and i am able to connect to the apache webserver but not with the RustDesk Server in my client.

We have a Watchguard Firewall and i am not seeing anything blocked by the Firewall, at least with the IP's i am trying to connect with the RustDesk Client.

Can you help me?

Is there anything on my Ubuntu Server that could block the connection from outside or do i miss to install since i only installed by the given script?

Alexybg commented 1 year ago

Same problem. Working only LAN or only Outside. Can't connect both . image

rustdesk commented 1 year ago

https://github.com/rustdesk/rustdesk/wiki/FAQ#deploy-rustdesk-server-in-intranet

bartowl commented 1 year ago

I found a dns-based solution and this took a bit for me to understand how the relay mechanism works. In short - when configuring relay on host A - this host connects to server and tells the server that whoever wants to connect to it may go via "relay-exactly-as-given-by-host-A".

If this is a DNS name, and host-B is in the same network as the server (LAN) this host name has to resolve to the local IP of the relay. Then you will not need any hairpin-nat solution. When host-B is on internet, then it has to resolve to the public IP of the relay. And the only place where the setting is relevant is on the side we want connect to (here host-B -> host-A). It is also the same case in the other way, so the best have a DNS domain, that locally resolves to the local IP and remotely to the public and use this hostname (not IP) on both sides as relay setting. This will work like a treat.

Alexybg commented 1 year ago

@bartowl Thanks

I use mikrotik with RustDesk Docker on it. In my case with the DNS name of mikrotik public IP work great without hairpin-nat solution. Just with nat rediction to 172.20.0.91 ( veth91 interface ).

Many thanks for simple and working idea.

rustdesk commented 1 year ago

https://github.com/rustdesk/rustdesk-server/issues/134#issuecomment-1303437173 https://github.com/rustdesk/rustdesk/wiki/FAQ#deploy-rustdesk-server-in-intranet