Ubuntu wireless configuration from command line

Generate passphrase:

wpa_passphrase <myssid> <mypassword> > /etc/wpa_supplicant.conf

Edit /etc/network/interfaces:

auto <wireless-interface>
iface <wireless-interface> inet static
  address 10.1.1.10
  netmask 255.255.255.0
  wireless-essid <myssid>
  gateway 10.1.1.1
  post-up wpa_supplicant wpa_supplicant -B -Dnl80211 -i<wireless-interface> -c/etc/wpa_supplicant.conf
  post-down killall -q wpa_supplicant
  dns-nameservers 8.8.8.8

Here you need to find out your wifi adapter’s driver using wpa_supplicant –help. In my case it is nl80211 but yours may be different.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s