<?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 &#187; wireless</title>
	<atom:link href="http://eison.net/tag/wireless/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>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>
	</channel>
</rss>

