# Global and Local discovery

**URL:** https://forum.syncthing.net/t/global-and-local-discovery/2636
**Category:** Support
**Created:** [May 5, 2015, 4:00pm UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636 "2015-05-05T16:00:07Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [May 5, 2015, 4:00pm UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/1 "2015-05-05T16:00:07Z")

</div>

Why do I get the message

> New UPnP port mapping: external port 9999 to local port 99999

when global discovery is disabled?

If the global discovery is not enabled, I expect this to mean that

1. my device can only connect to other devices on my lan AND
2. only devices on my lan can connect to my device

Assuming my interpretation of global discovery is correct, I can’t see why an incoming connection is necessary.

I don’t want to enable global discovery unless and until I want to sync off-lan.

I’m assuming that updates and stats are initiated by device.

Am I missing something?

---

<div class="post-metadata">

### Author: ![wweich](https://forum.syncthing.net/user_avatar/forum.syncthing.net/wweich/32/1063_2.png) [@wweich](https://forum.syncthing.net/u/wweich)
#### Post date: [May 5, 2015, 4:24pm UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/2 "2015-05-05T16:24:18Z")

</div>

Global discovery means, that your client will send it info (device id + ip) to the discovery servers listed in the input field below the checkboxes and has nothing to do with UPnP directly. Even if you disable global discovery, you can still be available from outside, when you use e.g. dyndns and enter the connection details on the other client manually.

To disable UPnP, disable UPnP in the settings.

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [May 6, 2015, 12:04am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/3 "2015-05-06T00:04:18Z")

</div>

Thank you for replying, but you missed the point of my question.

I’m not after a lesson in UPnP or dyndns, just the answer to a simple question.

If I’m right, he only function for which syncthing needs to listen on an open port involves syncing off-lan.

So, why does it open a port anyway?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [May 6, 2015, 5:23am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/4 "2015-05-06T05:23:03Z")

</div>

In case you hard code the address on one of the nodes, instead of using discovery.

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [May 6, 2015, 8:00am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/5 "2015-05-06T08:00:01Z")

</div>

Got it. Thanks. 😊

---

<div class="post-metadata">

### Author: ![tamir](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tamir](https://forum.syncthing.net/u/tamir)
#### Post date: [September 9, 2015, 6:22am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/6 "2015-09-09T06:22:22Z")

</div>

How to get connected device list of discovery server?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [September 9, 2015, 6:35am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/7 "2015-09-09T06:35:53Z")

</div>

You can’t.

---

<div class="post-metadata">

### Author: ![tamir](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tamir](https://forum.syncthing.net/u/tamir)
#### Post date: [September 9, 2015, 6:50am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/8 "2015-09-09T06:50:13Z")

</div>

thank you for answer. How to connect my home pc and my office pc? why use the own discovery server. in local network, all my device connected. but outside devices are not connected

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [September 9, 2015, 7:00am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/9 "2015-09-09T07:00:39Z")

</div>

If the devices say OK in the global discovery server Then its finding it fine. Check the firewall and port forwarding section in the docs, as that’s most likely the reason.

---

<div class="post-metadata">

### Author: ![tamir](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tamir](https://forum.syncthing.net/u/tamir)
#### Post date: [September 9, 2015, 7:10am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/10 "2015-09-09T07:10:36Z")

</div>

OK Thank you very much

---

<div class="post-metadata">

### Author: ![wweich](https://forum.syncthing.net/user_avatar/forum.syncthing.net/wweich/32/1063_2.png) [@wweich](https://forum.syncthing.net/u/wweich)
#### Post date: [September 9, 2015, 9:16am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/11 "2015-09-09T09:16:56Z")

</div>

AFAIK: If your discovery server is running inside your network, all local syncthing nodes have the local ip and port in the discovery database. The discovery server uses the ip from which the clients are connecting.

So all external nodes will be able to find each other and all local nodes will find the local and the external nodes. As the external nodes probably won’t have port forwardning / UPnP, the local nodes won’t be able to connect to the external nodes.

In short: The discovery server needs to run outside your home / local network (e.g. VPS) to be used by internal and external nodes.

---

<div class="post-metadata">

### Author: ![wweich](https://forum.syncthing.net/user_avatar/forum.syncthing.net/wweich/32/1063_2.png) [@wweich](https://forum.syncthing.net/u/wweich)
#### Post date: [September 10, 2015, 4:07am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/12 "2015-09-10T04:07:30Z")

</div>

Actually it could work.

When I set the global discovery server to my DynDNS name, my router connects as if it comes from the external IP but routes it internally (better speed, irrelevant for discovery).

I started the discovery server in debug, to get the info:

```
./discosrv -debug=true
2015/09/09 18:16:14 New limiter for <my-external-ip>
2015/09/09 18:16:14 <- <my-external-ip>:<random-port> discover.Announce{Magic:0x9d79bc39, This:discover.Device{ID:[]uint8{<my-id-in-hex>}, Addresses:[]discover.Address{discover.Address{IP:[]uint8(nil), Port:<my-port-in-hex>}}}, Extra:[]discover.Device{}}
2015/09/09 18:16:15 <- <my-external-ip>:<random-port2> discover.Query{Magic:0x2ca856f5, DeviceID:[]uint8{<my-id-in-hex>}}
2015/09/09 18:16:15 -> <my-external-ip>:<random-port2> discover.Query{Magic:0x2ca856f5, DeviceID:[]uint8{<my-id-in-hex>}}

```

I did not test this, but it seems that that should work for external nodes.

So it depends on your router and how the connection is established.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [October 10, 2015, 4:07am UTC](https://forum.syncthing.net/t/global-and-local-discovery/2636/13 "2015-10-10T04:07:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
