Disabling AutoNAT in Kubo

Is there a way to disable AutoNAT IP detection on a Kubo node?

For example, I’m running a Kubo node on fly.io and because fly.io is doing some weird IP stuff (outgoing requests appear to be originating from a different IPv4), the externally observable IP is different to the one that its reachable on.

I tried setting the following config:
ipfs config AutoNAT.ServiceMode 'disabled'

However, ipfs id still returns the wrong public IPs in the list of addresses.

I am pretty confident this is the source of the problem because when I look at the observable public IP of the Kubo container it’s the same wrong one that shows up in the list of addresses:

/ # wget -qO- ifconfig.me
145.40.93.179
/ # ipfs id
{
...
	"Addresses": [	
        ...	
        "/ip4/145.40.93.179/tcp/4001/p2p/12D3KooW9snnuzHgfzpBKWtZxU9tpPDqB7SG4qM9tGLA9eQgYpQh",
		"/ip4/145.40.93.179/udp/4001/quic-v1/p2p/12D3KooW9snnuzHgfzpBKWtZxU9tpPDqB7SG4qM9tGLA9eQgYpQh",
		"/ip4/145.40.93.179/udp/4001/quic/p2p/12D3KooW9snnuzHgfzpBKWtZxU9tpPDqB7SG4qM9tGLA9eQgYpQh",
       ...

However, I am certain that 145.40.93.179 is not the correct public IP.

2 Likes

If you know what IP you expect to be listening on, you can force what addresses you announce via Addresses.Announce key. This would prevent you from announcing unreachable addresses. I believe local IPs also typically show up so other local nodes could connect too (which I understand isn’t particularly useful in a VPSish context).

Honestly I thought you’d want AutoNAT because my understanding is your node asks another node “where am I?” and uses the result (unsure how it’s verified, or if my understanding of what’s happening is 100% correct here).

1 Like

Gotcha! Yeah, I was using AppendAnnounce which adds to the IPs retrieved from AutoNAT.

Indeed. But due to some interesting networking configuration that fly.io has, the externally observable IP is different from the publicly reachable IPv4.

1 Like