<div dir="ltr"><div><div><div><div><div><div>I have to say that I wouldn't do the networking that way - in fact, in the clusters I manage, we haven't done the networking that way :-).  Rather than layer 3 routing between VMs, we've chosen to use layer 2 virtual switching (yes, using openvswitch).  We have the luxury of multiple 10G NICs between our hosts, so we've separated out the management network from the guest network, simply to ensure that we retain administrative access to the hosts via ssh.  If you want to live a little more dangerously, you could use VLAN or VXLAN on one NIC - or you could spend a few dollars on an extra network card on each host for the peace of mind!<br><br></div>For the project that's been live for two years: we presently run four hosts on the lab's production network (another two on its acceptance-test network, and another one as a "kickaround" host for playing about with configs).  Guest VMs on all four 
production 

hosts share <a href="http://192.168.59.0/24">192.168.59.0/24</a> (why "59" is a story for another day), on an OVS virtual switch on each host named br-guest, with the guest-specific NIC also set as a port on the virtual switch.  Guest traffic is therefore sent transparently between the hosts where needed, and we can live-migrate a guest from one host to another with no need to change the guest's IP address.  Because we share a common guest network and IP range between all hosts, it's trivial to add (or remove) hosts - no host needs to know anything about routing to another host, and in fact only our management layer cares how many hosts we have.<br><br></div>We happen to have "controller" nodes that run redundant DHCP servers with non-overlapping scopes, but the exact location is not a requirement of this setup.  We could equally well set up a DHCP service on the guest network on each host, allowing allocation of e.g. 192.168.59.1 to .100 on one host, .101 to .200 on another host.  Guests will typically receive offers from each DHCP server and can choose, which is fine as they're all on the same network.  This provides redundancy in case of a full or failed DHCP server, which your routed network approach wouldn't without some careful DHCP forwarding work.<br><br></div>We happen to base our hosts on CentOS 7, but I manage other Debian-derived systems and can probably remember enough about its network setup to help with Ubuntu.  Certainly I can help with OVS weirdnesses; it took some time to get my head round exactly how it works.  That said, I've never set up a kvm host on Debian.<br><br></div>Good luck; happy to provide further pointers if useful.<br><br></div>Cheers,<br><br></div>- Peter<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 30 May 2018 at 15:32, Cobin Bluth <span dir="ltr"><<a href="mailto:cbluth@gmail.com" target="_blank">cbluth@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Libvirt Users,<br><br>I would like to setup a two node bare-metal cluster. I need to guidance on the network configuration. I have attached a small diagram, the same diagram can be seen here: <a href="https://i.imgur.com/SOk6a6G.png" target="_blank">https://i.imgur.com/<wbr>SOk6a6G.png</a><br><br>I would like to configure the following details:<br>- Each node has a DHCP enabled guest network where VMs will run. (eg, <font face="monospace"><b><a href="http://192.168.1.0/24" target="_blank">192.168.1.0/24</a></b></font> for Host1, and <font face="monospace"><b><a href="http://192.168.2.0/24" target="_blank">192.168.2.0/24</a></b></font> for Host2)<br>- Any guest in Host1 should be able to ping guests in Host2, and vice versa.<br>- All guests have routes to reach the open internet (so that '<font face="monospace"><b>yum update</b></font>' will work "out-of-the-box")<br>- Each node will be able to operate fully if the other physical node fails. (no central DHCP server, etc)<br>- I would like to <u>add more physical nodes later</u> when I need the resources.<br><br>This is what I have done so far:<br>- Installed latest Ubuntu 18.04, with latest version of libvirt and supporting software from ubuntu's apt repo.<br>- Each node can reach the other via its own eth0.<br>- Each node has a working vxlan0, which can ping the other via its vxlan0, so it looks like the vxlan config is working. (I used <font face="monospace"><b>ip link add vxlan0 type vxlan...</b></font>)<br>- Configured route on Host1 like so: <b><font face="monospace">ip route add <a href="http://192.168.2.0/24" target="_blank">192.168.2.0/24</a> via 172.20.0.1</font></b><br>- Configured route on Host2 also: <b><font face="monospace">ip route add <a href="http://192.168.1.0/24" target="_blank">192.168.1.0/24</a> via 172.20.0.2</font></b><div>- All guests on Host1 (and Host1) can ping eth0 and vxlan0 on Host2, and vice versa, yay.<br>- Guests on Host1 <u>cannot</u> ping guests on Host2, I suspect because the the default NAT config of the libvirt network.<br><br>So, at this point I started to search for tutorials or more information/documentation, but I am a little overwhelmed by the sheer amount of information, as well as a lot of "stale" information on blogs etc.<br>I have learned that I can <b><font face="monospace">virsh net-edit default</font></b>, and then change it to an "open" network:<font face="monospace"><b> <forward mode='open'/></b></font></div><div>After doing this, the guests cannot reach outside their own network, nor reach the internet, so I assume that I would need to add some routes, or something else to get the network functioning like I want it. There is also <font face="monospace"><b><forward mode="route"/></b></font>, but I dont fully understand the scenarios where one would need an <b><font face="monospace">open</font></b> or a <b><font face="monospace">route</font></b> forward mode. I have also shied away from using openvswitch, and have opted for ifupdown2.<br>(I have taken most of my inspiration from this blog post: <a href="https://joejulian.name/post/how-to-configure-linux-vxlans-with-multiple-unicast-endpoints/" target="_blank">https://joejulian.name/<wbr>post/how-to-configure-linux-<wbr>vxlans-with-multiple-unicast-<wbr>endpoints/</a> )<br><br>Some questions that I have for the mailing list, any help would be greatly appreciated:<br>- Is my target configuration of a KVM cluster uncommon? Do you see drawbacks of this setup, or does it go against "typical convention"?<br>- Would my scenario be better suited for an "<b><font face="monospace">open</font></b>" network or a "<b><font face="monospace">route</font></b>" network?<br>- What would be the approach to complete this setup?<br><br><br><br></div></div>
<br>______________________________<wbr>_________________<br>
libvirt-users mailing list<br>
<a href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvirt-users" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/libvirt-users</a><br></blockquote></div><br></div>