<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bits of Arrogance &#187; networking</title>
	<atom:link href="https://www.crummylogic.com/wordpress/?feed=rss2&#038;tag=networking" rel="self" type="application/rss+xml" />
	<link>https://www.crummylogic.com/wordpress</link>
	<description>Making myself pervasive</description>
	<lastBuildDate>Wed, 04 Oct 2017 17:25:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.4</generator>
	<item>
		<title>KVM Networking, bond &amp; bridge with VLANs</title>
		<link>https://www.crummylogic.com/wordpress/?p=306</link>
		<comments>https://www.crummylogic.com/wordpress/?p=306#comments</comments>
		<pubDate>Fri, 17 Oct 2014 17:55:02 +0000</pubDate>
		<dc:creator><![CDATA[jrdalrymple]]></dc:creator>
				<category><![CDATA[Technology junk]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://www.jrssite.com/wordpress/?p=306</guid>
		<description><![CDATA[I never found a complete tutorial on setting up KVM networking the way I wanted. One thing that VMware has everyone beat on is simple and effective network configurations. KVM hosts can be just as good, but it won&#8217;t draw the pictures for you so it&#8217;s difficult to visualize what&#8217;s going on and troubleshoot it &#8230; <a href="https://www.crummylogic.com/wordpress/?p=306" class="more-link">Continue reading <span class="screen-reader-text">KVM Networking, bond &#038; bridge with VLANs</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I never found a complete tutorial on setting up KVM networking the way I wanted. One thing that VMware has everyone beat on is simple and effective network configurations. KVM hosts can be just as good, but it won&#8217;t draw the pictures for you so it&#8217;s difficult to visualize what&#8217;s going on and troubleshoot it when things are going wrong.</p>
<p>This write-up should give you all the information you need to create a robust, bonded and VLAN aware &#8220;virtual switch&#8221; configuration on your KVM host. My config uses all native Linux networking constructs. It does not make use of the newer &#8220;team&#8221; method of interface aggregation and it definitely does not make use of Network Manager; as a matter of fact unless you have express need for it I suggest you uninstall Network Manager as it can cause grief in your configuration. As with all my other KVM related write-ups, this is based on EL7 type hosts, CentOS 7.0 in my case. If you wish to adapt it for other flavors of Linux this may still give you a good starting point.</p>
<p>Here is an approximation of what it should look like when you&#8217;re done:</p>
<p><a href="http://www.jrssite.com/wordpress/wp-content/uploads/2014/10/Linux-KVM-Bond-VLAN-bridge-config-New-Page.jpg"><img class="aligncenter size-full wp-image-308" alt="Linux KVM Bond-VLAN bridge config - New Page" src="http://www.jrssite.com/wordpress/wp-content/uploads/2014/10/Linux-KVM-Bond-VLAN-bridge-config-New-Page.jpg" width="845" height="622" /></a></p>
<p>&nbsp;</p>
<p>In case it&#8217;s not obvious, the shaded balls are your KVM domains. When configuring your new domains you will select the &#8220;Specify shared device name&#8221; option in virt-manager and type out the bridge you want the domain connected to. Or alternatively if you&#8217;re hand crafting your domain&#8217;s XML file it will look like this:</p>
<pre>&lt;interface type='bridge'&gt;
  &lt;mac address='ff:ff:ff:ff:ff:ff'/&gt;
  &lt;source bridge='virbr120'/&gt;
  &lt;target dev='vnet0'/&gt;
  &lt;model type='rtl8139'/&gt;
  &lt;alias name='net0'/&gt;
  &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' /&gt;
&lt;/interface&gt;</pre>
<p>This would connect your VM to VLAN120 per my config above. Obviously many other things in this XML are domain and environment specific so don&#8217;t just try to copy and paste that and expect your machine to work, if you&#8217;re hand editing XML &#8211; know what you&#8217;re doing. Some of the other configs that you&#8217;ll need are as follows:</p>
<p>Cisco 3650:</p>
<pre>sw# <span style="color: #ff0000;">config t</span>
sw(config)# <span style="color: #ff0000;">interface range gi0/1,gi0/2</span>
sw(config-if-range)# <span style="color: #ff0000;">switchport trunk encapsulation dot1q</span>
sw(config-if-range)# <span style="color: #ff0000;">switchport trunk allowed vlan 100,110,120,200</span>
sw(config-if-range)# <span style="color: #ff0000;">switchport mode trunk</span>
sw(config-if-range)# <span style="color: #ff0000;">channel-group 1 mode on</span>
sw(config-if-range)# <span style="color: #ff0000;">exit</span>
sw(config)# <span style="color: #ff0000;">interface po1</span>
sw(config-if)# <span style="color: #ff0000;">switchport trunk encapsulation dot1q</span>
sw(config-if)# <span style="color: #ff0000;">switchport trunk allowed vlan 100,110,120,200</span>
sw(config-if)# <span style="color: #ff0000;">switchport mode trunk</span>
sw(config-if)# <span style="color: #ff0000;">description "KVM Server 1 VMNetwork bonded and trunked"</span></pre>
<p>On your KVM host:</p>
<p><strong>/etc/modprobe.d/bond0.conf:</strong></p>
<pre>alias bond0 bonding</pre>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-eth0:</strong></p>
<pre>DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes</pre>
<p>Make eth1 or whatever your 2nd adapter look similar, obviously change the <span style="color: #ff0000;">DEVICE= line</span></p>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-bond0:</strong></p>
<pre>DEVICE=bond0
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="miimon=100 mode=4 lacp_rate=1"</pre>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-bond0.100:</strong></p>
<pre>DEVICE=bond0.100
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
NM_CONTROLLED=no
BRIDGE=virbr100</pre>
<p>Like the physical interfaces, you can copy/paste this for the other VLANs you want to include in your configuration, you will have to change the <span style="color: #ff0000;">DEVICE=</span> line and <span style="color: #ff0000;">BRIDGE=</span> line in each separate config file.</p>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-virbr100:</strong></p>
<pre>DEVICE=virbr100
ONBOOT=YES
TYPE=Bridge
DELAY=0
BOOTPROTO=none</pre>
<p>This one is another copy/paste candidate to bridge you into any of your VLAN interfaces, this time the only line you&#8217;ll need to modify as you copy and paste is <span style="color: #ff0000;">DEVICE=</span>. If you&#8217;d like you can add an IP address, subnet mask, etc to any of the bridge interfaces and then use that to connect to your KVM server. For me I prefer to have dedicated out-of-band interfaces for management purposes so all of my bridges are without layer 3 termination.</p>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.crummylogic.com/wordpress/?feed=rss2&#038;p=306</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
