baumi's blog

baumi's personal blog … Linux, OS X, Windows, Random things, …

Ubuntu GNU/Linux Server: quickly setting up wifi connection on the command line (CLI) using wpa_supplicant

Today i’m setting up a new server. Because i didn’t want to freeze downstairs in the cold cellar where my servers are usually located, i’ve simply built and configured this server upstairs. Since I don’t have wired network upstairs anymore, i just grabbed a random USB wifi stick and quickly connected the server temporarily to my wifi so i could download the ubuntu updates and additional packages.

So here is what i’ve ended up doing for connecting to WPA2 wifi:

a) connect USB wifi stick
b) ifconfig -a should already show your “wlan0” device
c) ifconfig wlan0 up
d) wpa_passphrase WIFIESSIDNAME and enter your wifi password, then put the output into /etc/wpa_supplicant.conf
e) wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf
f) iwconfig will show the wifi network status and if it’s associated, the link quality, etc …
g) dhclient to obtain DHCP values (IP, DNS, etc.)

done !

Comments are currently closed.