Can't connect to peers in swarm private network

I am trying to build a simple private ipfs network. I have a local node deployed on my machine with docker, it has a swarm.key file and it launches in private mode correctly. I’ve removed all bootstrap connections and done the same thing for the other node, that’s currently hosted on a virtual machine, also with docker. All ports are open correctly, I’ve checked that already. I can netcat and ping from either side to the other.

The netcat to port 4001 ( the swarm port ) gives a weird output but it seems like it connects so I’m not sure if this is relevant:

�_��?�DPV仵)cm:T�nc~������F2�����^C

But when trying to run ipfs swarm connect with the other node’s address from either side. I get the following error:

Error: connect failure: failed to dial: failed to dial : no good addresses

  • [/ip4/addr/tcp/4001] gater disallows connection to peer
  • [/ip4/addr/tcp/4001] gater disallows connection to peer

Some help would be much apreciated.
Thanks!

I’ve also been reading some posts here and noticed that when I try to nc one of the nodes I don’t get the expected response but just this output:

�_��?�DPV仵)cm:T�nc~������F2�����^C

At first I thought it may be encoded since it’s using private swarm.keys but I now think there may be something wrong there