4 Aug 2007

Guide to get WPA-PSK working on PS3 - YDL 5.0.2

There were some requests for easier guide on how to get WPA working on Playstation 3 for Yellow Dog Linux 5.0.2. I looked around and found some free webspace for prebuilt binaries and for modified source RPMs. Please note that you will need your YDL root account in order to complete steps below.

This guide was last updated on: 4.8.2007

1. Update your wireless tools package

Yellow Dog Linux 5.0.2 comes with wireless tools package compiled for PowerPC-32. While this may work for other systems with Playstation 3 this is a bit problematic as ioctl32 wireless interface is a bit broken. So easiest workaround for this is to compile wireless tools as PowerPC-64 binaries. You can get modified source RPMs and pre-built binaries for easier installation from my packages website. Most users just need to download wireless-tools-28-1.ppc64.rpm and install it. You can use USB Flash Memory or any other medium to transfer files.

rpm -Uvh wireless-tools-28-1.ppc64.rpm

If it complains for conflicts add --force to command line (usually don't do this, but I didn't want to update release numbers in case Yellow Dog Linux releases updated packages to replace this). Please note that this is modification of YDL's source RPM package so it is a bit older that what kernel would like to use. It will generate some warnings, but you can ignore those.

2. Test that wireless tools works

Next step is to test out that wirless tools works. Tools needed in this experiment are ifconfig, iwconfig, iwpriv, iwlist, and dhclient.

First lets test out that you can wireless module loaded correctly. For this we will use iwconfig:

iwconfig eth0

This will display something like (your details may be different):

eth0 radio off ESSID:off/any
Mode:Managed Frequency:2.462 GHz Access Point: Not-Associated
Bit Rate:54 Mb/s
Encryption key:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Next let's make sure you have clean configuration for your wireless connection, command eth0 down and up:

ifconfig eth0 down

ifconfig eth0 up

Next you can try to search for access point to connect to using iwlist.

iwlist eth0 scanning

This will display something like (your details will be different):

eth0 Scan completed :
Cell 01 - Address: 77:88:99:AA:BB:CC
ESSID:""
Protocol:IEEE 802.11bg
Mode:Managed
Channel:11
Encryption key:on
Quality=100/100 Signal level=-42 dBm
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
12 Mb/s; 48 Mb/s
Extra:bcn_int=100
Extra:ap_sec=0201

You should note last line per entry Extra:ap_sec=. This number will tell what encryption algorithm is needed for your connection. 0201 means WPA-PSK - TKIP and 0202 would mean WPA2-PSK - AES. I have not been able to test out WPA2-PSK - AES, but it might work for you. For me 0100 shows up for WPA2-PSK - AES which is incorrect as that would mean WEP encryption.

Next lest try manually connecting to Access Point. For this you will need to know your access point's ESSID, used encryption algorithm (WPA-PSK (TKIP), WPA2-PSK (AES)) and passphrase to access network.

iwpriv eth0 set_alg 2

iwconfig eth0 key s:passphrase

iwconfig eth0 essid ESSID

If you have WPA2-PSK replace set_alg 2 with set_alg 3. For WEP this would be set_alg 1. After that you can observe output of iwconfig eth0 to see if you have been associated to access point (Access Point field changes from Not-Associated to MAC address of your AP).

Next you can check out if you can get an IP address with dhclient.

dhclient eth0

If it gives you an IP address you are free to test out your internet connection with your web browser or any other tool that needs connection.

3. Setting it up automatically on boot

Now that you have Wireless connection working it would be nice that it would work automatically after being rebooted.

There are only two files to be modified.

First, lets modify /etc/sysconfig/networking/devices/ifcfg-eth0.

Set following fields to values shown below (of course change your ESSID) (other fields can be left empty):

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
ESSID=ESSID
TYPE=Wireless

Next we need to store your passphrase so it will be automatically configured.

Edit /etc/sysconfig/networking/devices/keys-eth0 to contain following:

KEY=s:passphrase
IWPRIV="set_alg 2"

Please not that those values are the same that you used during testing.

After this you can try it, first bring eth0 down and then back to up:

ifdown eth0

ifup eth0

Thats all!