title: Setup private networking between two hosts and two VMs with libvirt / openvswitch
body: <p>I have two nodes and two VM's</p>
  
  <pre><code>kvm01
  -nic1 123.123.123.1
  
  VM1 
  -vnet1 123.123.123.2 (public) -vnet2 10.0.0.1 (private)
  
  kvm02
  -nic1 123.123.123.2
  
  VM2
  -vnet1 123.123.123.4 (public) -vnet2 10.0.0.2 (private)
  </code></pre>
  
  <p>How is it possible to setup an openvswitch network so that VM1 and VM2 are on a private network however the hosts are in two different locations? </p>
  
  <p>EDIT:</p>
  
  <p>Running this command:</p>
  
  <pre><code># ovs-vsctl add-port br-private vxlan1 -- \
    set Interface vxlan1 type=vxlan options:remote_ip=123.123.123.2
  </code></pre>
  
  <p>Resulted in this OVS configuration:</p>
  
  <pre><code>root@backup01:~# ovs-vsctl show
  6276bd0a-920b-469d-a4e0-90d990dd8f94
      Bridge "br-private1"
          Port "vxlan1"
              Interface "vxlan1"
                  type: vxlan
                  options: {remote_host="107.150.29.72"}
          Port "br-private1"
              Interface "br-private1"
                  type: internal
      ovs_version: "2.3.0"
  root@kvmssd01:~# ovs-vsctl show
  da6399d4-1435-437d-90d7-3e75c443389b
      Bridge br-private
          Port "vxlan1"
              Interface "vxlan1"
                  type: vxlan
                  options: {remote_host="107.150.29.68"}
          Port br-private
              Interface br-private
                  type: internal
      ovs_version: "2.3.0"
  </code></pre>
  
  <p>Using this kernel:</p>
  
  <pre><code>root@backup01:~# uname -r
  3.16.0-4-amd64
  </code></pre>
  
  <p>With this module:</p>
  
  <pre><code>root@backup01:~# modinfo openvswitch
  filename:       /lib/modules/3.16.0-4-amd64/kernel/net/openvswitch/openvswitch.ko
  license:        GPL
  description:    Open vSwitch switching datapath
  depends:        libcrc32c,vxlan,gre
  intree:         Y
  vermagic:       3.16.0-4-amd64 SMP mod_unload modversions 
  </code></pre>
  
  <p>And this version of OVS:</p>
  
  <pre><code>root@backup01:~# ovs-vsctl --version
  ovs-vsctl (Open vSwitch) 2.3.0
  Compiled Dec 19 2014 03:59:10
  DB Schema 7.6.0
  </code></pre>
  
  <p>Resulted in these errors:</p>
  
  <pre><code>root@backup01:~# ovs-vswitchd logs
  2015-07-23T16:34:59Z|00001|reconnect|INFO|logs: connecting...
  2015-07-23T16:34:59Z|00002|reconnect|INFO|logs: connection attempt failed
    (Address family not supported by protocol)
  2015-07-23T16:34:59Z|00003|reconnect|INFO|logs: waiting 1 seconds before reconnect
  2015-07-23T16:35:00Z|00004|reconnect|INFO|logs: connecting...
  2015-07-23T16:35:00Z|00005|reconnect|INFO|logs: connection attempt failed 
      (Address family not supported by protocol)
  2015-07-23T16:35:00Z|00006|reconnect|INFO|logs: waiting 2 seconds before reconnect
  </code></pre>
  
  <p><code>lsmod</code> output:</p>
  
  <pre><code># lsmod | grep openvswitch 
  openvswitch 63932 0 
  gre 12777 1 openvswitch 
  vxlan 35053 1 openvswitch 
  libcrc32c 12426 1 openvswitch
  </code></pre>