<?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>Unwinding the Stack &#187; packages</title>
	<atom:link href="http://thestaticvoid.com/tag/packages/feed/" rel="self" type="application/rss+xml" />
	<link>http://thestaticvoid.com</link>
	<description>Explorations in Computing</description>
	<lastBuildDate>Wed, 07 Dec 2011 16:15:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The Solaris 11 Experience So Far</title>
		<link>http://thestaticvoid.com/post/2011/11/15/the-solaris-11-experience-so-far/</link>
		<comments>http://thestaticvoid.com/post/2011/11/15/the-solaris-11-experience-so-far/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 17:40:05 +0000</pubDate>
		<dc:creator>James Lee</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[nwam]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://thestaticvoid.com/?p=598</guid>
		<description><![CDATA[I have a system (a zone on which this blog is hosted) that has been running the same installation of Solaris since 11/11/2009, starting with OpenSolaris 2009.06. In the time since, it has seen every public build of OpenSolaris, then OpenIndiana, and finally Solaris 11 Express. Now, exactly two years later, I&#8217;ve updated it to [...]]]></description>
			<content:encoded><![CDATA[<p>I have a system (a zone on which this blog is hosted) that has been running the same installation of Solaris since 11/11/2009, starting with OpenSolaris 2009.06.  In the time since, it has seen every public build of OpenSolaris, then OpenIndiana, and finally Solaris 11 Express.  Now, exactly two years later, I&#8217;ve updated it to Solaris 11 11/11, and I&#8217;d like to share my experience so far.</p>
<p>The update itself did not go smoothly.  I was sitting at Solaris 11 Express SRU 8 and thought, like every update I&#8217;ve done in the past, that I could just run <tt>pkg image-update</tt>.  Silly me, because when I did and then rebooted, the kernel panicked.  No big deal, that&#8217;s what boot environments are for.  I reverted to the previous boot environment and found some <a href="http://download.oracle.com/docs/cd/E23824_01/html/E23811/glpgv.html#glpdr">helpful documentation</a> that told me to do exactly what I just did.  It turns out that there is no way to update to SRU 13 using the support repositories because they already contain the Solaris 11 11/11 packages, and <tt>pkg</tt> tries to pull some of them in.  And there is no way to update just <tt>pkg</tt> because the <tt>ips-consolidation</tt> prevents it, and trying to update the <tt>ips-consolidation</tt> pulls the <tt>entire</tt> package which breaks everything just the same.  In short, Oracle bungled it.  The only way to update to SRU 13 that I could see was to download the SRU 13 repository ISO from My Oracle Support and set up a local repository.  Once I was on SRU 13, I could continue with the update to the 11/11 release.  But there were more surprises in store for me.</p>
<p>First, it looks like <tt>pkg</tt> decided to start enforcing consistent attributes on files shared by multiple packages.  Fine, I can understand that.  As a result, I had to remove a lot of my custom packages (mostly from spec-files-extra) which I&#8217;ll have to rebuild.  Second, <tt>pkg</tt> decided it doesn&#8217;t like the opensolaris.org packages anymore so I had to uninstall OpenOffice.org.  Also fair enough.</p>
<p>Happily, after that, the updates got applied successfully and the system rebooted into the 11/11 release.  Next came the zone updates.  When I did the normal <tt>zoneadm -z foo detach &#038;&#038; zoneadm -z foo attach -u</tt> deal, I was told I had to convert my zones to a new ZFS structure which more closely matches the global zone.  The script <tt>/usr/lib/brand/shared/dsconvert</tt> actually worked flawlessly and the updated zones came up fine.</p>
<p>Unfortunately I couldn&#8217;t SSH into my zones because my DNS server didn&#8217;t know where they were.  It seems that with the updated networking framework, DHCP doesn&#8217;t request a hostname anymore.  (<tt>/etc/default/dhcpagent</tt> still says <tt>inet &lt;hostname&gt;</tt> can be put in <tt>/etc/hostname.&lt;if&gt;</tt> to request the hostname.)  I found that you can create an <tt>addr</tt> object that requests a hostname with <tt>ipadm create-addr -T dhcp -h &lt;hostname&gt; &lt;addrobj&gt;</tt>, but NWAM pretty much won&#8217;t let you create or modify anything with <tt>ipadm</tt>, and there were no options for requesting hostnames with <tt>nwamcfg</tt>.  As a result, I had to disable NWAM (<tt>netadm enable -p ncp DefaultFixed</tt>) and then I could set up the interface with <tt>ipadm</tt>.  Why doesn&#8217;t Solaris request hostnames by default?  Not very &#8220;cloud-like&#8221; if you ask me.</p>
<p>I have to say, I&#8217;m impressed by the way global zones and non-global zones are linked in the new release.  Zone updates were an obvious shortcoming of previous releases.  We&#8217;ll see how well it works when Solaris 11 Update 1 comes out.</p>
<p>What else&#8230;I lost my ability to <tt>pfexec</tt> to root.  Oracle removed the &#8220;Primary Administrator&#8221; profile for security reasons so I had to install sudo.  Not a big deal, I just wish they had said something a little louder about it.</p>
<p>Also, whatever update to <tt>pkg</tt> happened, it wiped out my repositories under <tt>/var/pkg</tt>.  I had to restore them from a snapshot.  Bad Oracle!</p>
<p>I&#8217;m also a little confused about some of the changes to the way networking settings are stored.  For example, when I first booted the global zone, I found that my NFSv4 domain name was reset by NWAM.  I set it to what it should be with <tt>sharectl set -p nfsmapid_domain=thestaticvoid.com nfs</tt>, but is that going to be overwritten again by NWAM?  Also, the name resolver settings are now stored in the <tt>svc:/network/dns/client:default</tt> service, and according to the documentation, DHCP will set the service properties properly, but I have yet to see this work.</p>
<p>And the last problem I&#8217;ll mention is that the update removed my virtual consoles.  I had to install the <tt>virtual-console</tt> package to restore them.</p>
<p>Overall, I&#8217;m happy that I was at least able to update to the latest release.  Oracle could have cut off any update path from OpenSolaris.  However, the update should have been a lot smoother.  It doesn&#8217;t speak well of future updates when I can&#8217;t even update from one supported release (SRU 8<span></span>) to another.  I also wish Oracle were more open about upcoming changes (as in, having more preview releases or, dare I say it, opening development the way OpenSolaris was).  Even to me, a long time pre-Solaris 11 user, the changes to zones and networking are huge in this release, and I would rather have not been so surprised by them.</p>
]]></content:encoded>
			<wfw:commentRss>http://thestaticvoid.com/post/2011/11/15/the-solaris-11-experience-so-far/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Wireless 802.1X Support in Solaris</title>
		<link>http://thestaticvoid.com/post/2011/06/09/wireless-802-1x-support-in-solaris/</link>
		<comments>http://thestaticvoid.com/post/2011/06/09/wireless-802-1x-support-in-solaris/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 01:53:29 +0000</pubDate>
		<dc:creator>James Lee</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[wpa]]></category>

		<guid isPermaLink="false">http://thestaticvoid.com/?p=557</guid>
		<description><![CDATA[The George Washington University (where I work and go to school) has recently implemented 802.1X to secure its wireless networks. 802.1X defines support for EAP over Ethernet (including wireless) and the WPA standards define several modes of EAP that can be used. Solaris (I&#8217;m referring to version 11, OpenSolaris, OpenIndiana, and Illumos) supports WPA. It [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://thestaticvoid.com/wordpress/wp-content/uploads/2011/06/wifi.jpg" alt="" title="WiFi" width="300" height="200" class="alignright size-full wp-image-583" /></p>
<p>The George Washington University (where I work and go to school) has recently implemented <a href="http://en.wikipedia.org/wiki/IEEE_802.1X">802.1X</a> to secure its wireless networks.   802.1X defines support for <a href="http://en.wikipedia.org/wiki/Extensible_Authentication_Protocol">EAP</a> over Ethernet (including wireless) and the <a href="http://en.wikipedia.org/wiki/Wi-Fi_Protected_Access">WPA</a> standards define several modes of EAP that can be used.</p>
<p>Solaris (I&#8217;m referring to version 11, OpenSolaris, OpenIndiana, and Illumos) supports WPA.  It modified an early version of <a href="http://hostap.epitest.fi/wpa_supplicant/">wpa_supplicant</a> and called it &#8220;<a href='http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/cmd-inet/usr.lib/wpad/'>wpad</a>&#8220;.  However, they seemed to make a point of stripping out all EAP support in wpad.</p>
<p>So when my Network Security instructor said we had to do a term project of our choosing relating to network security, I decided I&#8217;d try to get 802.1X working in Solaris.  To do this, I decided I could either add the EAP bits back into wpad, or add the Solaris-specific bits to the latest version of wpa_supplicant.  wpad is based on very old code.  It&#8217;s not even clear which version of wpa_supplicant it is based on, and there is no record of the massive amount of changes they made.  It would be too hard for me to figure out where to plug EAP back in, and who knows how many bugs and security vulnerabilities were fixed upstream that we&#8217;d be missing out on.</p>
<p>Fortunately, wpa_supplicant is very modular, and reasonably <a href="http://hostap.epitest.fi/wpa_supplicant/devel/porting.html">well documented</a>.  I was able to graft the older Solaris code onto the newer interfaces.  The result of my work is currently maintained in my own <a href="https://github.com/MrStaticVoid/hostap/compare/master...solaris">branch</a> at GitHub.  It&#8217;s not perfect, but it works (and I&#8217;ll explain how).  Solaris has a very limited public API for wireless support and my goal was to get wpa_supplicant working without having to modify any system libraries or the kernel.  I struggled to figure out some idiosyncrasies such as:</p>
<ul>
<li>Events (association, disassociation, etc.) are only sent to wpa_supplicant when WPA is <strong>enabled</strong> in the driver.</li>
<li>Full scan results are only available when WPA is <strong>disabled</strong> in the driver.</li>
<li>Scan results don&#8217;t provide nearly as much information as their Linux counterparts do, such as access point capabilities, signal strength, noise levels, etc.  I was very worried I wouldn&#8217;t be able to fill out the <a href="http://hostap.epitest.fi/wpa_supplicant/devel/structwpa__scan__res.html">scan results structure</a> fully and wpa_supplicant would refuse to work without complete information.</li>
</ul>
<p>Here is how you can get 802.1X support working on your Solaris laptop:</p>
<ol>
<li>Install the wpa_supplicant package from my package repository:
<pre class="terminal">
# <kbd>pkg set-publisher -p http://pkg.thestaticvoid.com/</kbd>
# <kbd>pkg install wpa_supplicant</kbd>
</pre>
</li>
<li>
<p>Add the configuration for your protected wireless networks to <tt>/etc/wpa_supplicant.conf</tt>.  Here is mine:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=0<br />
ap_scan=0<br />
<br />
network={<br />
&nbsp; &nbsp; ssid=&quot;prey&quot;<br />
&nbsp; &nbsp; key_mgmt=WPA-PSK<br />
&nbsp; &nbsp; psk=&quot;&lt;network key&gt;&quot;<br />
}<br />
<br />
network={<br />
&nbsp; &nbsp; ssid=&quot;GW1X&quot;<br />
&nbsp; &nbsp; key_mgmt=WPA-EAP<br />
&nbsp; &nbsp; eap=TTLS<br />
&nbsp; &nbsp; identity=&quot;jameslee&quot;<br />
&nbsp; &nbsp; anonymous_identity=&quot;anonymous&quot;<br />
&nbsp; &nbsp; password=&quot;&lt;personal password&gt;&quot;<br />
&nbsp; &nbsp; phase2=&quot;auth=PAP&quot;<br />
}</div></div>
<p>The most important thing here is <code class="codecolorer text default"><span class="text">ap_scan=0</span></code>.  This tells wpa_supplicant not to do any scanning or association of its own.  Those tasks will be handled by dladm and NWAM.
</li>
<li>
Backup <tt>/usr/lib/inet/wpad</tt> and replace it with this script:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<br />
<span style="color: #007800;">interface</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> $<span style="color: #000000; font-weight: bold;">@</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/.*-i *\([a-z0-9]*\).*/\1/'</span><span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>wpa_supplicant <span style="color: #660033;">-Dsolaris</span> -i<span style="color: #007800;">$interface</span> -c<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>wpa_supplicant.conf <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">&amp;</span></div></div>
</li>
</ol>
<p>Now connect to a wireless network with NWAM or dladm.  When prompted for a network key, enter anything; it won&#8217;t be used.  The actual keys will be looked up in <tt>/etc/wpa_supplicant.conf</tt>.  Here is an example of me connecting to my 802.1X-secured network using dladm:</p>
<pre class="terminal">
# <kbd>dladm connect-wifi -e GW1X -s wpa -k nwam-GW1X iwh0</kbd>
# <kbd>dladm show-wifi</kbd>
LINK       STATUS            ESSID               SEC    STRENGTH   MODE   SPEED
iwh0       connected         GW1X                wpa    excellent  g      54Mb
</pre>
<p>&#8220;<tt>-k nwam-GW1X</tt>&#8221; refers to a dummy key setup by NWAM.  dladm will complain if it&#8217;s not supplied a key.</p>
<p>That should be it!</p>
<h4>Future Directions</h4>
<p>Obviously, the integration of wpa_supplicant and NWAM/dladm leaves a lot to be desired.  If there is sufficient interest, I will start looking into how to modify the dladm security framework in Illumos to include EAP related configurations (keys, certificates, identities; it&#8217;s all much more complicated than the single pre-shared key that dladm supports now).  My hope, though, is that Oracle is already working on this.  <em>Do you hear that Oracle?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://thestaticvoid.com/post/2011/06/09/wireless-802-1x-support-in-solaris/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fun With vpnc</title>
		<link>http://thestaticvoid.com/post/2010/07/22/fun-with-vpnc/</link>
		<comments>http://thestaticvoid.com/post/2010/07/22/fun-with-vpnc/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 20:20:20 +0000</pubDate>
		<dc:creator>James Lee</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[snoop]]></category>
		<category><![CDATA[vpnc]]></category>

		<guid isPermaLink="false">http://thestaticvoid.com/?p=337</guid>
		<description><![CDATA[I recently got a new laptop at work and I decided to put OpenSolaris on it. This meant I had to setup vpnc in order to access the server networks and wireless here. I installed my vpnc package, copied the profile from my Ubuntu workstation, and started it up. It connected, but no packets flowed. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently got a new laptop at work and I decided to put OpenSolaris on it.  This meant I had to setup vpnc in order to access the server networks and wireless here.  I installed <a href="http://thestaticvoid.com/post/2010/02/26/vpnc-for-opensolaris/">my vpnc package</a>, copied the profile from my Ubuntu workstation, and started it up.  It connected, but no packets flowed.  I didn&#8217;t have time to investigate, so I decided to work on it some more at home.</p>
<p>The strange thing is that it connected from home with the very same profile and everything worked fine.  I immediately suspected something was wrong with the routing tables, like maybe some of the routes installed by <tt>vpnc-script</tt> were conflicting with the routes necessary to talk to the VPN concentrator.  I endlessly compared the routing tables between work and home and my working Ubuntu workstation, removing routes, adding routes, and manually constructing the routing table until I was positive it could not be that.</p>
<p>Everything I pinged worked.  I could ping the concentrator.  I could ping the gateway.  I could ping the tunnel device.  I could ping the physical interface&#8212;or so I thought.</p>
<p>As I was preparing to write a message to the <a href="http://news.gmane.org/gmane.network.vpnc.devel">vpnc-devel mailing list</a> requesting help, I did some pings to post the output in the email.  I ran</p>
<pre class="terminal">
$ <kbd>ping &lt;concentrator ip&gt;</kbd>
&lt;concentrator ip&gt; is alive
</pre>
<p>which looked good, but I wanted the full ping output, so I ran</p>
<pre class="terminal">
$ <kbd>ping -s &lt;concentrator ip&gt;</kbd>
PING &lt;concentrator ip&gt;: 56 data bytes
^C
----&lt;concentrator ip&gt; PING Statistics----
4 packets transmitted, 1 packets received, 75% packet loss
round-trip (ms)  min/avg/max/stddev = 9223372036854776.000/0.000/0.000/-NaN
</pre>
<p>For some reason, only the first ping was getting through.  The rest were getting hung up somewhere.  The really strange thing was that I saw the same behavior on the local physical interface:</p>
<pre class="terminal">
$ <kbd>ifconfig bge0</kbd>
bge0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 3
        inet 161.253.143.151 netmask ffffff00 broadcast 161.253.143.255
$ <kbd>ping -s 161.253.143.151</kbd>
PING 161.253.143.151: 56 data bytes
^C
----161.253.143.151 PING Statistics----
5 packets transmitted, 1 packets received, 80% packet loss
round-trip (ms)  min/avg/max/stddev = 9223372036854776.000/0.000/0.000/-NaN
</pre>
<p>I have never seen a situation where you couldn&#8217;t even ping a local physical interface!  I checked and double checked that IPFilter wasn&#8217;t running.  Finally I started a packet capture of the physical interface to see what was happening to my pings:</p>
<pre class="terminal">
# <kbd>snoop -d bge0 icmp</kbd>
Using device bge0 (promiscuous mode)
161.253.143.151 -> &lt;concentrator ip&gt; ICMP Destination unreachable (Bad protocol 50)
161.253.143.151 -> &lt;concentrator ip&gt; ICMP Destination unreachable (Bad protocol 50)
161.253.143.151 -> &lt;concentrator ip&gt; ICMP Destination unreachable (Bad protocol 50)
^C
</pre>
<p>That&#8217;s when by chance I saw messages being sent to the VPN concentrator saying &#8220;bad protocol 50.&#8221;  <a href="http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml">IP protocol</a> 50 represents &#8220;ESP&#8221;, commonly used for IPsec.  Apparently Solaris eats these packets.  Haven&#8217;t figured out why.</p>
<p>I remembered seeing something in the vpnc manpage about ESP packets:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">--natt-mode &lt;natt/none/force-natt/cisco-udp&gt;<br />
<br />
&nbsp; &nbsp; &nbsp; Which NAT-Traversal Method to use:<br />
&nbsp; &nbsp; &nbsp; o &nbsp; &nbsp;natt -- NAT-T as defined in RFC3947<br />
&nbsp; &nbsp; &nbsp; o &nbsp; &nbsp;none -- disable use of any NAT-T method<br />
&nbsp; &nbsp; &nbsp; o &nbsp; &nbsp;force-natt -- always use NAT-T encapsulation &nbsp;even<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;without presence of a NAT device (useful if the OS<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;captures all ESP traffic)<br />
&nbsp; &nbsp; &nbsp; o &nbsp; &nbsp;cisco-udp -- Cisco proprietary UDP &nbsp;encapsulation,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;commonly over Port 10000</div></div>
<p>I enabled <tt>force-natt</tt> mode, which encapsulates the ESP packet in a UDP packet, normally to get past NAT, and it started working!  In retrospect, I should have been able to figure that out much easier.  First, it pretty much says it on the <a href="http://www.unix-ag.uni-kl.de/~massar/vpnc/">vpnc homepage</a>: &#8220;Solaris (7 works, 9 only with &#8211;natt-mode forced).&#8221;  I didn&#8217;t even notice that.  Second, I should have realized that I was behind a NAT at home and not at work, so they would be using a different NAT-traversal mode by default.  Oh well, it was a good diagnostic exercise, hence the post to share the experience.</p>
<p>In other vpnc related news, I&#8217;ve ported <a href="http://www.whiteboard.ne.jp/~admin2/tuntap/">Kazuyoshi&#8217;s</a> <a href="http://www.whiteboard.ne.jp/~admin2/tuntap/source/openvpn/patch.openvpn-2.1.1.tun.c">patch</a> to the <tt>open_tun</tt> and <tt>solaris_close_tun</tt> functions of OpenVPN to the <tt>tun_open</tt> and <tt>tun_close</tt> functions of vpnc.  His sets up the tunnel interface a little bit differently and adds TAP support.  It solves the random problems vpnc had with bringing up the tunnel interface such as:</p>
<pre class="terminal">
# <kbd>ifconfig tun0</kbd>
tun0: flags=10010008d0&lt;POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4,FIXEDMTU&gt; mtu 1412 index 8
        inet 128.164.xxx.yy --> 128.164.xxx.yy netmask ffffffff
        ether f:ea:1:ff:ff:ff
# <kbd>ifconfig tun0 up</kbd>
ifconfig: setifflags: SIOCSLIFFLAGS: tun0: no such interface
# <kbd>dmesg | grep tun0</kbd>
Jul 23 14:56:05 swan ip: [ID 728316 kern.error] tun0: DL_BIND_REQ failed: DL_OUTSTATE
</pre>
<p>The changes are in the latest vpnc package available from my <a href="http://pkg.thestaticvoid.org:10000/">package repository</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thestaticvoid.com/post/2010/07/22/fun-with-vpnc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VPNC for OpenSolaris</title>
		<link>http://thestaticvoid.com/post/2010/02/26/vpnc-for-opensolaris/</link>
		<comments>http://thestaticvoid.com/post/2010/02/26/vpnc-for-opensolaris/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 20:02:16 +0000</pubDate>
		<dc:creator>James Lee</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[vpnc]]></category>

		<guid isPermaLink="false">http://thestaticvoid.com/?p=260</guid>
		<description><![CDATA[I&#8217;ve compiled VPNC and the requisite TUN/TAP driver for OpenSolaris so that I can access my work network from home. Kazuyoshi&#8217;s driver adds TAP functionality to the original TUN driver which hasn&#8217;t been updated in nine years. It&#8217;s a real testament to the stability of the OpenSolaris kernel ABI that the module still compiles, loads, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve compiled <a href="http://www.unix-ag.uni-kl.de/~massar/vpnc/">VPNC</a> and the requisite <a href="http://www.whiteboard.ne.jp/~admin2/tuntap/">TUN/TAP driver</a> for OpenSolaris so that I can access my work network from home.  Kazuyoshi&#8217;s driver adds TAP functionality to the original <a href="http://vtun.sourceforge.net/tun/">TUN driver</a> which hasn&#8217;t been updated in nine years.  It&#8217;s a real testament to the stability of the OpenSolaris kernel ABI that the module still compiles, loads, and works properly.</p>
<p>All of the software can be installed from my repository onto build 111 or higher:</p>
<pre class="terminal">
$ <kbd>pfexec pkg set-publisher -O http://pkg.thestaticvoid.com/ thestaticvoid</kbd>
$ <kbd>pfexec pkg install vpnc</kbd>
</pre>
<p>The tun driver should load automatically and create <tt>/dev/tun</tt>.  Now create a VPN profile configuration in <tt>/etc/vpnc/</tt>.  The configuration contains a lot of private information so I&#8217;m not going to share mine here, but <tt>/etc/vpnc/default.conf</tt> is a good start.</p>
<p>One thing I do like to do is make sure only certain subnets are tunneled through the VPN.  That way connecting to the VPN doesn&#8217;t interrupt any connections that are already established (for example, AIM).  To do that I create a script <tt>/etc/vpnc/gwu-networks-script</tt> containing</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Only tunnel GWU networks through VPN</span><br />
<span style="color: #007800;">CISCO_SPLIT_INC</span>=<span style="color: #000000;">2</span><br />
<span style="color: #007800;">CISCO_SPLIT_INC_0_ADDR</span>=161.253.0.0<br />
<span style="color: #007800;">CISCO_SPLIT_INC_0_MASK</span>=255.255.0.0<br />
<span style="color: #007800;">CISCO_SPLIT_INC_0_MASKLEN</span>=<span style="color: #000000;">16</span><br />
<span style="color: #007800;">CISCO_SPLIT_INC_0_PROTOCOL</span>=<span style="color: #000000;">0</span><br />
<span style="color: #007800;">CISCO_SPLIT_INC_0_SPORT</span>=<span style="color: #000000;">0</span><br />
<span style="color: #007800;">CISCO_SPLIT_INC_0_DPORT</span>=<span style="color: #000000;">0</span><br />
<span style="color: #007800;">CISCO_SPLIT_INC_1_ADDR</span>=128.164.0.0<br />
<span style="color: #007800;">CISCO_SPLIT_INC_1_MASK</span>=255.255.0.0<br />
<span style="color: #007800;">CISCO_SPLIT_INC_1_MASKLEN</span>=<span style="color: #000000;">16</span><br />
<span style="color: #007800;">CISCO_SPLIT_INC_1_PROTOCOL</span>=<span style="color: #000000;">0</span><br />
<span style="color: #007800;">CISCO_SPLIT_INC_1_SPORT</span>=<span style="color: #000000;">0</span><br />
<span style="color: #007800;">CISCO_SPLIT_INC_1_DPORT</span>=<span style="color: #000000;">0</span><br />
<br />
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vpnc<span style="color: #000000; font-weight: bold;">/</span>vpnc-script</div></div>
<p>then add <tt>Script /etc/vpnc/gwu-networks-script</tt> to the end of my VPN profile configuration.</p>
<p>Connecting to the VPN you should see messages like:</p>
<pre class="terminal">
$ <kbd>pfexec vpnc gwu</kbd>
Enter password for jameslee@&lt;no&gt;:
which: no ip in (/sbin:/usr/sbin:/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin)
which: no ip in (/sbin:/usr/sbin:/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin)
add net 128.164.&lt;no&gt;: gateway 128.164.&lt;no&gt;
add host 128.164.&lt;no&gt;: gateway 161.253.&lt;no&gt;
add net 161.253.0.0: gateway 128.164.&lt;no&gt;
add net 128.164.0.0: gateway 128.164.&lt;no&gt;
add net 128.164.&lt;no&gt;: gateway 128.164.&lt;no&gt;
add net 128.164.&lt;no&gt;: gateway 128.164.&lt;no&gt;
VPNC started in background (pid: 594)...
</pre>
<p>The <tt>vpnc-script</tt> will modify your <tt>/etc/resolv.conf</tt> and routing tables so be sure to run <tt>vpnc-disconnect</tt> when you are done with the connection to restore the original configuration.</p>
<p>Thanks to the good folks at <a href="http://www.infradead.org/openconnect.html">OpenConnect</a> for a well-maintained <a href="http://git.infradead.org/users/dwmw2/vpnc-scripts.git/blob/HEAD:/vpnc-script"><tt>vpnc-script</tt></a> which works on Solaris.  Spec files for these packages are available from my <a href="https://github.com/MrStaticVoid/specs/blob/master/vpnc.spec">GitHub</a> <a href="https://github.com/MrStaticVoid/specs/blob/master/tuntap.spec">repository</a> if you want to roll your own.</p>
]]></content:encoded>
			<wfw:commentRss>http://thestaticvoid.com/post/2010/02/26/vpnc-for-opensolaris/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MusicBrainz Picard</title>
		<link>http://thestaticvoid.com/post/2010/02/14/musicbrainz-picard/</link>
		<comments>http://thestaticvoid.com/post/2010/02/14/musicbrainz-picard/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 09:54:17 +0000</pubDate>
		<dc:creator>James Lee</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[picard]]></category>
		<category><![CDATA[qt]]></category>

		<guid isPermaLink="false">http://thestaticvoid.com/?p=241</guid>
		<description><![CDATA[MusicBrainz along with the Picard tagger is without a doubt the best way to organize and manage large collections of music. The tagger will fingerprint audio files and automatically correct their metadata and filenames. I&#8217;ve been using MusicBrainz since 2005, and even attempted to write my own tagger for it in Java back when Picard [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://musicbrainz.org/">MusicBrainz</a> along with the <a href="http://musicbrainz.org/doc/PicardTagger">Picard tagger</a> is without a doubt the best way to organize and manage large collections of music.  The tagger will fingerprint audio files and automatically correct their metadata and filenames.</p>
<p><a href="http://thestaticvoid.com/wordpress/wp-content/uploads/2010/02/picard.png"><img src="http://thestaticvoid.com/wordpress/wp-content/uploads/2010/02/picard-300x206.png" alt="" title="MusicBrainz Picard" width="300" height="206" class="aligncenter size-medium wp-image-244" /></a></p>
<p>I&#8217;ve been using MusicBrainz since 2005, and even attempted to write <a href="http://thestaticvoid.com/wsvn/junepimp/trunk/">my own tagger</a> for it in Java back when Picard didn&#8217;t exist.  When I switched to OpenSolaris, it was one of the programs I missed the most.  So I went about building a package for it.</p>
<p>Unfortunately, the software has a lot of complicated dependencies such as <a href="http://qt.nokia.com/">Qt</a> and <a href="http://www.ffmpeg.org/">FFmpeg</a> which aren&#8217;t included in OpenSolaris either.  FFmpeg I can understand; it infringes on countless software patents &lt;insert rant here&gt;.  But Qt?  There&#8217;s no reason for that.  It is easily the second most popular graphics toolkit for Unix.  Sure, the <a href="http://techbase.kde.org/Projects/KDE_on_Solaris/OpenSolaris">Solaris KDE</a> guys have a build of it, but it installs to a non-standard prefix and doesn&#8217;t include 64-bit libs.  No thank you.</p>
<p>Anyway, the package and its dependencies are up on my <a href="http://pkg.thestaticvoid.com/">package repository</a> for b132 and later.  You know the deal&#8230;<tt>pfexec pkg install picard</tt>.  Spec files are, as always, available from my <a href="https://github.com/MrStaticVoid/specs">GitHub repository</a>.</p>
<p>Now that I have a good start on the FFmpeg package, I&#8217;m going to keep working on it, adding support for more codecs and eventually build <a href="http://www.mplayerhq.hu/design7/news.html">MPlayer</a> so I can stop using <a href="http://solaris.homeunix.com/?q=node/24">this guy&#8217;s</a> less-than-ideal build.</p>
<p><strong>EDIT:</strong> Just FYI, in order to get nice antialiased fonts in Qt applications, I had to modify the fontconfig settings.  This is not necessary for GTK+ applications because they get their settings from the <tt>gnome-appearance-properties</tt> dialog.  So in <tt>~/.fonts.conf</tt> add:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #00bbdd;">&lt;!DOCTYPE fontconfig SYSTEM &quot;fonts.dtd&quot;&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fontconfig<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #808080; font-style: italic;">&lt;!-- &nbsp;Use the Antialiasing --&gt;</span> <br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;font&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;antialias&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fontconfig<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Other Qt appearance settings can be changed from the <tt>qtconfig</tt> dialog.</p>
]]></content:encoded>
			<wfw:commentRss>http://thestaticvoid.com/post/2010/02/14/musicbrainz-picard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Music Player Daemon on OpenSolaris</title>
		<link>http://thestaticvoid.com/post/2009/12/04/music-player-daemon-on-opensolaris/</link>
		<comments>http://thestaticvoid.com/post/2009/12/04/music-player-daemon-on-opensolaris/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 01:44:36 +0000</pubDate>
		<dc:creator>James Lee</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[mpd]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[packages]]></category>

		<guid isPermaLink="false">http://thestaticvoid.com/?p=188</guid>
		<description><![CDATA[MPD is essential software for me. It&#8217;s one of the few music players out there for Unix that does gapless playback and ReplayGain. It&#8217;s also nice that, because it&#8217;s a daemon, I&#8217;m not bound to any particular interface. Fortunately, there is a really good one in the form of Sonata. MPD is not included in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki">MPD</a> is essential software for me.  It&#8217;s one of the few music players out there for Unix that does gapless playback and ReplayGain.  It&#8217;s also nice that, because it&#8217;s a daemon, I&#8217;m not bound to any particular interface.  Fortunately, there is a really good one in the form of <a href="http://sonata.berlios.de/">Sonata</a>.</p>
<p>MPD is not included in OpenSolaris yet, so last weekend I built some packages for it.  The build has been stable for me and I&#8217;m happy with the state of the packages so I thought I&#8217;d share them.  First add my <a href="http://pkg.thestaticvoid.com/">package repository</a>:</p>
<pre class="terminal">
$ <kbd>pfexec pkg set-authority -O http://pkg.thestaticvoid.com/ thestaticvoid</kbd>
</pre>
<h3>MPD</h3>
<p>This package and its dependencies require OpenSolaris 2009.06 or newer.  Install it by typing <tt>pfexec pkg install mpd</tt>.  The following formats are supported:</p>
<pre class="terminal">
$ <kbd>mpd -V</kbd>
...
Supported decoders:
[mad] mp3 mp2
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[audiofile] wav au aiff aif
[faad] aac
[mp4] m4a mp4
[mpcdec] mpc
[wavpack] wv

Supported outputs:
shout null fifo ao solaris httpd 

Supported protocols:
file:// http://
</pre>
<p>I plan on adding ffmpeg support soon which will add support for even more codecs.</p>
<p>To run MPD, create a configuration file in your home directory like</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">port&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;6600&quot;<br />
music_directory &nbsp; &nbsp; &nbsp; &nbsp; &quot;~/music&quot;<br />
playlist_directory &nbsp; &nbsp; &nbsp;&quot;~/.mpd/playlists&quot;<br />
db_file &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;~/.mpd/mpd.db&quot;<br />
log_file &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;~/.mpd/mpd.log&quot;</div></div>
<p>Create any directories from the configuration file that don&#8217;t exist, such as <tt>~/.mpd/playlists</tt> and start the daemon by running <tt>mpd ~/.mpdconf</tt> as your user.  It will immediately build a library of your music.</p>
<p>Alternatively, mpd can be run system-wide, which just seems more appropriate to me for whatever reason.  The only complicated part about this is that you have to give MPD permission to write to the audio device.  Edit <tt>/etc/logindevperms</tt>, find the <tt>/dev/sound/*</tt> lines and change the mode to 0666 so that they look like:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/console&nbsp; &nbsp; 0666&nbsp; &nbsp; /dev/sound/*&nbsp; &nbsp; &nbsp; &nbsp; # audio devices<br />
/dev/vt/active&nbsp; 0666&nbsp; &nbsp; /dev/sound/*&nbsp; &nbsp; &nbsp; &nbsp; # audio devices</div></div>
<p>Logout and log back in for the settings to take effect.  Then modify <tt>/etc/mpd.conf</tt> to your liking and start the daemon by typing <tt>svcadm enable mpd</tt>.  You may have to <tt>svcadm refresh manifest-import</tt> for SMF to load the mpd manifest.</p>
<h3>mpdscribble</h3>
<p>I also built a package for <a href="http://mpd.wikia.com/wiki/Client:Mpdscribble">mpdscribble</a> which is a mature, well-maintained scrobbler for <a href="http://www.last.fm/">Last.fm</a>.  Install it by typing <tt>pfexec pkg install mpdscribble</tt>.  Set your Last.fm or Libre.fm username and password in <tt>/etc/mpdscribble.conf</tt> and start the daemon with <tt>svcadm enable mpdscribble</tt>.  That&#8217;s all there is to it.</p>
<h3>Sonata</h3>
<p>Sonata is a lightweight cilent for MPD.  Looks pretty nice too:</p>
<p><img src="http://thestaticvoid.com/wordpress/wp-content/uploads/2009/12/sonata.png" alt="Sonata" title="Sonata" width="408" height="326" class="aligncenter size-full wp-image-201" /></p>
<p>Because Sonata requires Python 2.5, and OpenSolaris 2009.06 only really supports Python 2.3, this package requires build 127 or newer.  Install it by typing <tt>pfexec pkg install sonata</tt>.  It can be launched from the Applications->Sound &#038; Video menu.</p>
]]></content:encoded>
			<wfw:commentRss>http://thestaticvoid.com/post/2009/12/04/music-player-daemon-on-opensolaris/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

