# syncthing hidden behind 2x NAT

**URL:** https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801
**Category:** Support
**Created:** [November 2, 2020, 12:11pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801 "2020-11-02T12:11:25Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Lampos](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/l/51bf81/32.png) [@Lampos](https://forum.syncthing.net/u/Lampos)
#### Post date: [November 2, 2020, 12:11pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801/1 "2020-11-02T12:11:25Z")

</div>

I have a syncthing instance connecting to the internet via a cascade of two NAT-routers. (syncthing (on Solaris) =\> NAT 1. =\> NAT 2. =\> internet) While the first router (NAT 1.) is nicely configured by syncthing using UPNP the second one (NAT 2.) needs to map those setting to it’s public WAN-connection. The aim is to get syncthing advertising it’s port publicly so that other instances can connect to it using the “dynamic” option. Any help is highly appreciated.

---

<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: [November 2, 2020, 1:26pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801/2 "2020-11-02T13:26:28Z")

</div>

Map the same port as Syncthing actually listens on (22000), at each NAT step, manually. Things should work automatically from there.

---

<div class="post-metadata">

### Author: ![Lampos](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/l/51bf81/32.png) [@Lampos](https://forum.syncthing.net/u/Lampos)
#### Post date: [November 2, 2020, 1:40pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801/3 "2020-11-02T13:40:51Z")

</div>

Will I need to map the UDP-port (21027) as well ?

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [November 2, 2020, 2:07pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801/4 "2020-11-02T14:07:09Z")

</div>

That’s for local discovery, so no, not for connections to device on the internet. If you do need local discovery, you might need to allow multi-/broadcasts on your routers though for that to work.

---

<div class="post-metadata">

### Author: ![Lampos](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/l/51bf81/32.png) [@Lampos](https://forum.syncthing.net/u/Lampos)
#### Post date: [November 3, 2020, 8:18pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801/5 "2020-11-03T20:18:27Z")

</div>

Thank you for the advice - I finally got around to try the suggested setup. However, while NAT step 1. seems to work fine (I can see two ports being opened via UPNP: 28285\<=\>22000 & 23628\<=\>22000), NAT step 2. seems to deny opening any of the two alternative ports (28285 or 23628). On both devices the port-forward of port 22000 is active and seems to work. Here the syncthing-log:

```
2020-11-03 20:36:10 New NAT port mapping: external TCP address 10.168.10.10:28285 to local address 0.0.0.0:22000.
2020-11-03 20:36:10 New NAT port mapping: external TCP address 10.168.10.10:23628 to local address 0.0.0.0:22000.
2020-11-03 20:36:10 Detected 2 NAT services
2020-11-03 20:36:24 quic://0.0.0.0:22000 detected NAT type: Port restricted NAT
2020-11-03 20:36:24 quic://0.0.0.0:22000 resolved external address quic://xxx.180.yy.abc:22000 (via stun.syncthing.net:3478)

2020-11-03 20:36:33 Joined relay relay://87.0.34.107:22067

```

Any idea what I am doing wrong ?

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [November 3, 2020, 9:34pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801/6 "2020-11-03T21:34:44Z")

</div>

Why do you need it to work with upnp? I doubt that works across two NATs. Just setup port forwards on both NATs and you are good.

---

<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: [November 3, 2020, 10:39pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801/7 "2020-11-03T22:39:59Z")

</div>

Upnp will not work over 2 nat hops, you have to set up ports manually.

I don’t think upnp as a protocol even supports nested nats.

---

<div class="post-metadata">

### Author: ![Lampos](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/l/51bf81/32.png) [@Lampos](https://forum.syncthing.net/u/Lampos)
#### Post date: [November 5, 2020, 4:03pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801/8 "2020-11-05T16:03:45Z")

</div>

Thank you for letting me know - I deactivated UPNP on NAT 1. and automatic discovery started to work. Thanks to everybody for helping to resolve the issue.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [December 5, 2020, 4:03pm UTC](https://forum.syncthing.net/t/syncthing-hidden-behind-2x-nat/15801/9 "2020-12-05T16:03:46Z")

</div>

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