I'm trying to connect to my router but having no luck. I'm just missing some simple probably one line of code that I cant find anywhere.
If I write iwlist wlan0 scan, it shows over 20+ networks that I can connect to so my wireless card is definitely set up correctly.
For example, I want to connect to a WPA network called "herroprease" with password "wearechinesepeople", so I type
iwconfig wlan0 essid herroprease key s:wearechinesepeople
dhclient wlan0
However, when I ping 192.168.1.1 (my router) it says that it can't connect.
I've heard that to connect to WPA networks there are extra commands you have to give to bash with wpa_supplicant. Is that so? I'm looking for the simplest easy to understand code to get online. Thanks for any help!

/etc/network/interfaces. If that succeeds, study the differences of theiwconfigoutput before and after. – cyfdecyf Dec 19 '11 at 14:55