Cross Host network communication failure


I opened an issue on GitHub for this but maybe it’s only a configuration issue on my side:

Basically, i can’t make service links work when services are located on different hosts. For example:

  • Zookeeper running on host A,
  • Mesos-Master running on host B, with service link to Zookeeper service.

Host A:

  • VirtualBox machine create with docker-machine running boot2docker, agent added via custom host registration, as IP being registered.
    Host B:
  • VirtualBox machine create with docker-machine running boot2docker, agent added via custom host registration, as IP being registered.

Both VMs are running on my local machine (192.168.0.xx). Rancher server is running on my local machine. It detects both agents and registers them fine. Containers are launched successfully, but somehow they are unable to communicate with each other when running on different hosts.

I tried to go though the documentation and troubleshooting guide with no luck:

Inside the VM, i can ping local containers with 10.42.xx.xx ips, but other VM containers with same network are unreachable.

I checked iptables on both hosts and everything seems fine:
Chain CATTLE_PREROUTING (1 references)
num target prot opt source destination
1 DNAT udp – ADDRTYPE match dst-type LOCAL udp dpt:4500 to:
2 DNAT udp – ADDRTYPE match dst-type LOCAL udp dpt:500 to:

What else can i do to make cross-host networking work? Thanks for your help :slight_smile:

Here are my two VirtualBox hosts: (with bridged network and -e CATTLE_AGENT_IP correctly set)

The Stack is configured as following:

The rancher server is running on When trying to ping Ubuntu-1 from ubuntu-2:

Pinging any 192.168.0.xx host from any VM / local machine works. IPTables seems just fine:

Tried to disable UFW on local machine (running with Ubuntu 14.04), still no effect.

I could finally manage to get the cross-host network working by trying out with 2 bare-metal machines hosts on the same local area network. It just worked fine.

Setting up hosts on virtualbox is not possible due to NAT network configuration. Even in bridged mode, i couldn’t manage to make them work properly. I managed to run a hybrid configuration with one local host and one AWS EC2 host and it worked fine.

Great job guys, Rancher rocks :grinning:

@jloisel, haven’t read your posts, just wanted to say that I’ve used virtualbox without issues, using docker-machine to provision the hosts, then standard docker run's to start rancher server and agent. So, it’s most likely something with your setup.

I provisioned two hosts with docker-machine too but i couldn’t manage to get containers communicate between those hosts. By default, it configures both boxes with NAT. I can’t setup NAT for 500/udp and 4500/udp for both machines since it would conflict on my local machine network.

I’ve tried with bridged network and it didn’t work either. I don’t know why, everything seemed fine when inspecting IPTables. Maybe one of my network interfaces on my local machine is messing up the IPSec tunnel.

have you tried making two containers communicate with 2 virtual boxes with NAT networking? I tried to setup NAT port forwarding on both VMs and it didn’t work.

I`ve the same issues when trying to run more that one VM on the same host. I was trying to get them up using docker-machine and then adding them manually as rancher hosts. At some point linking stops working.

Maybe the Rancher team could clarify the network infrastructure and if that use case is really not supported.

Hi @kaos,
I’m trying to make it work with VirtualBox machine provisioned by docker-machine.

The host are visible in Rancher and I can deploy on it, but I cannot link container between those hosts.
have you tried that?

If it’s working for, i would like to know your setup?

Ah, right, no I’ve only used two nodes in virtualbox, one for the server and the other a lone agent node. With a dual agent setup, I get the same results as the rest of you.

It’s simply not possible to setup two nodes on virtualbox vms on the same machine unless you configure them with bridged networking. NAT cannot be used since it would require to forward the UDP ports to the local machine. You cannot forward those ports for both the VMs on the same machine.

But, somehow bridged network is not working properly with boot2docker VMs. It freezes my entire Ubuntu setup for an unknown reason.

On same machine with 2 Virtualbox host, I can managed communication between host, due to same network “”.

But cross-multihost not working well.