# From http://goldmann.pl/blog/2014/01/21/connecting-docker-containers-on-multiple-hosts/, # modified to use Tinc instead of Open vSwitch. # Edit this variable: the 'other' host. REMOTE_IP=188.226.138.185 # Edit this variable: the bridge address on 'this' host. BRIDGE_ADDRESS=172.16.42.1/24 # Edit this variable: the bridge address on the 'other' host. OTHER_BRIDGE_ADDRESS=172.16.41.0 # Name of the bridge (should match /etc/default/docker and /etc/tinc/). BRIDGE_NAME=docker0 # bridges # Deactivate the docker0 bridge ip link set $BRIDGE_NAME down # Remove the docker0 bridge brctl delbr $BRIDGE_NAME # Add the docker0 bridge brctl addbr $BRIDGE_NAME # Set up the IP for the docker0 bridge ip a add $BRIDGE_ADDRESS dev $BRIDGE_NAME # Activate the bridge ip link set $BRIDGE_NAME up # Start Tinc, this creates `horde`, similar to `br0` in the Open vSwitch script. service tinc restart # Restart Docker daemon to use the new BRIDGE_NAME service docker restart # Make the 'other' subnet routable. route add -net $OTHER_BRIDGE_ADDRESS netmask 255.255.255.0 dev $BRIDGE_NAME