--- /dev/null
+#! /bin/sh -xe
+
+ip link add vxlan0 type vxlan id 142 group 239.1.1.1 dev eth0 dstport 4789
+#only two machines peer-to-peer:
+# ip link add vxlan0 type vxlan id 42 remote 2.2.2.2 local 1.1.1.1 dev eth0
+ip link set up dev vxlan0
+
+brctl addbr superbr0
+ip link set up superbr0
+brctl addif superbr0 vxlan0
+
+#ip -d link show vxlan0
--- /dev/null
+# VXLAN Example: added overlay0 gateway
+
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+allow-hotplug eth0
+iface eth0 inet dhcp
+
+# The secondary network interface
+allow-hotplug eth1
+iface eth1 inet dhcp
+
+auto overlaybr0
+iface overlaybr0 inet manual
+ bridge_ports regex vxlan*
# or disable FETCH_SSH_KEYS
#
-DOCKER_network='ics.muni.cz'
+#DOCKER_network='ics.muni.cz'
#DOCKER_network='bridge'
+DOCKER_network='none'
FETCH_SSH_KEYS=${FETCH_SSH_KEYS:-'1'}
-IMAGE='valtri/hadoop-debian7'
+IMAGE='valtri/docker-server-deb7'
# get the first free network device
devname() {
# docker network connect bridge ${FACTER_hostname}
#fi
-# ==== public IPv6 ====
+# ==== public IPv6 + private IPv4 ====
dev=veth`devname`
# this is not persistent, let's create a script
cat << EOF > /etc/docker/${FACTER_hostname}.sh
mkdir -p /var/run/netns || :
-find -L /etc/ssl/certs -type l -delete || :
+find -L /var/run/netns -type l -delete || :
pid=\`docker inspect -f '{{.State.Pid}}' ${FACTER_hostname}\`
-ln -s /proc/\$pid/ns/net /var/run/netns/\$pid || :
+ln -s /proc/\${pid}/ns/net /var/run/netns/\${pid} || :
ip link add ${dev}a type veth peer name ${dev}b
brctl addif ${XENBR} ${dev}a
ip link set ${dev}a up
-ip link set ${dev}b netns \$pid
-ip netns exec \$pid ip link set dev ${dev}b name public6
-ip netns exec \$pid ip link set public6 address ${FACTER_macaddress}
-ip netns exec \$pid ip link set public6 up
+ip link set ${dev}b netns \${pid}
+ip netns exec \${pid} ip link set dev ${dev}b name ethx0
+ip netns exec \${pid} ip link set ethx0 address ${FACTER_macaddress}
+ip netns exec \${pid} ip link set ethx0 up
EOF
+if [ -n "${FACTER_ip}" ]; then
+ echo "ip netns exec \${pid} ip addr add ${FACTER_ip}/24 dev ethx0" >> /etc/docker/${FACTER_hostname}.sh
+fi
chmod +x /etc/docker/${FACTER_hostname}.sh
sh -xe /etc/docker/${FACTER_hostname}.sh