Address for swarm connect is not using port 4001

I tried connecting two peers from different public ip addresses but failed. I have successfully connected them before but this time I noticed that the port is different, 7863 instead of 4001

ipfs id:
“Addresses”: [
“AgentVersion”: “go-ipfs/0.4.22/”,
“ProtocolVersion”: “ipfs/0.1.0”

Is my firewall configured correctly?

it seems like the port is random, but there is no service other than IPFS using port 4001. IPFS itself occupying port 4001? I am confused

7863 is probably the NAT port assigned to IPFS connections by the router.

If your port is 4001 and that is open, you should be able to manually connect to /ip4/ XxjanorKVvaisJY5cQ. IPFS does not automatically advertise this port unless it sees 3 successful connections to it. A workaround is to set the Announce variable in the config to explicitly hardcode it.

ipfs swarm connect still fails.

I set the Announce variable in the config file like this:

"Addresses": {
"API": "/ip4/",
"Announce": ["/ip4/"],
"Gateway": "/ip4/",
"NoAnnounce": [],
"Swarm": [


now the ipfs id:

Firewall setting on the node I want to connect:

Firewall setting on the Azure virtual machine I used to connect the node:

Azure firewall setting:

Need help

Hmm I can only say that the port seems filtered/unreachable from the outside.

I think my IP is correct is not reachable for me nor for your other ipfs daemon. This looks like a connectivity issue you need to figure out with Azure/Windows.