Tag Archives: wlan0

Enabling Wi-fi on the Base running Turnkey LAMP

8 Nov

Now, this is going to be interesting.  I’ve never enabled Wi-fi on a Turnkey LAMP appliance and never used Wi-fi with Linux in general.  Is my NetGear WG111v2 going to be supported?

Also, I am still using DHCP to obtain an IP address for the Base.  I still need to make it static and set the  Base’s host name as I’ll be relocating the Base somewhere I cannot see it.

While doing this, I’ll listen to the Racing Stripes soundtrack.

OK, based on the advice on the Turnkey LAMP forum, I’ll try the following steps:

I’ll enter the following commands in the shell, of course doing everything as the “root” user, as I have been so far.

apt-get update
apt-get install wireless-tools wpasupplicant

Now, I’ve got to have a look at the notes on configuring the Wi-fi interface through the command line.

Check if a Wireless Adapter is available to the Base

Use the command “iwconfig“.  I get the following output.

lo no wireless extensions.
eth0 no wireless extensions.
wlan0 IEEE 802.11bg ESSID:off/any 
 Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm 
 Retry long limit:7 RTS thr:off Fragment thr:off
 Encryption key:off
 Power Management:off

Excellent! I see wlan0 with the details of my Netgear WG111v2 Wi-fi USB adapter.

I use the command “iwlist wlan0 scanning” to scan for my Wi-fi router.  There is a lot of output because I live around lots of neighbours with Wi-fi networks.  I see mine – “DJTEPHWY1” – as the ESSID :).

Based on the output from the scan, I do the following:

I use the command “iwconfig wlan0 essid DJTEPHWY1” to set the wlan0 to use the DJTEPHWY1 wireless router, noting that I’ve named my wireless network to DJTEPHWY1.

I use the command “iwconfig wlan0 channel 1” to the wlan0 to use channel 1.  I am not an expert in wireless networking, so I cannot explain the concept of channels…

I use the command “iwconfig wlan0 key off” to switch off encryption for wlan0.  I’ve only done this for documentation purposes.  I’ll be switching it back on as my wireless network is secure.

Time to listen to the Ritchie Family 🙂

OK, now I’ve got my Wi-fi Config Sheet that has the encryption details, I’ll get on to getting this thing going!

I use the command “iwconfig wlan0 key 0000000000” to switch on encryption and set the WEP key.

Now, I’ll reboot the Base and see if the settings remain, leaving the Ethernet connected.  I’m not ready to cut the chord just yet.  I need to log back in to check the settings.

OK, the settings were lost on reboot.  We’ll forget about the above instructions.  If I simply bounced the network interface service, I’m sure I would have got an IP address that would have been useful until I rebooted.  No problem!  It was good to go through it and learn something :)…  Without these instructions, I would not know what to look for, so acknowledgement and kudos for the article that lead me on the correct path :).

Now, referring to a Ubuntu forum

I’m using the command “apt-get upgrade“.

I’m using the command “apt-get install apt-utils“.

I’m using the command “apt-get install wireless-tools hwinfo wpasupplicant rfkill” to get more Wi-fi stuff.

I’m using the command “hwinfo –netcard” to verify my Wi-fi adapter and it confirms my Wi-fi adapter.

Since I am using a WEP network, I need to do the following:

Edit the “/etc/network/interfaces” file and add the following lines at the end:

auto wlan0
iface wlan0 inet dhcp
wireless-essid DJTEPHWY1
wireless-key 0000000000

Also, in the “/etc/network/interfaces” file, remove the line withthe text “# UNCONFIGURED INTERFACES” and the line that instructs to remove that line.  If this text remains in the file, the lines added above are erased.

The /etc/network/interfaces file should look like the following:

auto lo
iface lo inet loopback

auto eth1
iface eth1 inet dhcp

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wireless-essid DJTEPHWY1
wireless-key 0000000000

Note, my ESSID is DJTEPHWY1.  My wireless key is “0000000000“.  Your’s will be different.  If you’re using a WPA network, you’ll need to research it.

Now, I’ll reboot the Base and see if the settings remain, leaving the Ethernet connected.  I’m not ready to cut the chord just yet.  I need to log back in to check the settings.

Also, it’s a shame that I cannot do this through Webmin :(.  Webmin is a really neat interface to configure the Base.  Oh well, back to my roots – CLI and BASH/KSH :).  I’ll investigate the Webmin site and see if someone has raised this issue or added the feature.

I login, and the login script that lists the IP address confirms there is an IP address for the wireless interface.

I shut down the Base and disconnect the Ethernet.

I switch back on the Base, without the Ethernet, and it boots up with Wi-fi connectivity through my router.  Unfortunately, my WEP key is stored in a plain text configuration file.  This may be an issue for some; however, this is for home.  At work, it would be connected through Ethernet, so we wouldn’t be going through this.

Advertisements
%d bloggers like this: