<?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>dan.thoughts &#187; WiFi</title>
	<atom:link href="http://blog.sosedoff.com/category/wifi/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sosedoff.com</link>
	<description>Web-development, PHP, Ruby, Sinatra, Merb, Rails, MySQL, SQLite, Web Services.</description>
	<lastBuildDate>Sat, 03 Jul 2010 05:46:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Connecting to wifi with specified wep key index</title>
		<link>http://blog.sosedoff.com/2009/03/09/connecting-to-wifi-with-specified-wep-key-index/</link>
		<comments>http://blog.sosedoff.com/2009/03/09/connecting-to-wifi-with-specified-wep-key-index/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 03:41:12 +0000</pubDate>
		<dc:creator>Dan Sosedoff</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[WiFi]]></category>
		<category><![CDATA[key index]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[wep]]></category>

		<guid isPermaLink="false">http://blog.sosedoff.com/?p=75</guid>
		<description><![CDATA[Since i got trouble while connecting to wireless network with given parameters in linux, i tried a lot of ways to get my internet working. 
So, the problem is: Windows Network manager have special option &#8211; Key index. The index is transmitted with the encrypted message. The receiver then looks-up the key corresponding to the [...]]]></description>
			<content:encoded><![CDATA[<p>Since i got trouble while connecting to wireless network with given parameters in linux, i tried a lot of ways to get my internet working. </p>
<p>So, the problem is: Windows Network manager have special option &#8211; Key index. The index is transmitted with the encrypted message. The receiver then looks-up the key corresponding to the transmitted index and uses it to decrypt the message. But linux (ubuntu) network managers i`ve tried have no key index field, so there is no way to set it up properly with gui. Connection won`t work if index value set to incorrect value. </p>
<p>After giving up to find any useful gui program i wrote small shell script only for one network (because i have no access to router and no chance to improve some security settings):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># settings</span>
<span style="color: #007800;">interface</span>=<span style="color: #ff0000;">&quot;ath0&quot;</span> <span style="color: #666666; font-style: italic;"># wireless interface, default to wlan0</span>
<span style="color: #007800;">essid</span>=<span style="color: #ff0000;">&quot;NETWORK_NAME_HERE&quot;</span>
<span style="color: #007800;">key</span>=<span style="color: #ff0000;">&quot;YOUR_KEY_HERE&quot;</span>
<span style="color: #007800;">index</span>=<span style="color: #ff0000;">&quot;4&quot;</span> <span style="color: #666666; font-style: italic;"># can be [1..4]</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># check permission</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(id -u)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Run this script under root&quot;</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
   <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># show information</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Settings:&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-&gt; Interface: <span style="color: #007800;">$interface</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-&gt; Wifi ESSID: <span style="color: #007800;">$essid</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-&gt; Key: <span style="color: #007800;">$key</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-&gt; Key Index: <span style="color: #007800;">$index</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># perform association</span>
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> <span style="color: #007800;">$interface</span> down
iwconfig <span style="color: #007800;">$interface</span> essid <span style="color: #007800;">$essid</span>
iwconfig <span style="color: #007800;">$interface</span> key <span style="color: #007800;">$key</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$index</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
iwconfig <span style="color: #007800;">$interface</span> key <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$index</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> <span style="color: #007800;">$interface</span> up
dhclient <span style="color: #007800;">$interface</span></pre></div></div>

<p>Download shell script &#8211; <a href="http://files.sosedoff.com/9591756c/">http://files.sosedoff.com/9591756c/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sosedoff.com/2009/03/09/connecting-to-wifi-with-specified-wep-key-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
