Back

[SOLVED] Any idea why IP's are local NAT 10.0.0.X?

  • 0
  • Self Hosted
Tanner Meade
9 Sep, 2023, 01:16

I've got a docker swarm cluster running on Appwrite v1.3.8 and it's logging the NAT IP addresses (10.0.0.x) for everything. I'm trying to figure out why and how to fix it. Especially since this would affect rate limits.

There are several servers in the cluster running various parts of Appwrite. The best thought I have is it's some how getting the IPs from a docker network and the solution might have to do with which server is running the main appwrite monolith service.

Any ideas or thoughts on how to debug this?

TL;DR
IP addresses are being logged as local NAT addresses (10.0.0.x) in a docker swarm cluster running Appwrite v1.3.8. One solution is to add the IP address to the list of trusted IP addresses in the `docker-compose.yml` file under the traefik `command:` configurations. Another solution is to configure traefik to trust the IP address by using the `--entrypoints.appwrite_web.forwardedHeaders.trustedIPs=` and `--entrypoints.appwrite_websecure.forwardedHeaders.trustedIPs=` configurations. To find the IP address, run `docker network inspect ingress`.
Tanner Meade
9 Sep, 2023, 01:18

Another thought I've had is it might be connected to how traefik is configured, but I think I had it configured the same when the IPs were being logged correctly.

Drake
9 Sep, 2023, 01:20

What is that IP address? Some reverse proxy you have in front of Appwrite?

Tanner Meade
9 Sep, 2023, 01:22

no reverse proxy is setup -- I guess the first thing is to figure out where the IP is coming from, but since I think it might be coming from a docker network I'm not as comfortable figuring that out.

Drake
9 Sep, 2023, 01:23

The first step is to figure out what IP that is. You may have to inspect various docker networks or containers to see what has that IP

Drake
9 Sep, 2023, 01:24

That IP is the up of whatever is sending network requests to traefik/Appwrite

Tanner Meade
9 Sep, 2023, 01:26

My best theory is that I've got it mis-configured, so the entry point server isn't the one running traefik, so the request is forwarded from that server to the one running traefik.

Tanner Meade
9 Sep, 2023, 01:31

It's the ingress-endpoint IP address. I found it by running docker network inspect ingress.

Tanner Meade
9 Sep, 2023, 01:32

ingress-sbox I think is the container

Drake
9 Sep, 2023, 01:32

So it's yours and trusted. So you can try configuring traefik to trust this IP address

Tanner Meade
9 Sep, 2023, 01:33

Ya, I've had to add Cloudflare's IPs as trusted, so I think I just add this one as well. (I'm adding this text so it's easier to find for those searching how to make Cloudflare's IP addressed trusted, as in if all thier appwrite logs, activity, and history show cloudflare IP addresses that are the wrong IP address. You just google and find the cloudflare IPs and do what I did below to add them all separated by a comma and a space for the two traefik commands configs)

Tanner Meade
9 Sep, 2023, 01:38

Yup, that fixed it!

Tanner Meade
9 Sep, 2023, 01:38

Thanks!

Tanner Meade
9 Sep, 2023, 01:38

For other's reference:

Tanner Meade
9 Sep, 2023, 01:39

I got the full IP address by running docker network inspect ingress (ip with the /xx at the end)

Tanner Meade
9 Sep, 2023, 01:40

Then I added it to the list of trusted IP addresses in my docker-compose.yml under the traefik command: cofigurations.

Tanner Meade
9 Sep, 2023, 01:40

Specifically the below configs --entrypoints.appwrite_web.forwardedHeaders.trustedIPs= --entrypoints.appwrite_websecure.forwardedHeaders.trustedIPs=

Tanner Meade
9 Sep, 2023, 01:41

Then I redeployed the docker swarm, and it fixed it.

Tanner Meade
9 Sep, 2023, 01:41

[Resolved] Any idea why IP's are local NAT 10.0.0.X?

Tanner Meade
9 Sep, 2023, 01:45

[SOLVED] Any idea why IP's are local NAT 10.0.0.X?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more