Manual Wireless Association: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
 
(22 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{TOCright}}
=Testing Wireless Connectivity=
=Testing Wireless Connectivity=
It's sometimes useful to test out manual connections to access points to help us debug the driver and wireless networking software. First test with plain 'iwconfig' tools, then with 'wpa_supplicant'. WPA and WPA2 are not currently supported, but will be in the future.
It's sometimes useful to test out manual connections to access points to help us debug the driver and wireless networking software. First test with plain 'iwconfig' tools, then with 'wpa_supplicant'. WPA and WPA2 are supported since build 656.
==Scan for Access Point with iwlist==

To find an access point, use these commands in Terminal:
su -l
iwlist eth0 scanning
==Manual wireless association wizard==
If you want to use a command-line wizard:
{{:Olpc-contrib/mw.py}}
==Step-by-Step with iwconfig==
==Step-by-Step with iwconfig==
* Switch to a [[Console]]
* Switch to a virtual terminal by pressing Ctrl+Alt+F1 (Ctrl+Alt+[[Image:Mesh key f1 small.png]])
* Log in as user 'root' with no password
* Log in as user 'root'
* Stop NetworkManager and network scripts
* Stop NetworkManager and network scripts


Line 17: Line 24:


iwconfig eth0 essid "my-ssid" key aaffbbcc667788112233449900
iwconfig eth0 essid "my-ssid" key aaffbbcc667788112233449900

and for apple airport (white UFO) use

iwconfig eth0 essid "Network Name" key s:YourKey

If you need to also specify your access point, you can do so with the "ap" option:

iwconfig eth0 essid "my-ssid" key aaffbbcc667788112233449900 ap 0A:1B:2C:3D:4E:5F

If you want to connect to an ad-hoc-network, use the mode-option:

iwconfig eth0 mode Ad-Hoc essid "my-ssid"

For further settings, see <tt>[[google:man+iwconfig|man iwconfig]]</tt>.


* Wait a second or two, then do the following and see if the "Access Point:" and "ESSID" are set to valid values
* Wait a second or two, then do the following and see if the "Access Point:" and "ESSID" are set to valid values


iwconfig eth0
iwconfig eth0
eth0 IEEE 802.11b ESSID:"mmy-ssid"
eth0 IEEE 802.11b ESSID:"my-ssid"
Mode:Managed Frequency:2.437 GHz Access Point: 00:20:44:5a:b1:a4
Mode:Managed Frequency:2.437 GHz Access Point: 00:20:44:5a:b1:a4
Bit Rate:11 Mb/s Tx-Power=20 dBm Sensitivity=8/0
Bit Rate:11 Mb/s Tx-Power=20 dBm Sensitivity=8/0
Line 31: Line 52:


* Wait another 10 seconds or so, and run 'iwconfig' again to ensure the connection is still active
* Wait another 10 seconds or so, and run 'iwconfig' again to ensure the connection is still active
* Try to acquire a DHCP address
* Try to acquire network access data from DHCP


/sbin/dhclient -1 eth0
/sbin/dhclient -1 eth0


* Or set the IP-address, default gateway and DNS by hand
* If the "Access Point:" value is still a valid MAC address (ie, it is _not_ all 0s), the connection is still alive


ifconfig eth0 192.168.1.2
* Switch back to the GUI by pressing Ctrl+Alt+F3 ((Ctrl+Alt+[[Image:Home key f3 small.png]])
route add default gw 192.168.1.1
echo "nameserver 192.168.1.1" > /etc/resolv.conf

* If the "Access Point:" value is still a valid MAC address (ie, it is '''not''' all 0s), the connection is still alive

* Switch back to Sugar (see [[Console]]).


==Step-by-step with wpa_supplicant==
==Step-by-step with wpa_supplicant==
* Switch to a [[Console]]
* Switch to a virtual terminal by pressing Ctrl+Alt+F1 (Ctrl+Alt+[[Image:Mesh key f1 small.png]])
* Log in as user 'root' with no password
* Log in as user 'root'
* Stop NetworkManager and network scripts
* Stop NetworkManager and network scripts


Line 61: Line 88:
}
}
<press Ctrl+D here>
<press Ctrl+D here>

* Or for WPA/WPA2 with a pre-shared key (psk):
...
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
eapol_version=1
ap_scan=1
fast_reauth=1
network={
ssid="My SSID"
key_mgmt=WPA-PSK
psk="secret passphrase"
}


* Run wpa_supplicant like this:
* Run wpa_supplicant like this:


/usr/sbin/wpa_supplicant -ddd -ieth0 -c/etc/wpa_supplicant.conf -Dwext -o local0
/usr/sbin/wpa_supplicant -ddd -ieth0 -c/etc/wpa_supplicant.conf -Dwext


