# connection behind cgnat

**URL:** https://forum.syncthing.net/t/connection-behind-cgnat/19857
**Category:** General
**Created:** [February 27, 2023, 6:44am UTC](https://forum.syncthing.net/t/connection-behind-cgnat/19857 "2023-02-27T06:44:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jang430](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jang430](https://forum.syncthing.net/u/jang430)
#### Post date: [February 27, 2023, 6:44am UTC](https://forum.syncthing.net/t/connection-behind-cgnat/19857/1 "2023-02-27T06:44:11Z")

</div>

Hi. I have two hosts behind cgnat. One has connection type Relay, another has Relay WAN. I don’t know what it means, I just know that it’s slow. Since my IP address is behind cgnat, is there any way to fix this?

I see a lot of tutorials on Cloudflare tunnels. I’ve created one myself. Will that be a possible solution for me? If yes, how do I set it up?

---

<div class="post-metadata">

### Author: ![gadget](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/g/dec6dc/32.png) [@gadget](https://forum.syncthing.net/u/gadget)
#### Post date: [February 27, 2023, 8:14pm UTC](https://forum.syncthing.net/t/connection-behind-cgnat/19857/2 "2023-02-27T20:14:19Z")

</div>

> [@jang430](#):
>
> Hi. I have two hosts behind cgnat. One has connection type Relay, another has Relay WAN. I don’t know what it means, I just know that it’s slow. Since my IP address is behind cgnat, is there any way to fix this?

- Is there another NAT layer behind the CGNAT?
- Are the two hosts on the same LAN or are they behind different CGNATs?
- What OSes are each host running?

Screenshots of Syncthing’s web gui (with the device and folder details visible) would be very helpful along with any additional info about your network setup.

Basically, each Syncthing host tries to determine if it can connect to a specified Syncthing host as directly as possible. But when it cannot, a Syncthing relay server is used. It’s like personally dropping off a package at your friend’s home verses sending it via a mail carrier who in turn then drops the package off at your friend’s home. The latter is a lot slower.

> [@](#):
>
> I see a lot of tutorials on Cloudflare tunnels. I’ve created one myself. Will that be a possible solution for me? If yes, how do I set it up?

Without more information it’s difficult to say if a Cloudflare Tunnel would help speed up syncing. Adding other layers of network abstraction generally slows things down instead of the opposite.

---

<div class="post-metadata">

### Author: ![jang430](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jang430](https://forum.syncthing.net/u/jang430)
#### Post date: [February 28, 2023, 6:03am UTC](https://forum.syncthing.net/t/connection-behind-cgnat/19857/3 "2023-02-28T06:03:34Z")

</div>

Yes, there is a TP-Link Deco router behind CGNAT that allows home devices to connect to the net.

No, each host have the same setup, ISP gives out 100.89.x.x IP address, then TP-Link Deco router serves 192.168.1.x to home devices.

Both host have syncthing running on docker container.

 ![image_2023-02-28_140233248](https://forum-uploads.syncthingcdn.net/original/2X/4/46e287f85ffff22f2b19d909a8191c8f33656ca4.jpeg)

---

<div class="post-metadata">

### Author: ![gadget](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/g/dec6dc/32.png) [@gadget](https://forum.syncthing.net/u/gadget)
#### Post date: [February 28, 2023, 8:42pm UTC](https://forum.syncthing.net/t/connection-behind-cgnat/19857/4 "2023-02-28T20:42:30Z")

</div>

> [@jang430](#):
>
> Both host have syncthing running on docker container.

Ah…

Note how in your screenshot of Syncthing’s web GUI, the “Qnap” device has the IP address 172.105.199.155:

![image](https://forum-uploads.syncthingcdn.net/original/2X/7/7280201e9506a86e1c0bee664ea0c8801bb3f414.png)

The Docker container on your “NAS” device likely has a similar (or possibly even identical IP address).

Since your TP-Link Deco router is providing a 192.168.1.0/24 subnet, but your “Qnap” Docker container is on a different subnet (172.105.199.155), as far as Syncthing is concerned, “QNAP” and “NAS” could be located on different continents. It’s why Syncthing ended up using an external relay server to connect your two nodes.

So the problem is the Docker and network configuration rather than Syncthing. A search for “docker” on this forum will turn up earlier posts with different solutions depending on the individual requirements.

---

<div class="post-metadata">

### Author: ![jang430](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jang430](https://forum.syncthing.net/u/jang430)
#### Post date: [March 1, 2023, 4:47am UTC](https://forum.syncthing.net/t/connection-behind-cgnat/19857/5 "2023-03-01T04:47:03Z")

</div>

Hello, to be accurate, Deco is giving out 192.168.68.x. My NAS has the IP of 192.168.68.1xx. Syncthing container is using bridge network on the NAS, and all containers is using 172.17.0.x.

![image](https://forum-uploads.syncthingcdn.net/optimized/2X/f/fd6f612ee61c948855e558128f1a338dbeda3c02_2_690x30.png)

I’ll search docker and see if I can find a solution to this.

---

<div class="post-metadata">

### Author: ![jang430](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jang430](https://forum.syncthing.net/u/jang430)
#### Post date: [March 4, 2023, 7:42am UTC](https://forum.syncthing.net/t/connection-behind-cgnat/19857/6 "2023-03-04T07:42:35Z")

</div>

@gadgetJust want to share with you that I followed your recommendation. Just to be sure, I changed the docker container from bridge networking to host networking, and it now works as it doesn’t stay 172.x.x.x

Thank you!
