Consul multivm with containers setup


I have a problem of enabling consul communication. But maybe before I show the error log I describe the setup.
2 virtual machines (virtualbox) [A =>, B =>]
VM_A contains consul-server in lxd container with IP
VM_B contains consul-client

Running consul members shows both nodes as alive, but journalctl on VM_B shows me an error:

“consul: “Coordinate.Update” RPC failed to server rpc error getting client: failed to get conn: dial tcp -> i/o timeout”

Before I post the configuration can someone show me the simplest possible consul config?
I did also try using iptables redirects, but I would like to understand how to properly setup consul in such multi-vm setup.

I have found a solution:

On VM_A I have exposed the port with iptables.
On VM_B with iptables I am redirecting every outgoing packet to VM_A (IP =>, and am overwriting the source ip of the packet to the VM_B (IP =>