<?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>Technically  Amusing</title>
	<atom:link href="http://eison.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://eison.net</link>
	<description>Info, rants, and other techinical geekery (no, that&#039;s not a real word)</description>
	<lastBuildDate>Tue, 06 Mar 2012 01:30:01 +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>TACACS+: Is that a WLC, or are you just happy to see me?</title>
		<link>http://eison.net/2012/03/tacacs-is-that-wlc-or-are-you-just-happy-to-see-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tacacs-is-that-wlc-or-are-you-just-happy-to-see-me</link>
		<comments>http://eison.net/2012/03/tacacs-is-that-wlc-or-are-you-just-happy-to-see-me/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 00:46:39 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[tacacs]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://eison.net/?p=236</guid>
		<description><![CDATA[In an earlier post, we got started with a pretty basic TACACS+ configuration on an Ubuntu server. That config works pretty well for most, if not all, IOS devices. So, what about Cisco WLAN controllers? They&#8217;re definitely not IOS, but they do speak TACACS+ for administrative access, as well as RADIUS. This one was a [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://eison.net/2012/02/i-like-free-so-i-like-tacacs/" target="_blank">an earlier post</a>, we got started with a pretty basic TACACS+ configuration on an Ubuntu server. That config works pretty well for most, if not all, IOS devices.</p>
<p>So, what about Cisco WLAN controllers? They&#8217;re definitely not IOS, but they do speak TACACS+ for administrative access, as well as RADIUS.</p>
<p>This one was a little more difficult to get working, but not because of the config on the Ubuntu server. The difficulty was in putting (3) very important configurations together:</p>
<ol>
<li>You must configure authentication <strong>and</strong> authorization on the WLC for your login to work. Authentication configured without authorization will appear to log your user in, but will send you quickly back to the login prompt.</li>
<li>You must configure the order for authentication&#8211;with TACACS+ at the top of the list. If you don&#8217;t, local accounts will be used first.</li>
<li>It doesn&#8217;t appear that the <strong>service</strong> configuration in the TACACS+ user WLC group can exist with the service configuration for an existing group, so nested groups may be required.</li>
</ol>
<p><span id="more-236"></span><br />
<strong>#1</strong> should be pretty simple to understand: in your WLC, under <strong>Security > TACACS+</strong>, configure Authentication, Accounting, and Authorization each with the same servers and keys. I figured this out the easy way&#8211;asking Google if he knows of anyone else who got it working. <a href="http://www.my80211.com/home/2010/9/8/wlc-tacacs-config-note.html" target="_blank">Luckily for me, he knew of someone</a>.</p>
<p><strong>#2</strong> is also pretty easy, but easy to miss. It stumped me for quite awhile, because though I had TACACS+ servers configured properly in my WLC, packet captures on my Ubuntu server showed no packets from the WLC when I tried to login. That&#8217;s a pretty good clue that the WLC isn&#8217;t even trying to TACACS+ with the server.<br />
<a class="floatbox" href="http://eison.net/wp-includes/images/posts/tacacs_wlc/cisco_wlc_auth_priority.png" class="floatbox" rev="group:236" alt="Cisco WLC security"><img src="http://eison.net/wp-includes/images/posts/tacacs_wlc/cisco_wlc_auth_priority_thumb.png" alt="Cisco WLC security" /></a></p>
<p>A quick shout-out to Linux: thank you for making it easy for me to troubleshoot with tcpdump, on-board by default. I love you!</p>
<p><strong>#3</strong>, if you already know <a href="http://users.ox.ac.uk/~guym/" target="_blank">the answer, seems like a simple bit of code</a>, but more that one concept is at work. The first that I can see, is from the required code itself: roles, not just permitted commands:</p>
<pre class="brush: plain; title: ; notranslate">#
# WLC admins: the group 'l3_tacacs_users' is also a member of this group.
# Unfortunately, it has to be nested this way as users can only be
# members of ONE group.
#
group = wlc_admins {
        service = ciscowlc {
        role1 = ALL
        }
}</pre>
<p>There are other roles available, but in my case, only the highest level engineer will have access to the WLC, so I saw no need to configure otherwise. </p>
<p>The second concept is <a href="http://www.stben.net/tacacs/users_guide.html" target="_blank">nesting groups</a>, because users cannot be a member of more than one group just by listing them, like <strong>member = group1, group2</strong>. In my case, I wanted WLC administrators to come from the members of the <strong>l3_tacacs_users</strong> group, so I made that group a member of the <strong>wlc_admins</strong> group:</p>
<pre class="brush: plain; title: ; notranslate">group = l3_tacacs_users {
        default service = permit
        login = file /etc/passwd
        enable = file /etc/passwd
        service = exec {
                priv-lvl = 15
                }
        member = wlc_admins
}</pre>
<p>The last concept is one we&#8217;ve seen before: order matters. At least in my testing, my configuration would not work if the <strong>wlc_admins</strong> groups didn&#8217;t come <strong>before</strong> the <strong>l3_tacacs_users</strong> group. It makes sense, how can you refer to a group that you don&#8217;t know about yet?</p>
<p>Once I had all of those things in place, AAA logins to my WLC worked as desired. I just wish more was in the accounting log&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2012/03/tacacs-is-that-wlc-or-are-you-just-happy-to-see-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Puppetmaster XCVII: Getting your new server registered</title>
		<link>http://eison.net/2012/03/puppetmaster-xcvii-getting-your-new-server-registered/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=puppetmaster-xcvii-getting-your-new-server-registered</link>
		<comments>http://eison.net/2012/03/puppetmaster-xcvii-getting-your-new-server-registered/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 00:05:20 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[puppet]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://eison.net/?p=227</guid>
		<description><![CDATA[So, this post has nothing to do with low-rent horror movies. Sorry to disappoint. What it&#8217;s really about is the Puppet server management system deployed to keep general server Linux settings synchronized&#8211;stuff like NTP servers and user accounts. Puppet is extremely powerful, but this will only be an introduction to what it can do, as [...]]]></description>
			<content:encoded><![CDATA[<p>So, this post has nothing to do with low-rent horror movies. Sorry to disappoint.</p>
<p>What it&#8217;s really about is the <a href="http://puppetlabs.com/" target="_blank">Puppet</a> server management system deployed to keep general server Linux settings synchronized&#8211;stuff like NTP servers and user accounts. Puppet is extremely powerful, but this will only be an introduction to what it can do, as I&#8217;m learning as I go.</p>
<p>It may seem a little backward to start with the client configuration, but this really seems like the easiest part to me: tell the client who the server is, sign some certificates, and wait for the updates. The puppet master server is where all the heavy lifting is done.</p>
<p>Once the puppet master <strong>server</strong> is created and configured with manifests and such (take for granted that they exist already), it&#8217;s time to configure your client and get it registered.<br />
<span id="more-227"></span><br />
<strong>STEP 1: INSTALL THE AGENT</strong></p>
<pre class="brush: plain; title: ; notranslate">me@new-server:~$ sudo aptitude install puppet</pre>
<p>An Ubuntu server will tell you all of the packages that must be installed and will give you the option to continue. If you choose to continue, Ubuntu will install all of the packages then warn you that it could not start the puppet agent</p>
<pre class="brush: plain; title: ; notranslate"> * Starting puppet agent

puppet not configured to start, please edit /etc/default/puppet to enable
   ...done.</pre>
<p>which means you need to edit the file the message refers to. So, <strong>sudo nano /etc/default/puppet</strong>, change</p>
<pre class="brush: plain; title: ; notranslate"># Start puppet on boot?
START=no</pre>
<p>to</p>
<pre class="brush: plain; title: ; notranslate"># Start puppet on boot?
START=yes</pre>
<p>and save the file. Once saved, <strong>sudo service puppet start</strong>.</p>
<p><strong>STEP 2: AUTHENTICATE THE CLIENT</strong></p>
<p>Puppet uses certificates for authentication, so the master is basically a CA who signs certificates from the clients. Unless you tell the client otherwise, it&#8217;ll assume that the puppetmaster&#8217;s name is <strong>puppet</strong>, so you either have to handle that with DNS or by editing the client&#8217;s puppet.conf. I took the first route, which seemed easier to me.</p>
<p>On the client, we tell it to send it&#8217;s certificate to be signed by the puppetmaster by telling it to test:</p>
<pre class="brush: plain; title: ; notranslate">me@new-server:~$ sudo puppet agent --test
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
Exiting; no certificate found and waitforcert is disabled
me@new-server:~$</pre>
<p>Once that&#8217;s done, we have the puppetmaster approve the client&#8217;s certificate:</p>
<pre class="brush: plain; title: ; notranslate">me@puppet:/etc/puppet$ sudo puppetca --list
  new-server.local (6F:47:D1:6B:F3:B0:4B:94:00:92:5E:F7:E5:38:7C:C9)
me@puppet:/etc/puppet$</pre>
<pre class="brush: plain; title: ; notranslate">me@puppet:/etc/puppet$ sudo puppetca --sign new-server.local
notice: Signed certificate request for new-server.local
notice: Removing file Puppet::SSL::CertificateRequest new-server.local at '/var/lib/puppet/ssl/ca/requests/new-server.local.pem'
me@puppet:/etc/puppet$</pre>
<p>After the client certificate is signed, it&#8217;s no longer in the server&#8217;s pending list.</p>
<pre class="brush: plain; title: ; notranslate">me@puppet:/etc/puppet$ sudo puppetca --list
me@puppet:/etc/puppet$M</pre>
<p>At this stage, the client is essentially configured. Within the next 30 minutes, it will contact the puppet master to see if any new or changed catalog items exist for it&#8211;if they do, the client will make the changes. If you&#8217;re impatient like me, you can force the client to check in by forcing another test:</p>
<pre class="brush: plain; title: ; notranslate">me@new-server:~$ sudo puppet agent --test
warning: peer certificate won't be verified in this SSL session
info: Caching certificate for new-server.local
info: Caching certificate_revocation_list for ca
info: Caching catalog for new-server.local
info: Applying configuration version '1330636935'
notice: /Stage[main]//Package[ntp]/ensure: ensure changed 'purged' to 'present'
--- /etc/ntp.conf       2011-09-02 18:42:40.000000000 +0000</pre>
<p>Keep in mind that it&#8217;s possible that some of the client&#8217;s catalog cannot be completed while your user is logged in, depending on what the changes are. For instance, if the catalog for that client changes your user&#8217;s UID or GID, you&#8217;ll receive an error until your user is no longer logged in.</p>
<p>To be sure that your client is checking in on it&#8217;s own, just take a look at it&#8217;s <strong>syslog</strong>:</p>
<pre class="brush: plain; title: ; notranslate">me@new-server:~$ sudo more /var/log/syslog | grep puppet-agent</pre>
<p>Next time, we&#8217;ll take a look at the files that make up a &#8220;catalog&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2012/03/puppetmaster-xcvii-getting-your-new-server-registered/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco ASA: AnyConnect for phone using self-signed certificates for authentication</title>
		<link>http://eison.net/2012/02/cisco-asa-anyconnect-for-phone-using-self-signed-certificates-for-authentication/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cisco-asa-anyconnect-for-phone-using-self-signed-certificates-for-authentication</link>
		<comments>http://eison.net/2012/02/cisco-asa-anyconnect-for-phone-using-self-signed-certificates-for-authentication/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 02:23:47 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[asa]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[network]]></category>

		<guid isPermaLink="false">http://eison.net/?p=221</guid>
		<description><![CDATA[Yeah, I know the title is pretty boring, but I wanted it to be clear what this one is all about, especially if you&#8217;re looking specifically for something like this. So, here&#8217;s the deal: Cisco 99xx and 79xx phones out on the internet somewhere connecting back to an ASA over an SSL tunnel to register [...]]]></description>
			<content:encoded><![CDATA[<p>Yeah, I know the title is pretty boring, but I wanted it to be clear what this one is all about, especially if you&#8217;re looking specifically for something like this.</p>
<p>So, here&#8217;s the deal: Cisco 99xx and 79xx phones out on the internet somewhere connecting back to an ASA over an SSL tunnel to register with an internal network&#8217;s Call Manager, using only self-signed certificates. To me, this is the best option, rather than having users try to type usernames and passwords into the phone interface. For some users, that really is just too much to ask. This method makes it easy on them, and still gives the ASA administrator and Call Manager administrator the ability to prevent a stolen or misused phone from connecting to the network.<br />
<span id="more-221"></span><br />
This configuration absolutely depends on a few things:</p>
<ul>
<li>Working Call Manager that supports VPN configurations for phones. I have no idea what licenses or versions are required.</li>
<li>Working ASA, with it&#8217;s outside interface connected to the internet. This doesn&#8217;t work without internet access.</li>
<li>ASA is licensed specifically for &#8220;AnyConnect for phone&#8221;. <strong>show version</strong>, as well as some other commands, will tell you which features are enabled.</li>
</ul>
<p>Once those items are out of the way, the configuration for the ASA is pretty simple, as long as you understand the basics. This configuration is for code version 8.4, but 8.0+ is very similar. There are a few keywords that are different, so type slowly, rather than just bulk copy-and-paste.</p>
<p>A few things are happening here:</p>
<ul>
<li>generating keys to generate a self-signed certificate to share with the Call Manager</li>
<li>configuring a webvpn group-policy and tunnel-group that will allow the phone to connect to a very specific URL and present certificates for authentication</li>
<li>importing two certificates from Call Manager into the ASA</li>
</ul>
<p>If you read through the configuration example, my notes should explain each step. I also refer to a couple of Cisco documents that were very helpful.</p>
<pre class="brush: plain; collapse: true; light: false; title: ; toolbar: true; notranslate">
! based on this cisco.com ASA AnyConnect for Phone configuration example:
! https://supportforums.cisco.com/docs/DOC-9124
! http://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a00808efbd2.shtml

! generate crypto keypair for ASA
crypto key generate rsa label ssl_vpn_key modulus 1024

! create trustpoint and enroll with the self-signed key above
crypto ca trustpoint phone_ssl_vpn_trustpoint
 enrollment self
 fqdn ac-phone.your-domain-here.com
 subject-name CN=ac-phone.your-domain-here.com
 keypair ssl_vpn_key
 exit

crypto ca enroll phone_ssl_vpn_trustpoint noconfirm
ssl trust-point phone_ssl_vpn_trustpoint outside

! export the certificate trustpoint to import into CallManager
crypto ca export phone_ssl_vpn_trustpoint identity-certificate

! copy the anyconnect client to the ASA
copy tftp://&lt;tftp_server&gt;/anyconnect-win-3.0.5080-k9.pkg flash

! enable webvpn and select an image
webvpn
anyconnect image disk0:/anyconnect-win-3.0.5080-k9.pkg 1
enable outside
anyconnect enable

! create an IP pool not already in use and assign
ip local pool ac_phone_ip_pool_01 10.0.242.1-10.0.242.255 mask 255.255.255.0

! create group policy for phones
group-policy gp_anyconnect_phone internal
group-policy gp_anyconnect_phone attributes
 dns-server value 10.10.41.183 10.10.41.4
 vpn-tunnel-protocol ssl-client
 default-domain &lt; value your-domain-here.com &gt;
 address-pools value ac_phone_ip_pool_01

! permit interface ACL bypass for IPSec and SSL clients globally
sysopt connection permit-vpn

! create a certificate map to map the 'ac-phone' certificate to a specific
! tunnel-group: 'tg_anyconnect_phone' --&gt; 10
! this will be the cert the phone presents as a part of it's authentication.
! when presented, it'll trigger the use of the tunnel-group below.
crypto ca certificate map cm_anyconnect_phone 10
subject-name co ac-phone

! create a tunnel group and URL alias
tunnel-group tg_anyconnect_phone type remote-access
tunnel-group tg_anyconnect_phone general-attributes
 default-group-policy gp_anyconnect_phone
  username-from-certificate CN

tunnel-group tg_anyconnect_phone webvpn-attributes
 authentication certificate
 group-alias anyconnect-phone enable
 ! this URL has to exactly match what's in the CallManager config
 group-url https://name-or-ip-of-outside-int-of-asa/anyconnect-phone enable
 ! permit rules to determine which tunnel-group is used
 tunnel-group-map enable rules
 ! match the certificate map to the tunnel-group
 tunnel-group-map cm_anyconnect_phone 10 tg_anyconnect_phone

! configure nat exemption (no nat, nat 0) for phone address pool, version 8.3 and above
! https://supportforums.cisco.com/docs/DOC-11639, bug is fixed in later version of 8.3, 8.4
! http://tools.cisco.com/Support/BugToolKit/search/getBugDetails.do?method=fetchBugDetails&amp;bugId=CSCtf89372
object network obj_ac_phone_ip_pool_01
 ! subnet &lt;ac_phone_ip_pool_network&gt; &lt;ac_phone_ip_pool_netmask&gt;
 subnet 10.0.242.0 255.255.255.0

nat (INSIDE,OUTSIDE) source static any any destination static obj_ac_phone_ip_pool_01 obj_ac_phone_ip_pool_01

! create new trustpoints and import CallManager certificates
!
! IP phones that have MICs: 99xx
crypto ca trustpoint Cisco_Manufacturing_CA
 enrollment terminal
crypto ca authenticate Cisco_Manufacturing_CA
! &lt; paste Cisco_Manufacturing_CA pem &gt;

! IP phones that have CAPFs: 79xx
crypto ca trustpoint CAPF
 enrollment terminal
crypto ca authenticate CAPF
! &lt; paste Cisco_Manufacturing_CA pem &gt;
</pre>
<p>All of the configuration words that have underscores are my own and can be changed to anything you choose&#8211;as long as you&#8217;re consistent with them. I&#8217;ve tried to make a habit of using underscores for my configuration variables, since Cisco doesn&#8217;t use them in configuration keywords. I also like to use <strong>gp_</strong>, <strong>tg_</strong>, and other similar abbreviations so it&#8217;s really clear in my configurations which items are which based on their names alone.</p>
<p>This configuration absolutely works. In fact, we have our phones configured with a primary and secondary &#8220;concentrator&#8221; (ASA); if the primary doesn&#8217;t answer, the phone will automatically try to connect to the secondary.</p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2012/02/cisco-asa-anyconnect-for-phone-using-self-signed-certificates-for-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I like free, so I like TACACS+</title>
		<link>http://eison.net/2012/02/i-like-free-so-i-like-tacacs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-like-free-so-i-like-tacacs</link>
		<comments>http://eison.net/2012/02/i-like-free-so-i-like-tacacs/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 22:04:23 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[tacacs]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://eison.net/?p=194</guid>
		<description><![CDATA[Yes, I still like free stuff, even though I&#8217;m turning into a bit of a Mac fanboy. Ubuntu and I remain very close, just not as my daily (desktop) driver. I am leaning on Ubuntu as my new server platform at work, however, since it&#8217;s so much easier to count on than CentOS. And as [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, I <em>still</em> like free stuff, even though I&#8217;m turning into a bit of a Mac fanboy. Ubuntu and I remain very close, just not as my daily (desktop) driver.</p>
<p>I am leaning on Ubuntu as my new server platform at work, however, since it&#8217;s so much easier to count on than CentOS. And as I wrote last, TACACS+ authentication for network device administration is one of my current projects.</p>
<p>There are several pieces to that project,</p>
<ul>
<li>setting up two servers</li>
<li>configuring them the same</li>
<li>configuring TACACS+ user accounts that can&#8217;t login to the server</li>
<li>sync-ing the TACACS+ user accounts between servers, with one as primary</li>
<li>sync-ing the TACACS+ config file between servers</li>
</ul>
<p>but this post is only going to focus on getting TACACS+ installed on Ubuntu 11.10 server (64-bit) and the configuration file. In a later post, we&#8217;ll take a look at IOS, ASA, and NX OS configurations for AAA that I&#8217;ve found to work well. As always, &#8220;your mileage may vary&#8221;, but I&#8217;d love to know of any tricks or tips others might have. I&#8217;m definitely not claiming to have invented this stuff.</p>
<p>On to the installation!</p>
<p><span id="more-194"></span></p>
<p>With Ubuntu 11.10, the command line installation process is extremely complicated:</p>
<p><code>me@tacacs-server-1:~$ sudo aptitude install tacacs+</code></p>
<p>Ubuntu will install any required dependencies and will create a sample config file, <strong>/etc/tacacs+/tac_plus.conf</strong>. Generally speaking, I like to copy the original config file for safe keeping before I make any changes to it, so let&#8217;s do that before we move on.</p>
<p><code>me@tacacs-server-1:~$ sudo cp /etc/tacacs+/tac_plus.conf /etc/tacacs+/tac_plus.conf.orig</code></p>
<p>Whew! It felt good to be so responsible!</p>
<p>It&#8217;s also important to know that many Ubuntu servers/services have &#8220;config&#8221; files in <strong>/etc/default</strong> that set values or start-up parameters, so if we take a look there, we see that a file does exist for TACACS+ and it states which config file to use when the service starts:</p>
<p><code>me@tacacs-server-1:~$ more /etc/default/tacacs+<br />
# This is the configuration file for /etc/init.d/tacacs+<br />
# You can overwrite default arguments passed to the daemon here.<br />
# See man(8) tac_plus</p>
<p>DAEMON_OPTS="-C /etc/tacacs+/tac_plus.conf"<br />
me@tacacs-server-1:~$</code></p>
<p>The default config file location is good with me, so I&#8217;ll leave that file as it is. It&#8217;s also important to know that <em>root</em> is the only user who can do anything with the TACACS+ config file, which is a critical part of securing this service.</p>
<p><code>me@tacacs-server-1:~$ ls -la /etc/tacacs+/<br />
total 16<br />
drwxr-xr-x  2 root root 4096 2012-01-18 14:25 .<br />
drwxr-xr-x 83 root root 4096 2012-02-05 23:19 ..<br />
-rw-------  1 root root 3348 2012-02-05 23:12 tac_plus.conf<br />
-rw-------  1 root root 1413 2012-01-18 14:25 tac_plus.conf.orig<br />
me@tacacs-server-1:~$</code></p>
<p>My goal, when configuring these servers, is to have user accounts that are local Linux accounts&#8211;so all user accounts can be administered in one place&#8211;but I don&#8217;t want those Linux users to be able to login to the server locally or via ssh. The config file below reflects Linux accounts, though you should note that it&#8217;s possible to create user accounts in a separate config file, that are <strong>not</strong> Linux user accounts. That wasn&#8217;t a part of my plan, so I&#8217;m not going to cover it.</p>
<p>Here&#8217;s my config file:</p>
<pre class="brush: plain; collapse: true; light: false; title: ; toolbar: true; notranslate"># Created by Henry-Nicolas Tourneur(henry.nicolas@tourneur.be)
# See man(5) tac_plus.conf for more details

# Define where to log accounting data, this is the default.
#
accounting file = /var/log/tac_plus_acct.log

# This is the key that clients have to use to access Tacacs+
#
key = your_secret_key_here

# Use /etc/passwd file to do authentication
#
default authentication = file /etc/passwd

#
# ACLs that may be used to restrict users' access to certain hosts
#
acl = switch01_users_acl {
        # allow access to only one device, switch01
        permit = 10.10.10.10
}

#
# These tacacs+ user groups are not actually tied to the local
# Linux groups, but we'll use the same names here.
#
#
# &quot;level 3&quot; users, with no restrictions
#
group = l3_tacacs_users {
        default service = permit
        login = file /etc/passwd
        enable = file /etc/passwd
        service = exec {
                priv-lvl = 15
                }
}

#
# &quot;level 2&quot; users who cannot &quot;debug&quot; or &quot;config&quot;
#
group = l2_tacacs_users {
        default service = permit
        login = file /etc/passwd
        enable = file /etc/passwd
        service = exec {
                priv-lvl = 15
                }
        cmd = configure {
                deny &quot;.&quot;
                }
        cmd = debug {
                deny &quot;.&quot;
                }
}

#
# &quot;level 1&quot; users permitted to &quot;show&quot;, &quot;ping&quot;, &quot;telnet&quot;,
# &quot;exit&quot;, and &quot;quit&quot;
#
group = l1_tacacs_users {
        default service = deny
        login = file /etc/passwd
        enable = file /etc/passwd
        service = exec {
                priv-lvl = 15
                }
        cmd = show {
                permit &quot;.&quot;
        }
        cmd = ping {
                permit &quot;.&quot;
        }
        cmd = telnet {
                permit &quot;.&quot;
        }
        cmd = exit {
                permit &quot;^(&lt;cr&gt;)?$&quot;
        }
        cmd = quit {
                permit &quot;^(&lt;cr&gt;)?$&quot;
        }
}

#
# Users outside of Net-Ops group, probably restricted to specific hosts
# and specific commands.
#
group = switch01_users {
        default service = permit
        login = file /etc/passwd
        enable = file /etc/passwd
        service = exec {
                priv-lvl = 15
                }
        cmd = show {
                permit &quot;.&quot;
        }
        cmd = ping {
                permit &quot;.&quot;
        }
        cmd = exit {
                permit &quot;^(&lt;cr&gt;)?$&quot;
        }
        cmd = quit {
                permit &quot;^(&lt;cr&gt;)?$&quot;
        }
        acl = switch01_users_acl
}

#
# Assign Linux users to tacacs+ groups
#
user = dave {
        member = l3_tacacs_users
}

user = simon {
        member = l2_tacacs_users
}

user = theodore {
        member = l1_tacacs_users
}

user = alvin {
        member = switch01_users
}

# You can use feature like per host key with different enable passwords
#host = 127.0.0.1 {
#        key = test
#        type = cisco
#        enable = &lt;des|cleartext&gt; enablepass
#        prompt = &quot;Welcome XXX ISP Access Router \n\nUsername:&quot;
#}

# We also can define local users and specify a file where data is stored.
# That file may be filled using tac_pwd
#user = test1 {
#    name = &quot;Test User&quot;
#    member = staff
#    login = file /etc/tacacs/tacacs_passwords
#}

# We can also specify rules valid per group of users.
#group = group1 {
#       cmd = conf {
#               deny
#       }
#}

# Another example : forbid configure command for some hosts
# for a define range of clients
#group = group1 {
#       login = PAM
#       service = ppp
#       protocol = ip {
#               addr = 10.10.0.0/24
#       }
#       cmd = conf {
#               deny .*
#       }
#}

user = DEFAULT {
        login = PAM
        service = ppp protocol = ip {}
}

# Much more features are available, like ACL, more service compatibilities,
# commands authorization, scripting authorization.
# See the man page for those features.</pre>
<p>If you read through the comments, you can get a pretty good idea of what my goals are:</p>
<ul>
<li>modularity</li>
<li>at least 4 levels of user&#8211;level-3, level-2, level-1, and special cases</li>
<li>use the local Linux user database, rather than another config file with either clear-text passwords, or passwords I&#8217;d have to encrypt with <strong>tac_pwd</strong></li>
</ul>
<p>Though I&#8217;m not 100% positive, I believe that they order of the sections is very important. During my testing with ACLs, it seemed that ACLs had to come first, then groups, then users. I also didn&#8217;t have any luck with not assigning a user to a group and trying to assign an ACL to him.</p>
<p>This is a working config, though, tested on real Cisco equipment&#8211;IOS, ASA, and NX OS. And it&#8217;s free. Well, you do have to have internet access to read it, so not completely free, unless you&#8217;ve hacked your neighbor&#8217;s wireless, though you didn&#8217;t learn that from me.</p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2012/02/i-like-free-so-i-like-tacacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A tip or two for VMware Fusion (OS X) guest networking</title>
		<link>http://eison.net/2012/01/a-tip-or-two-for-vmware-fusion-os-x-guest-networking/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-tip-or-two-for-vmware-fusion-os-x-guest-networking</link>
		<comments>http://eison.net/2012/01/a-tip-or-two-for-vmware-fusion-os-x-guest-networking/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 02:17:34 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[fusion]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[tacacs]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://eison.net/?p=175</guid>
		<description><![CDATA[Before I get into this post too far, yes, I&#8217;m now a Mac user. Not exactly a fanboy yet, but my new employer let me choose between a Windows laptop and a MacBook for my work computer, so I chose&#8211;wisely. I&#8217;d been using Ubuntu on an HP laptop (ugh to HP) for a few years, [...]]]></description>
			<content:encoded><![CDATA[<p>Before I get into this post too far, yes, I&#8217;m now a Mac user. Not exactly a fanboy yet, but my new employer let me choose between a Windows laptop and a MacBook for my work computer, so I chose&#8211;wisely. I&#8217;d been using Ubuntu on an HP laptop (ugh to HP) for a few years, so it seemed like a chance to try something new at no cost to me, which is my favorite cost.</p>
<p>As you can see from my other posts about virtualization, I&#8217;m a big fan of Virtualbox, but this post is about VMware Fusion, which was provided to me with my MacBook.</p>
<p>On to the tips&#8230;</p>
<p>I&#8217;ve been creating a testing environment for <a href="http://en.wikipedia.org/wiki/TACACS%2B" title="tacacs+" target="_blank">tacacs+</a> servers for a Cisco networking environment as well as <a href="http://puppetlabs.com/" title="Puppet" target="_blank">Puppet</a> server management, and I&#8217;m <strong>horrible</strong> with remembering IP addresses, unless there&#8217;s a very distinct pattern. When you use NAT in Fusion, addresses are assigned to guests VMs via DHCP in an automatically generated scope. The problem is, every time you boot your server you may get a new DHCP address! That sucks.</p>
<p>What to do?</p>
<p><span id="more-175"></span><br />
You could create reservations, like <a href="http://www.thirdbit.net/articles/2008/03/04/dhcp-on-vmware-fusion/" title="this post" target="_blank">this post</a> and <a href="http://nileshk.com/2009/06/24/vmware-fusion-nat-dhcp-and-port-forwarding.html" title="this post" target="_blank">this post</a> suggest, but since I&#8217;m eventually going to import the VMS I create into an ESXi host, it doesn&#8217;t hurt me to configure the guest&#8217;s network statically, as long as I know the range I can use for my guests.</p>
<p>If I look at my Mac&#8217;s dhcp.conf,</p>
<p><code>macbook:~ me$ more /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf</code></p>
<p>I see:</p>
<p><code>subnet 172.16.237.0 netmask 255.255.255.0 {<br />
        range 172.16.237.128 172.16.237.254;<br />
        option broadcast-address 172.16.237.255;<br />
        option domain-name-servers 172.16.237.2;<br />
        option domain-name localdomain;<br />
        default-lease-time 1800;                # default is 30 minutes<br />
        max-lease-time 7200;                    # default is 2 hours<br />
        option netbios-name-servers 172.16.237.2;<br />
        option routers 172.16.237.2;<br />
}</code></p>
<p>I see that the DHCP scope for my NAT network doesn&#8217;t completely consume the whole /24 network&#8211;it only uses the &#8220;bottom&#8221; half. So, if I statically assign my guests addresses in the &#8220;top&#8221; half of the /24 network, my guests will still be on the same network.</p>
<p>So, if I configure my Ubuntu guest&#8217;s <strong>/etc/network/interfaces</strong> like this</p>
<p><code>iface eth0 inet static<br />
address 172.16.237.100<br />
netmask 255.255.255.0<br />
gateway 172.16.237.2</code></p>
<p>and add an entry to my MacBook&#8217;s <strong>/etc/hosts</strong> like this</p>
<p><code># my local VMs<br />
172.16.237.100 guest01</code></p>
<p>my MacBook knows how to find <strong>guest01</strong> by name, not just IP address!</p>
<p><code>macbook:~ me$ ping guest01<br />
PING guest01 (172.16.237.100): 56 data bytes<br />
64 bytes from 172.16.237.100: icmp_seq=0 ttl=64 time=0.345 ms<br />
64 bytes from 172.16.237.100: icmp_seq=1 ttl=64 time=0.233 ms<br />
^C<br />
--- guest01 ping statistics ---<br />
2 packets transmitted, 2 packets received, 0.0% packet loss<br />
round-trip min/avg/max/stddev = 0.233/0.289/0.345/0.056 ms</code></p>
<p>When I&#8217;m ready to import/convert my Fusion guest into our ESXi host, I just need to edit the guest&#8217;s <strong>/etc/network/interfaces</strong> again with the new IP address information.</p>
<p>Booyah!</p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2012/01/a-tip-or-two-for-vmware-fusion-os-x-guest-networking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtualbox 4.0 = good stuff</title>
		<link>http://eison.net/2010/12/virtualbox-4-0-good-stuff/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=virtualbox-4-0-good-stuff</link>
		<comments>http://eison.net/2010/12/virtualbox-4-0-good-stuff/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 18:09:20 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://eison.net/?p=166</guid>
		<description><![CDATA[Virtualbox is definitely my favorite virtualization tool. Yes, I know there are other, more popular ones, but Virtualbox is free, runs on many platforms, and isn&#8217;t clunky to use, like some unnamed others. We all have our preferences, and Virtualbox is definitely mine. I haven&#8217;t had a lot of time to kick the tires yet, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://virtualbox.org">Virtualbox</a> is definitely my favorite virtualization tool. Yes, I know there are other, <a href="http://www.vmware.com/products/workstation/">more popular ones</a>, but Virtualbox is free, runs on many platforms, and isn&#8217;t clunky to use, like some <a href="http://wiki.qemu.org/Main_Page">unnamed others</a>. We all have our preferences, and Virtualbox is definitely mine.</p>
<p>I haven&#8217;t had a lot of time to kick the tires yet, but one of the best features I&#8217;ve found in the latest, 4.0, version is an <strong>easy</strong> method to export virtual machines that you&#8217;ve built. There were <a href="http://www.google.com/#hl=en&#038;expIds=17259,18168,23756,24472,24692,24878,24879,27147,27400&#038;sugexp=ldymls&#038;xhr=t&#038;q=clone+virtualbox+machine&#038;cp=24&#038;pf=p&#038;sclient=psy&#038;site=&#038;source=hp&#038;aq=0&#038;aqi=&#038;aql=&#038;oq=clone+virtualbox+machine&#038;gs_rfai=&#038;pbx=1&#038;fp=a20cfd04ba3c5cf9">ways</a> to do it before, but now it&#8217;s <strong>easy</strong>.</p>
<p>Once you&#8217;ve installed/upgraded to version 4.0, simply choose <strong>Export Appliance</strong> from the <strong>File</strong> menu of the Virtualbox Manager. The first one I did took less than 10 minutes from start to finish, all wrapped-up in a single file.</p>
<p><a class="floatbox" href="http://eison.net/wp-includes/images/posts/virtualbox4/virtualbox_4-0.png" class="floatbox" rev="group:166" alt="Virtualbox Manager"><img src="http://eison.net/wp-includes/images/posts/virtualbox4/virtualbox_4-0_thumb.png" alt="Virtualbox Manager" /></a></p>
<p>Like I said: good stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2010/12/virtualbox-4-0-good-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fast Web Installer is&#8230;well&#8230;fast.</title>
		<link>http://eison.net/2010/07/fast-web-installer-is-well-fast/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fast-web-installer-is-well-fast</link>
		<comments>http://eison.net/2010/07/fast-web-installer-is-well-fast/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 22:09:57 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://eison.net/?p=156</guid>
		<description><![CDATA[If you like AppBrain as much as I do, you&#8217;ll love their new Fast Web Installer. With Fast Web Installer, there are just two steps to super-easy, auto-magic Android app installs: Use the Fast Web Installer app to register your device with AppBrain. Login to the AppBrain website from any computer with internet access, and [...]]]></description>
			<content:encoded><![CDATA[<p>If you like AppBrain as much as I do, you&#8217;ll <strong>love</strong> their new <a href="http://www.appbrain.com/app/com.appspot.swisscodemonkeys.apppusher">Fast Web Installer</a>. With Fast Web Installer, there are just two steps to super-easy, auto-magic Android app installs:</p>
<ol>
<li>Use the Fast Web Installer app to register your device with AppBrain.</li>
<li>Login to the AppBrain website from any computer with internet access, and go shopping for the app(s) you want to install.</li>
</ol>
<p>In a few moments, you should see a notification on your phone that your app(s) has been installed!<br />
<!-- I *did* add this myself, reison --><br />
<a href="http://www.eison.net/hammy/lush.php"><span style="display: none;">inactive</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2010/07/fast-web-installer-is-well-fast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XBMC + Android = superawesome</title>
		<link>http://eison.net/2010/07/xbmc-android-superawesome/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=xbmc-android-superawesome</link>
		<comments>http://eison.net/2010/07/xbmc-android-superawesome/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 21:13:09 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[htpc]]></category>
		<category><![CDATA[qr]]></category>
		<category><![CDATA[xbmc]]></category>

		<guid isPermaLink="false">http://eison.net/?p=152</guid>
		<description><![CDATA[It&#8217;s true that there&#8217;ve been XBMC/Boxee remotes available in the Android Market for quite awhile, but only recently has there been an &#8220;official&#8221; one from the XBMC Team&#8230;and it blows the others away. I&#8217;d share my own screenshots I&#8217;ve taken with drocap2, but xbmc.org has plenty, as well as the system requirements and a QR [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s true that there&#8217;ve been XBMC/Boxee remotes available in the Android Market for quite awhile, but only recently has there been an &#8220;official&#8221; one from the XBMC Team&#8230;and it blows the others away. I&#8217;d share my own screenshots I&#8217;ve taken with <a href="http://www.appbrain.com/app/com.gmail.nagamatu.drocap2">drocap2</a>, but <a href="http://xbmc.org/freezy3k/2010/07/13/official-xbmc-remote-for-android/">xbmc.org</a> has plenty, as well as the system requirements and a QR link for the Market.</p>
<p>I&#8217;ve used it quite a bit with my HTPC, and frankly prefer it to my <a href="http://www.streamzap.com/">Streamzap remote</a>. Another bonus is that now I don&#8217;t have to copy my custom Lircmap.xml over every time XMBC is updated.</p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2010/07/xbmc-android-superawesome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu, Linksys WUSB600N v1, Dish DVR: whose @#$% idea was this?</title>
		<link>http://eison.net/2010/07/ubuntu-linksys-wusb600n-v1-dish-dvr-whose-idea-was-this/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-linksys-wusb600n-v1-dish-dvr-whose-idea-was-this</link>
		<comments>http://eison.net/2010/07/ubuntu-linksys-wusb600n-v1-dish-dvr-whose-idea-was-this/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 23:47:48 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[htpc]]></category>
		<category><![CDATA[linksys]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://eison.net/?p=98</guid>
		<description><![CDATA[I love Ubuntu and give myself a little &#8220;mental hug&#8221; each day for making the switch from Windows to Linux. But, sometimes, the stuff I want/need to do in Linux just isn&#8217;t as obvious to me as I&#8217;d like; so, I beat my head against a wall trying to figure it out, until my wife [...]]]></description>
			<content:encoded><![CDATA[<p>I love Ubuntu and give myself a little &#8220;mental hug&#8221; each day for making the switch from Windows to Linux. But, sometimes, the stuff I want/need to do in Linux just isn&#8217;t as obvious to me as I&#8217;d like; so, I beat my head against a wall trying to figure it out, until my wife gives me that &#8220;walk away from it for awhile so you can maintain the little bit of sanity you have left&#8221; look. This particular situation is one of those.</p>
<p><strong>What I wanted to do:</strong> I have a Dish Network DVR in my living room that has an ethernet card in it, but I don&#8217;t have any ethernet wiring where it is. What I <strong>do</strong> have is an Ubuntu <a href="http://xbmc.org/" target="_blank">XBMC</a> <a href="http://en.wikipedia.org/wiki/Htpc target="_blank">HTPC</a> with an on-board ethernet card and a Linksys <a href="http://homesupport.cisco.com/en-us/wireless/lbc/WUSB600N?referrer=www.linksysbycisco.com target="_blank">WUSB600N</a> v1 (the version number is important here, I think), connected to a Linksys <a href="http://homesupport.cisco.com/en-us/wireless/lbc/WAP610N" target="_blank">WAP610N</a> AP (configured for 5GHz 802.11N only), so it stands to reason that I <em>should</em> be able to share the HTPC&#8217;s internet connection with the Dish DVR, right?</p>
<p><a class="floatbox" href="http://eison.net/wp-includes/images/posts/htpc/htpc.jpg" class="floatbox" rev="group:98" alt="Network Diagram"><img src="http://eison.net/wp-includes/images/posts/htpc/htpc_thumb.jpg" alt="Network Diagram" /></a></p>
<p>Ok, so it wasn&#8217;t. Twice. Once for Ubuntu 9.10 (Karmic) and once for 10.04 (Lucid).<br />
<span id="more-98"></span></p>
<p>The first thing all good Linux users have to learn is <em>just because it works auto-magically in Windows, doesn&#8217;t mean it works the same in Linux</em>. It stings a little, but it&#8217;s true. The good news is that there are lots of Linux super-geniuses out there to help and most believe in writing stuff down. If you&#8217;re willing to do some Google-ing, most Linux questions/problems can be answered relatively quickly. I had to do a bunch of that.</p>
<p><strong>Task #1: Get 5GHz 802.11n wireless working</strong><br />
When I first plugged my new WUSB600N into my Ubuntu HTPC, Ubuntu recognized it right away, though it couldn&#8217;t &#8220;see&#8221; my 5GHz network (WAP610N). It could see and connect to my 2.4GHz network (WRT54GL) with no problem, so I knew it was time to <a href="http://lmgtfy.com/?q=wusb600n+ubuntu+karmic" target="_blank">Google</a>. I found all kinds of stuff&#8211;using Windows drivers with NDIS, blacklisting, modprobe&#8211;and I tried them all, to the point of complete frustration. Nothing seemed to work, so I decided to install <a href="http://wicd.sourceforge.net/" target="_blank">Wicd</a> (and remove Network Manager), because I&#8217;d had some luck with it in the past.</p>
<p>Unfortunately, Wicd wasn&#8217;t the complete answer: it couldn&#8217;t <em>see</em> my 5GHz network, either, so I knew there was more I wasn&#8217;t doing. After looking through the logs in /var/log/messages and fumbling through more Google searches for <strong>wusb600n ubuntu 11n</strong>, I happened across some posts like <a href="http://ubuntuforums.org/showthread.php?t=1357303" target="_blank">this one</a> that said I needed to blacklist the <strong>rt2800usb</strong> driver. Once I&#8217;d done that, there were different log messages in /var/log/messages, this time saying that <strong>/etc/Wireless/RT3070STA/RT3070STA.dat</strong> couldn&#8217;t be read. So, I looked for it&#8211;the directory didn&#8217;t even exist! Now, I&#8217;m on to something!</p>
<p>Back to <a href="http://lmgtfy.com/?q=ubuntu+%20%2Fetc%2FWireless%2FRT3070STA%2FRT3070STA.dat" target="_blank">Google</a> again, and it looks like I&#8217;m definitely on the right track. I took the example file from <a href="http://swiss.ubuntuforums.org/showthread.php?p=9288229" target="_blank">this post</a>, and edited it for my network, including the SSID and PSK. Reboot, fingers crossed. Wait a sec&#8230;what&#8217;s that? Is that a 5GHz network? Yessssssssss! One thing I still don&#8217;t understand is that even though I specified all of that stuff in <strong>RT3070STA.dat</strong>, I still had to do the same in Wicd. I may look into that more later, but for now, it&#8217;s time to move on to Task #2.</p>
<p><strong>Task #2: Figure out how to give eth1 an IP address</strong><br />
Unlike Network-Manager (built-in with Ubuntu, Gnome), it <a href="http://wicd.sourceforge.net/moinmoin/FAQ/2interfaces" target="_blank">didn&#8217;t seem like Wicd has a facility to have two interfaces up at once</a>, so I had to figure out a way to give it an IP address outside of Wicd. I could have used /etc/network/interfaces, but since Wicd has the ability to let you run scripts before and after network connections are established, it seemed like a good idea to write a script with ifconfig commands in it to assign eth1&#8242;s address:</p>
<p><a class="floatbox" href="http://eison.net/wp-includes/images/posts/htpc/wicd.png" class="floatbox" rev="group:98" alt="Wicd"><img src="http://eison.net/wp-includes/images/posts/htpc/wicd_thumb.png" alt="Wicd" /></a></p>
<p><code>me@htpc:~$ more /etc/router_script<br />
#! /bin/sh</code></p>
<p><code># This script is run by the Wicd daemon after the PC boots<br />
# and connects the the WLAN using wlan0. Once run, eth1<br />
# has an IP address on another subnet and provides DHCP<br />
# addresses for that subnet. All packets are routed from<br />
# eth1 through wlan0.</code></p>
<p><code># give ethernet interface an IP address<br />
ifconfig eth1 172.16.5.1 netmask 255.255.255.252</code></p>
<p>I made my script executable</p>
<p><code>me@htpc:~$ sudo chmod 755 /etc/router_script</code></p>
<p>and after a reboot, I could see that both interfaces were up and had IP addresses.</p>
<p><strong>Task #3: Figure out how to give my DVR an IP address</strong><br />
Unfortunately for me, I can&#8217;t manually assign an IP address to my DVR, so I have to provide it one using DHCP. My router is already running dhcpd, but the request would have to go <em>through</em> my HTPC to get there, much like an ethernet-to-wireless bridge or <a href="http://www.dlink.com/products/?pid=333" target="_blank">wireless game adapter</a>; the problem is that I need for my HTPC to still be able to actively participate on my wireless network, not just bridge for my DVR.</p>
<p>I Google&#8217;d a bunch about this topic, too, and read and tried a bunch of stuff with <a href="http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge" target="_blank">bridge-utils</a>, but could never make it work. Instead, I started thinking about my HTPC as more of a <em>router</em>, which made it a lot easier for me to find stuff about <a href="http://www.google.com/search?q=linux+router+dhcp" target="_blank">Linux routers and providing DHCP addresses</a>. Turns out, it was really easy to set up a second DHCP server on my HTPC that only serves addresses from <strong>eth1</strong>&#8211;that means only devices connected to that interface (my DVR) will ever get addresses. I read a good bit about using <strong>firestarter</strong>, and even tried it successfully, but I soon realized that for my purposes, it was over-kill. More on that later.</p>
<p>All I had to do to set up my new DHCP server in Ubuntu was<br />
<code>me@htpc:~$ sudo aptitude install dhcp3-server</code></p>
<p>After my install, I edited <strong>/etc/default/dhcp3-server</strong> to choose DHCP for only eth1, then edited <strong>/etc/dhcp3/dhcpd.conf</strong> for the network settings I wanted:<br />
<code>me@htpc:~$ more /etc/dhcp3/dhcpd.conf<br />
# DHCP configuration<br />
ddns-update-style interim;<br />
ignore client-updates;</p>
<p>subnet 172.16.5.0 netmask 255.255.255.252 {<br />
	option routers 172.16.5.1;<br />
	option subnet-mask 255.255.255.252;<br />
	option domain-name-servers 172.16.4.1;<br />
	option ip-forwarding off;<br />
	range dynamic-bootp 172.16.5.2 172.16.5.3;<br />
	default-lease-time 21600;<br />
	max-lease-time 43200;<br />
}</code></p>
<p>Note that I purposely picked a really small network mask, since I just needed a couple of usable IP addresses for that network. It would do no harm to pick something larger, like 255.255.255.0.</p>
<p>Since the DHCP server&#8217;s assigning a default router, I need to be sure that the router exists before dhcpd tries to hand out addresses. Calling the dhcp3-server init script again from my <em>router_script</em> is a good way to do that, so I added to it:</p>
<p><code># restart the DHCP server<br />
/etc/init.d/dhcp3-server restart</code></p>
<p>With the configuration done, I restarted the DHCP daemon and connected my DVR to my HTPC with a cross-over cable, then ran the broadband utility to see if it could get an address from dhcpd. Cool! That worked, but it says it&#8217;s not connected (to the Dish Network servers). Hmmm&#8230;guess there&#8217;s a Task #4, then.</p>
<p><strong>Task #4: Give the DVR access to the interwebs</strong><br />
Though the DVR has an address and a default gateway/router, that doesn&#8217;t mean that the HTPC is willing to let it&#8217;s traffic pass through it. For that, I need to get some help from <a href="http://en.wikipedia.org/wiki/Iptables" target="_blank">iptables</a>. As I mentioned a bit earlier, I actually installed <strong>firestarter</strong> during this process because it has <em>internet connection sharing</em> built-in, and can work with dhcpd&#8217;s scripts. What I didn&#8217;t like about it was that it seemed like &#8220;too much&#8221;, since all I really wanted to do was pass <em>all</em> traffic from one interface to another&#8211;I didn&#8217;t really want to <em>restrict</em> anything. So, I removed it and tried to do the same thing with <a href="https://wiki.ubuntu.com/UncomplicatedFirewall" target="_blank">ufw</a>. After fumbling around with that for awhile, it seemed again, that I was wasting my energy&#8211;ufw is really just an interface for iptables, so why not just learn enough iptables to do what I want?</p>
<p>By default, the Linux kernel doesn&#8217;t allow the forwarding of packets from one interface to another, but you can tell it to allow it using <a href="http://snipperoo.com/iptables_stuff/ubuntu_firewall.html" target="_blank">/etc/sysctl.conf</a>. Change one value and reboot.</p>
<p><code># Uncomment the next line to enable packet forwarding for IPv4<br />
net.ipv4.ip_forward=1</code></p>
<p>Now that <a href="http://en.wikipedia.org/wiki/Colonel_Sanders" target="_blank">the kernel</a> will let us forward packets from one interface to another (eth1 to wlan0), we need to tell iptables to accept the traffic into eth1 (filter table), as well as the return traffic to wlan0, back through to eth1 (nat table) Basically, wlan0 is a <a href="http://en.wikipedia.org/wiki/Network_address_translation" target="_blank">NAT</a> interface for whatever is behind eth1. We add to those two tables like this:</p>
<p><code>me@htpc:~$ sudo iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE<br />
me@htpc:~$ sudo iptables --append FORWARD --in-interface eth1 -j ACCEPT</code></p>
<p>Ok, cool: iptables is all set up, so I rebooted and checked to see if my DVR could find the interwebs. <a href="http://en.wikipedia.org/wiki/Lee_Corso" target="_blank">&#8220;Not so fast, my friend!&#8221;</a> Why doesn&#8217;t it work? The DVR has an address and I can ping it from the HTPC&#8230;gotta be something with iptables, then, so I checked using the command <strong>iptables &#8211;list</strong>.</p>
<p><code>me@htpc:~$ sudo iptables --list<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</code>         </p>
<p><code>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</code>        </p>
<p><code>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</code></p>
<p>My masquerade and forwarding are gone. If I run my two iptables commands again, <strong>iptables &#8211;list</strong> looks like this:</p>
<p><code>me@htpc:~$ sudo iptables --list<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</code>        </p>
<p><code>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination<br />
ACCEPT     all  --  anywhere             anywhere</code>            </p>
<p><code>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</code></p>
<p>And if I &#8220;print&#8221; to STDOUT, I can see both:</p>
<p><code>me@htpc:~$ sudo iptables-save<br />
# Generated by iptables-save v1.4.4 on Sat Jul 10 19:16:47 2010<br />
*filter<br />
:INPUT ACCEPT [57221:27498502]<br />
:FORWARD ACCEPT [1163:76309]<br />
:OUTPUT ACCEPT [61462:49085429]<br />
COMMIT<br />
# Completed on Sat Jul 10 19:16:47 2010<br />
# Generated by iptables-save v1.4.4 on Sat Jul 10 19:16:47 2010<br />
*nat<br />
:PREROUTING ACCEPT [852:112868]<br />
:POSTROUTING ACCEPT [10:571]<br />
:OUTPUT ACCEPT [112:7142]<br />
-A POSTROUTING -o wlan0 -j MASQUERADE<br />
COMMIT<br />
# Completed on Sat Jul 10 19:16:47 2010</code></p>
<p>Seems to me that if I&#8217;ve already got this super-awesome script that Wicd calls once wlan0 connects, I should just be able to add my iptables stuff to it, so that every time my HTPC is booted the right rules will be in-place. The final version of my router_script looks like this:</p>
<p><code>e@htpc:~$ more /etc/router_script<br />
#! /bin/sh</code></p>
<p><code># This script is run by the Wicd daemon after the PC boots and connects<br />
# the the WLAN using wlan0. Once run, eth1 has an IP address on another<br />
# subnet and provides DHCP addresses for that subnet. All packets are<br />
# routed from eth1 through wlan0.</code></p>
<p><code># give ethernet interface an IP address<br />
ifconfig eth1 172.16.5.1 netmask 255.255.255.252</code></p>
<p><code># restart the DHCP server<br />
/etc/init.d/dhcp3-server restart</code></p>
<p><code># add needed rules to iptables<br />
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE<br />
iptables --append FORWARD --in-interface eth1 -j ACCEPT</code></p>
<p>One last time, I checked my DVR: woo-hoo! It says &#8220;connected online&#8221; and I can manage it from the <a href="http://dish.sling.com/" target="_blank">dish.sling.com</a> website.</p>
<p>Now what? Guess I need to get a DVR with Slingbox built-in, or buy one of the add-ons. Donations will certainly be accepted.</p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2010/07/ubuntu-linksys-wusb600n-v1-dish-dvr-whose-idea-was-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QR Codes +1</title>
		<link>http://eison.net/2010/07/qr-codes-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=qr-codes-1</link>
		<comments>http://eison.net/2010/07/qr-codes-1/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 15:59:23 +0000</pubDate>
		<dc:creator>Ross Eison</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[qr]]></category>

		<guid isPermaLink="false">http://eison.net/?p=87</guid>
		<description><![CDATA[Since the last post about those nifty little QR codes was so awesome, I thought I&#8217;d add one more: creating QR codes using the goo.gl URL shortener, automatically. Hang on a sec, before you hyperventilate, it is possible. If you&#8217;re a Google Chrome user, there&#8217;s a browser extension called goo.gl URL Shortener that will reach [...]]]></description>
			<content:encoded><![CDATA[<p>Since the last post about those nifty little QR codes was so awesome, I thought I&#8217;d add one more: creating QR codes using the <strong>goo.gl</strong> URL shortener, automatically. Hang on a sec, before you hyperventilate, it <strong>is</strong> possible.</p>
<p>If you&#8217;re a <a href="http://www.google.com/chrome" target="_blank">Google Chrome</a> user, there&#8217;s a browser extension called <a href="https://chrome.google.com/extensions/detail/iblijlcdoidgdpfknkckljiocdbnlagk?hl=en" target="_blank">goo.gl URL Shortener</a> that will reach out to Google&#8217;s URL shortener API to create a short URL for you on the fly. Sadly, I don&#8217;t think the web interface for goo.gl is available otherwise. Once you have a goo.gl short URL, all you have to do to get the corresponding QR code for that URL is add <strong>.qr</strong> to the end of it, like so:</p>
<p><code>http://goo.gl/EFj6</code> becomes <code>http://goo.gl/EFj6.qr</code></p>
<p>When wrapped in image tags, it looks like this:</p>
<p><img src="http://goo.gl/EFj6.qr" alt="QR code for eison.net" /></p>
<p>And here&#8217;s the HTML:</p>
<p><code>&lt;img src="http://goo.gl/EFj6.qr" alt="QR code for eison.net" /></code></p>
]]></content:encoded>
			<wfw:commentRss>http://eison.net/2010/07/qr-codes-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

