Check wireless adapter:
$ iwconfig
You will see wireless adapter as wlan0 or ath0 which depends on what driver is installed.
Execute the following command to apply ESSID, network key, channel, and mode:
$ sudo iwconfig wlan0 essid yantoknuk-singtel
$ sudo iwconfig wlan0 channel 6
$ sudo iwconfig wlan0 key ngumbahkucing
$ sudo iwconfig wlan0 mode managed
After that, bring up the interface:
$ sudo ip link set wlan0 up
Use DHCP to get IP address from access point:
$ sudo dhclient wlan0
Check whether the WiFi interface is connected to access point:
$ ifconfig
wlan0 Link encap:Ethernet HWaddr 00:16:cf:33:54:9b
inet addr:192.168.1.50 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::216:cfff:fe33:549b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9188 errors:0 dropped:0 overruns:0 frame:0
TX packets:2504 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2423370 (2.4 MB) TX bytes:1265327 (1.2 MB)
Finish.