Configuring WiFi adaptors on Linux via the command line

EdimaxHardly an original post but there are so many variants around that, when I need to do this and have (as usual) forgotten how to do it, I can’t find anything that works! So here is my variant…

Add an entry for wlan0  to the /etc/network/interfaces file:

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf

Then, create /etc/wpa_supplicant.conf to use WPA encryption (this link  has examples of other modes):

ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
fast_reauth=1
network={
         ssid="your_ssid"
         scan_ssid=1
         key_mgmt=WPA-PSK
         psk="your_passphrase"      
}

 That’s it for DHCP. To use a static IP address, change the /etc/network/interfaces entry (with the appropriate customizations) to be:

auto wlan0
iface wlan0 inet static
    address 192.168.2.3
    netmask 255.255.255.0
    gateway 192.168.2.1 
wpa-conf /etc/wpa_supplicant.conf
Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s