<?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; CentOS</title>
	<atom:link href="https://www.crummylogic.com/wordpress/?feed=rss2&#038;tag=centos" 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>
		<item>
		<title>CentOS 7, Live Block Migration, getting the right qemu binary built and installed</title>
		<link>https://www.crummylogic.com/wordpress/?p=302</link>
		<comments>https://www.crummylogic.com/wordpress/?p=302#comments</comments>
		<pubDate>Tue, 07 Oct 2014 02:00:03 +0000</pubDate>
		<dc:creator><![CDATA[jrdalrymple]]></dc:creator>
				<category><![CDATA[Technology junk]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.jrssite.com/wordpress/?p=302</guid>
		<description><![CDATA[You were all excited because you read my other post, but you didn&#8217;t pay attention to the part about needing a special version of qemu-kvm and were saddened to be hit with this: error: unsupported configuration: block copy is not supported with this QEMU binary Don&#8217;t fret, I&#8217;ll help you get where you want to &#8230; <a href="https://www.crummylogic.com/wordpress/?p=302" class="more-link">Continue reading <span class="screen-reader-text">CentOS 7, Live Block Migration, getting the right qemu binary built and installed</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>You were all excited because you read <a title="KVM Live Block Migration – My Recipe" href="http://www.jrssite.com/wordpress/?p=269">my other post</a>, but you didn&#8217;t pay attention to the part about needing a special version of qemu-kvm and were saddened to be hit with this:</p>
<pre>error: unsupported configuration: block copy is not supported with this QEMU binary</pre>
<p>Don&#8217;t fret, I&#8217;ll help you get where you want to go. Do everything as root, and don&#8217;t do it on a production system &#8230; duh</p>
<p>Get your development environment ready:</p>
<pre># yum install -y rpm-build redhat-rpm-config make gcc
# mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
# echo '%_topdir %(echo $HOME)/rpmbuild' &gt; ~/.rpmmacros</pre>
<p>Get your source rpm and prerequisites &#8211; note that while this is current as of this posting, things could change. Up to you to handle keeping yourself current:</p>
<pre># wget http://ftp.redhat.com/redhat/linux/enterprise/6Server/en/RHEV/SRPMS/qemu-kvm-rhev-1.5.3-60.el7_0.7.src.rpm
# yum install -y zlib-devel SDL-devel texi2html gnutls-devel cyrus-sasl-devel libtool libaio-devel pciutils-devel pulseaudio-libs-devel libiscsi-devel libattr-devel libusbx-devel usbredir-devel texinfo spice-protocol spice-server-devel libseccomp-devel libcurl-devel glusterfs-api-devel glusterfs-devel systemtap systemtap-sdt-devel nss-devel libjpeg-devel libpng-devel libuuid-devel bluez-libs-devel brlapi-devel check-devel libcap-devel pixman-devel librdmacm-devel iasl ncurses-devel</pre>
<p>Build your binary:</p>
<pre># rpmbuild --rebuild qemu-kvm-rhev-1.5.3-60.el7_0.7.src.rpm</pre>
<p>Install your binary and its dependencies. Enjoy blockcopy funcitonality:</p>
<pre># yum install -y rpmbuild/RPMS/x86_64/*</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.crummylogic.com/wordpress/?feed=rss2&#038;p=302</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>KVM Live Block Migration &#8211; My Recipe</title>
		<link>https://www.crummylogic.com/wordpress/?p=269</link>
		<comments>https://www.crummylogic.com/wordpress/?p=269#comments</comments>
		<pubDate>Fri, 05 Sep 2014 17:39:51 +0000</pubDate>
		<dc:creator><![CDATA[jrdalrymple]]></dc:creator>
				<category><![CDATA[Technology junk]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.jrssite.com/wordpress/?p=269</guid>
		<description><![CDATA[In order for this to work you will need RHEV versions of qemu-kvm. The versions included in CentOS7 (my platform) don&#8217;t support the blockcopy command in virsh. Start by dumping the xml for the domain to somewhere you can grab it again later: [root@kvmhost ~]# virsh dumpxml guest1 &#62; /var/tmp/guest1.xml Make sure the domain is &#8230; <a href="https://www.crummylogic.com/wordpress/?p=269" class="more-link">Continue reading <span class="screen-reader-text">KVM Live Block Migration &#8211; My Recipe</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In order for this to work you <a title="CentOS 7, Live Block Migration, getting the right qemu binary built and installed" href="http://www.jrssite.com/wordpress/?p=302">will need RHEV versions of qemu-kvm</a>. The versions included in CentOS7 (my platform) don&#8217;t support the blockcopy command in virsh.</p>
<p>Start by dumping the xml for the domain to somewhere you can grab it again later:</p>
<pre>[root@kvmhost ~]# virsh dumpxml guest1 &gt; /var/tmp/guest1.xml</pre>
<p>Make sure the domain is not persistent:</p>
<pre>[root@kvmhost ~]# virsh undefine guest1
Domain guest1 has been undefined</pre>
<p>The actual migration (you may wish to check that you&#8217;re not overwriting the target, highlighted in red):</p>
<pre>[root@kvmhost ~]# virsh blockcopy guest1 /kvm/guest1.img /var/lib/libvirt/images/storagehost-NFS4/guest1.img --wait --verbose --pivot
Block Copy: [100 %]
Successfully pivoted</pre>
<p>Redefine the domain, double check it:</p>
<pre>[root@kvmhost ~]# virsh define /var/tmp/guest1.xml
Domain guest1 defined from /var/tmp/guest1.xml</pre>
<pre>[root@kvmhost ~]# virsh dominfo guest1
Id: 9
Name: guest1
UUID: e440e5bd-6d71-4807-a276-11477b764751
OS Type: hvm
State: running
CPU(s): 1
CPU time: 438.6s
Max memory: 3145728 KiB
Used memory: 3145728 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: none
Security DOI: 0</pre>
<p>Verify that the source file is no longer the disk in use and erase the file (if you want):</p>
<pre>[root@kvmhost ~]# lsof | grep /kvm/guest1.img
[root@kvmhost ~]# rm /kvm/guest1.img
rm: remove regular file ‘/kvm/guest1.img’? y</pre>
<p>Done</p>
]]></content:encoded>
			<wfw:commentRss>https://www.crummylogic.com/wordpress/?feed=rss2&#038;p=269</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adito Security Certificate &#8211; Pain in the butt, but possible</title>
		<link>https://www.crummylogic.com/wordpress/?p=145</link>
		<comments>https://www.crummylogic.com/wordpress/?p=145#comments</comments>
		<pubDate>Tue, 10 Dec 2013 18:18:38 +0000</pubDate>
		<dc:creator><![CDATA[jrdalrymple]]></dc:creator>
				<category><![CDATA[Technology junk]]></category>
		<category><![CDATA[adito]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl certificate]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.jrssite.com/wordpress/?p=145</guid>
		<description><![CDATA[Adito (formerly OpenVPN-ALS) is an amazingly wonderful piece of software. Honestly I can&#8217;t figure out why more FOSS advocates don&#8217;t pick up the pieces of the project and continue to develop on it. I guess largely it does what it&#8217;s supposed to do and doesn&#8217;t need much in the way of updating, though it would &#8230; <a href="https://www.crummylogic.com/wordpress/?p=145" class="more-link">Continue reading <span class="screen-reader-text">Adito Security Certificate &#8211; Pain in the butt, but possible</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Adito (formerly OpenVPN-ALS) is an amazingly wonderful piece of software. Honestly I can&#8217;t figure out why more FOSS advocates don&#8217;t pick up the pieces of the project and continue to develop on it. I guess largely it does what it&#8217;s supposed to do and doesn&#8217;t need much in the way of updating, though it would be nice if the plugin repositories were still up and running and such.</p>
<p>That said, I run Adito in 3 locations. For 2 of my locations the self-signed server certificate Adito creates and installs during the setup wizard is adequate. For 1 location though I prefer to offer the appearance of a truly secure and trusted site.</p>
<p>I&#8217;ll start by sharing the links I had to visit and inquire with to make all this work in case my write-up falls short for anyone reading it:</p>
<p><a href="http://sourceforge.net/p/openvpn-als/discussion/824507/thread/3e62506d">Discussion Topic on Sourceforge page</a></p>
<p><a href="http://www.agentbob.info/agentbob/79-AB.html">Instructions and discussion &#8211; Import private key and certificate into Java Key Store from</a> agentbob.info</p>
<p><a href="https://github.com/sschober/ImportKey">Github page for importkey tool that I used</a></p>
<p>I perused many many other pages, but these 3 gave me all the parts I needed to complete my task.</p>
<p>The server tools you&#8217;ll need will be openssl and jdk which you&#8217;ll have as a prerequisite to adito.</p>
<p>My installation is performed on CentOS 6.3 with Java jdk 1.7.0 u13. If any of the command I tell you to issue below don&#8217;t work it&#8217;s probably because your path is broken to java binaries.</p>
<p>It helps to create a working directory on your server so that all your files are glommed together in one place and not mixed in with other junk. Before you finish there will be quite a collection.</p>
<p>Step one &#8211; create your private key and certificate request:</p>
<pre>openssl req -out fqdn.csr -new -newkey rsa:2048 -nodes -keyout fqdn.key</pre>
<p style="padding-left: 30px;"><em>As a sidenote, if you compare this documentation with that of the folks on the Sourceforge discussion bored you&#8217;ll see that I skipped one of their steps. I&#8217;m fairly certain the `openssl req -x509` business is unnecessary. If someone can prove me wrong please let me know and I&#8217;ll update this documentation to reflect that.</em></p>
<p>Step two &#8211; submit your CSR (fqdn.csr from above) to the company you wish to issue you a certificate, follow their instructions to get your 3rd party trusted cert. In my case I was provided with 3 certificates in return, the one signed against my CSR, an intermediate and a root. Making note of what they need bundled together to form a valid chain is going to be important, and it will be different for each company. Put your fqdn.crt, intermediate.crt and root.crt into your working folder.</p>
<p>Step three &#8211; Convert all of your PEM formatted .crt files into DER format:</p>
<pre>for cert in fqdn.crt intermediate.crt root.crt; do openssl x509 -in $cert -inform PEM -out cert.der -outform DER; done</pre>
<p>Step four &#8211; Convert your private key to DER format as well:</p>
<pre>openssl pkcs8 -topk8 -nocrypt -in fqdn.key -inform PEM -out fqdn.key.der -outform DER</pre>
<p>Step five &#8211; cat the certificates together. I&#8217;m not sure if order matters, but I did it from my cert back to the root and that worked:</p>
<pre>cat fqdn.crt.der intermediate.crt.der root.crt.der &gt; fqdn.bundle.crt.der</pre>
<p>Step six &#8211; Copy the <a href="http://www.agentbob.info/agentbob/80/version/default/part/AttachmentData/data/ImportKey.java">ImportKey.java source</a> to your machine. You can just click on the link either here or from the agentbob.info link above and copy/paste the source into a text editor on your server. I had to make a change in the source (following the advice of somebody else who had a similar problem and posted the solution in the agentbob.info article&#8217;s comments) in order for the tool to work with chained/bundled certificates. I&#8217;ve created a <a href="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/ImportKey.java.diff">diff </a>to use to patch said source, you can also just copy and paste it into your text editor.</p>
<pre>patch ImportKey.java ImportKey.java.diff</pre>
<p>Step seven &#8211; Compile and run the ImportKey application:</p>
<p>javac ImportKey.java</p>
<p>java ImportKey fqdn.key.der fqdn.bundle.crt.der</p>
<p>Note that the resulting keystore file is going to be in your home directory, so if you&#8217;re running as root it will be /root/keystore.ImportKey. It has the alias &#8220;importkey&#8221; as well as the keystore password &#8220;importkey&#8221;; CHANGE IT:</p>
<p>Step eight &#8211; change the keystore password for your keystore:</p>
<pre>keytool -importkeystore -srckeystore /root/keystore.ImportKey -destkeystore importkey.jks</pre>
<p>When running the above command you&#8217;ll be asked to issue the new keystore password &#8211; do it. It will eventually ask you for the source keystore password, as mentioned above that password is &#8220;importkey&#8221;.</p>
<p>If your adito server doesn&#8217;t have a web browser you need to get the file to a machine that does have a web browser, as it&#8217;s through the web interface that we&#8217;ll be importing the newly created keystore &#8211; do that now.</p>
<p>Step nine &#8211; rerun `ant install`from your adito installation directory, if your adito server is currently running, stop it:</p>
<pre>cd /opt/adito0.9.1
/etc/init.d/adito stop
ant install</pre>
<p>Step nine, part 2 &#8211; When you get to the bit about &#8220;Starting installation wizard&#8230;&#8230;&#8230;.Point your browser to http://aditoserver:28080&#8243; do just that. There will be 2 screens to be concerned with:</p>
<p>Select &#8220;Import Existing Certificate&#8221; on the first screen.</p>
<p>&nbsp;</p>
<p><a href="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/step-1.jpg"><img class="alignnone size-medium wp-image-148" alt="step 1" src="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/step-1-300x197.jpg" width="300" height="197" /></a></p>
<p>&nbsp;</p>
<p>Fill in all the pertinent information on the following screen. (ignore my typo please)</p>
<p><a href="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/step-2.jpg"><img class="alignnone size-medium wp-image-149" alt="step 2" src="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/step-2-300x197.jpg" width="300" height="197" /></a></p>
<p>The remaining install screens should remember your settings from the prior install. If this is your first time running `ant install`, configure according to your needs.</p>
<p>When finished issue an adito start command:</p>
<pre>/etc/init.d/adito start</pre>
<p>And you should be finished. Open your adito site in a browser and verify your new certificate is installed and being presented.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.crummylogic.com/wordpress/?feed=rss2&#038;p=145</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
