How to connect overlay network over machines with dynamic ips?

Hello everyone,
I am trying to create an overlay network between ec2 vms on my aws cloud and PCs in my office. The PCs dont have public static IPs i can connect to.
I can do swarm join just fine but the traffic between containers doesn’t work.
I think this is a routing problem since the node has my office router ip not the PC IP.
Is there a way to make this work through docker swarm or overlay ? Or do I need a VPN?

You use public ip’s for swarm management? Don’t do that. Use the host’s private ip’s instead.
Cross region clusters don’t work reliable, Cross-AZ clusters within the same region are fine though.

Furthermore, are you really using cluster nodes that are connected over wan connections? This is a call for trouble. Swarm uses the RAFT consensus algorithm, which requires low latency network connections amongst the nodes to work properly.

You might want to rethink your whole setup…