* You should see lines like:
* You should see lines like:
Line 78: Line 118:


Attach the file /root/wpa_supplicant-log.txt.bz2 to the bug.
Attach the file /root/wpa_supplicant-log.txt.bz2 to the bug.

=Configure TCP/IP=
To activate the Neighborhood view, in a new Terminal session,
su -l
service network start
ifup eth0
service NetworkManager start



[[Category:Network]]
[[Category:Network]]

Latest revision as of 07:58, 22 September 2011

Testing Wireless Connectivity

It's sometimes useful to test out manual connections to access points to help us debug the driver and wireless networking software. First test with plain 'iwconfig' tools, then with 'wpa_supplicant'. WPA and WPA2 are supported since build 656.

Scan for Access Point with iwlist

To find an access point, use these commands in Terminal:

su -l
iwlist eth0 scanning

Manual wireless association wizard

If you want to use a command-line wizard:

manual-wireless.py

Run the following in the terminal (that's a L, not a 1!):

su -l 
cd /usr/local/bin/
wget http://dev.laptop.org/~ffm/mw.py
wget http://dev.laptop.org/~ffm/getone.py
chmod +x mw.py

Then, type "mw.py" from the terminal (in the future, only run the following:)

su -l
mw.py

The wizard will guide you through. Please report all bugs in trac.

Step-by-Step with iwconfig

  • Switch to a Console
  • Log in as user 'root'
  • Stop NetworkManager and network scripts
service NetworkManager stop
service network stop
  • Use iwconfig to connect, replacing the 'essid' and key as necessary
iwconfig eth0 essid "my-ssid"

or for WEP:

iwconfig eth0 essid "my-ssid" key aaffbbcc667788112233449900

and for apple airport (white UFO) use

iwconfig eth0 essid "Network Name" key s:YourKey

If you need to also specify your access point, you can do so with the "ap" option:

iwconfig eth0 essid "my-ssid" key aaffbbcc667788112233449900 ap 0A:1B:2C:3D:4E:5F

If you want to connect to an ad-hoc-network, use the mode-option:

iwconfig eth0 mode Ad-Hoc essid "my-ssid"

For further settings, see man iwconfig.

  • Wait a second or two, then do the following and see if the "Access Point:" and "ESSID" are set to valid values
iwconfig eth0
eth0      IEEE 802.11b  ESSID:"my-ssid"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:20:44:5a:b1:a4   
          Bit Rate:11 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0  
          Retry limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=85/100  Signal level=-45 dBm  Noise level=-82 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:7
  • Wait another 10 seconds or so, and run 'iwconfig' again to ensure the connection is still active
  • Try to acquire network access data from DHCP
/sbin/dhclient -1 eth0
  • Or set the IP-address, default gateway and DNS by hand
ifconfig eth0 192.168.1.2
route add default gw 192.168.1.1
echo "nameserver 192.168.1.1" > /etc/resolv.conf
  • If the "Access Point:" value is still a valid MAC address (ie, it is not all 0s), the connection is still alive
  • Switch back to Sugar (see Console).

Step-by-step with wpa_supplicant

  • Switch to a Console
  • Log in as user 'root'
  • Stop NetworkManager and network scripts
service NetworkManager stop
service network stop
  • Create a wpa_supplicant config file for your network in /etc/wpa_supplicant.conf. It should look something like this:
cat <<EOF > /etc/wpa_supplicant.conf
ctrl_interface_group=0
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1
network={
       ssid="my-ssid"
       key_mgmt=NONE
       auth_alg=OPEN
}
<press Ctrl+D here>
  • Or for WPA/WPA2 with a pre-shared key (psk):

...

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
eapol_version=1
ap_scan=1
fast_reauth=1
network={
       ssid="My SSID"
       key_mgmt=WPA-PSK
       psk="secret passphrase"
}
  • Run wpa_supplicant like this:
/usr/sbin/wpa_supplicant -ddd -ieth0 -c/etc/wpa_supplicant.conf -Dwext
  • You should see lines like:
wpa_supplicant[1710]: State: ASSOCIATING -> ASSOCIATED
wpa_supplicant[1710]: Associated to a new BSS: BSSID=00:cc:aa:34:56:12
  • In any case, please copy /var/log/messages and attach it to a bug report
cd /root
cp /var/log/messages wpa_supplicant-log.txt
bzip2 wpa_supplicant-log.txt

Attach the file /root/wpa_supplicant-log.txt.bz2 to the bug.

Configure TCP/IP

To activate the Neighborhood view, in a new Terminal session,

su -l
service network start
ifup eth0
service NetworkManager start