/etc/network/interfaces
auto wlan0
iface wlan0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
wpa-ssid <your_router>
wpa-psk <your_wpa_key>
dns-nameservers 8.8.8.8 192.168.1.1Be sure to select a static address outside the range used by the DHCP server in the router, switch or other access point. Of course, substitute your details here.
Get the system to read and use the changes:
sudo ifdown wlan0 && sudo ifup -v wlan0