This is only a preview of the April 2009 issue of Silicon Chip. You can view 33 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "Multi-Function Remote-Controlled Lamp Dimmer":
Items relevant to "USB Printer Share Switch":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
Connecting Puppy
Linux to the Internet
via a network cable is a
piece of cake. Wireless
networking can be
slightly more difficult
but is still easy to do.
Here’s how.
By GREG SWAIN
Wireless Networking
With Ubuntu & Puppy Linux
L
AST MONTH, we described how
to resurrect an old laptop using
Puppy Linux as the operating system.
Puppy runs fast, even on old hardware, and is just the shot as an OS for
machines that would otherwise finish
up in landfill.
In the course of preparing that ar-
ticle, we decided to resurrect an old
laptop that had once belonged to the
daughter of one of the SILICON CHIP staff
members. This 6-year old machine is
a Compaq Presario M2000 running an
AMD Sempron 3000 processor, 512MB
of RAM and Windows XP.
Well, it used to run Windows XP
but somehow this had become kaput.
It was taking an age to load and had
become so corrupted that it would
take several minutes just for the fly-up
menu to appear after the Start button
was clicked.
Cleaning up the disk debris and
running a registry checker did improve
Fig.1 (above): set the menu timeout value and comment out
the hiddenmenu line in Ubuntu’s /boot/grub/menu.lst
file if setting up a dual-boot Ubuntu/Puppy system. Fig.2
(right): how the Puppy boot lines are added to menu.lst.
14 Silicon Chip
siliconchip.com.au
Fig.3: setting up a wireless networking profile in Ubuntu 8.1 (Intrepid Ibex) is a breeze using the Network Configuration
wizard. These three dialog boxes show the basic set-up for a secure connection.
things somewhat but it was clearly
beyond redemption. So why not ditch
Windows altogether and install Linux?
In fact, why stop at just one flavour
of Linux?
To cut a long story short, we ended
up installing both Ubuntu Linux and
Puppy Linux as a dual-boot set-up.
Ubuntu was installed first into one
partition and then Puppy was installed
into a second partition. Ubuntu’s boot
menu file (/boot/menu.lst) was then
modified to add Puppy as one of the
boot options.
How to you do that? Easy – Puppy
recognises the Ubuntu install and tells
you what lines to add to Ubuntu’s
/boot/menu.lst file. While you’re at
it, you also have to comment out the
hiddenmenu line and change the timeout entry to suit – eg, seven seconds
(Fig.1).
Wireless networking
Getting wireless networking going
in Ubuntu 8.1 (aka Intrepid Ibex)
proved to be child’s play. The laptop
we were using didn’t have a built-in
wireless adaptor, so we tested it with
four plug-in adaptors: (1) a Netgear
WG511 Wireless PC Card; (2) a Netgear
WG111T USB Adaptor; (3) a Netgear
WG111v2 USB Adaptor; and (4) a
Belkin Wireless G USB Adaptor. In
each case, as soon as the device was
plugged in, Ubuntu loaded the correct native driver and the device was
ready to go.
siliconchip.com.au
An external USB or
PC Card wireless
adaptor will be
necessary if your
laptop lacks a builtin adaptor.
It was then just a matter of setting up
a wireless networking configuration
and saving the profile. That’s done
by clicking System -> Preferences ->
Network Configuration to bring up the
Network Connections wizard – see
Fig.3. You then add a wireless profile
and enter in the necessary details such
as the broadcast SSID, the mode and
the security details (use WPA security
if the driver supports it, otherwise
use WEP).
You also need to enter the MAC
address of the wireless adaptor if you
are using MAC address filtering. This
is always a good idea but note that if
you do use MAC address filtering, you
will have to create a separate profile
for each wireless device you intend
using.
And that’s it. Once the network
profile has been created, Ubuntu 8.1
automatically connects to the Internet. What could be easier? – you just
plug the device in, set up the wireless
network configuration details and it
works.
However, based on personal experience, wireless networking with
previous versions of Ubuntu is not
April 2009 15
Wireless Networking . . .
https://help.ubuntu.com/community/
WifiDocs/Driver/Ndiswrapper. This
website gives the full step-by-step
procedure and is easy to follow – just
be sure to blacklist the listed native
drivers as instructed.
Note: this last step is critical and is
necessary to prevent the native driver
from loading and interfering with
Ndiswrapper.
If it doesn’t work, then it may be necessary to blacklist extra drivers – either
that, or you’ve got the wrong Windows
driver for your wireless adaptor. A list
of drivers that you can try blacklisting
is shown below (these entries go in
/etc/modprobe.d/blacklist).
Fig.4: clicking the “Connect” icon
on the Puppy desktop brings up the
Internet Connection Wizard.
quite as simple. For example, none of
the native drivers for the above-listed
wireless adaptors worked with Ubuntu
8.04 (aka Hardy Heron) but they could
all be made to work by using a utility
called “Ndiswrapper” and the relevant
Windows driver for each device.
As the name suggests, Ndiswrapper
“wraps” the Windows driver so that it
can be used under Linux. The procedure is relatively straightforward but
we won’t go into it in detail here because the latest 8.1 version of Ubuntu
apparently doesn’t need it – at least not
for the adaptors we tested.
If you are forced to use Ndiswrapper with Ubuntu, then take a look at
blacklist b43
blacklist b43legacy
blacklist ssb
blacklist rt2500usb
blacklist islsm_pci
blacklist islsm
blacklist islsm_usb
blacklist prism2_usb
blacklist rtl8187
blacklist r8187b
blacklist rt73usb
blacklist p54usb
blacklist ath_pci
blacklist ath_hal
Note that while Ndiswrapper works
well in practice it’s needed only if the
native driver doesn’t do the job.
Puppy wouldn’t play ball
Getting the wireless networking
going with Puppy also required some
coaxing. With each of the three USB
wireless adaptors, Puppy correctly
loaded a native driver but things went
Fig.5: in this case, no native driver has been loaded for
wireless networking – just one for the ethernet adaptor.
Click the Load module button to proceed.
16 Silicon Chip
pear-shaped from there. Although each
USB adaptor could “see” the wireless
network, it stubbornly refused to connect even though the correct wireless
profile had been created and loaded
in Puppy’s networking set-up wizard.
Similarly, Puppy identified and
loaded a driver for the WG511 PC
card. But that was as far as it got. In
that case, the adaptor couldn’t even
“see” the wireless network.
Doggone it!
Use Ndiswrapper
After some trial and error, we
quickly got all four wireless adaptors
working with Puppy. Once again, the
trick is to use the Ndiswrapper utility
plus the relevant Windows driver for
the device.
Unlike Ubuntu, Puppy installs the
Ndiswrapper utility by default along
with a GUI, so it’s easy to get going.
Here’s how it’s done:
Step 1: obtain the Windows .inf and
.sys driver files for the wireless network adaptor. These can either be
obtained from the installation CD supplied with the device or downloaded
from the manufacturer’s website.
If necessary, install the driver software on a Windows machine to extract
the .inf and .sys files from a .exe install
file. That done, copy them onto a USB
flash drive or, better still, into the
/home folder in Puppy.
Step 2: run the Internet Connection
Wizard by clicking the “Connect” icon
on the desktop to bring up the dialog
shown in Fig.4.
Step 3: click the “Internet By Network
Or Wireless LAN” button to bring up
the dialog box shown in Fig.5, then
Fig.6: after choosing the Ndiswrapper option, browse to
Windows .inf driver file location, select it and click OK.
siliconchip.com.au
Fig.7 (above): this is the dialog that appears if
Ndiswrapper and the Windows driver find the
wireless adaptor. Click Save to keep the driver
configuration.
Fig.8 (right): once Ndiswrapper is working correctly, the
wlan0 entry will appear in this dialog. You then click the
wlan0 button to go to the dialog shown in Fig.9.
click “Load Module” and choose the
“Ndiswrapper” button at the next dialog. Be sure to unload and blacklist
any existing native WLAN0 driver
when prompted during this procedure
(if one has been loaded).
Alternatively, if no native driver has
loaded, just click on the “None” button
at this prompt.
Step 4: follow the prompts to install the
Windows driver. Note that you must
select the .inf file to install (Fig.6).
Step 5: having loaded the driver, the
wizard will now bring up a dialog
advising that it is trying to associate
with an interface. If the driver finds
the wireless interface and loads cor-
rectly (see Fig.7), then so far so good
– proceed to Step 7.
Step 6: if it doesn’t find the adaptor,
unload the driver at the subsequent
prompt, then reload Ndiswrapper and
the Windows driver and try again.
This step is apparently necessary
to completely unload other drivers,
to prevent them from conflicting
with Ndiswrapper and the Windows
driver.
In short, if a native driver has initially been loaded, you may have to
go through the Ndiswrapper driver
installation procedure twice to get
it working. Based on my experience,
simply installing Ndiswrapper and
the driver once doesn’t work.
Step 7: once the driver has associated
with the wireless adaptor correctly,
the dialog shown in Fig.8 will appear.
This should now show the wlan0
entry with the driver module listed
as “ndiswrapper”. If it does, click the
wlan0 button and then the Wireless
button at the next dialog (Fig.9) to go
to the dialog shown in Fig.10.
Step 8: click the “Scan” button. If it
finds one or more wireless networks,
you are in business. Select your network, then click the “New Profile”
button to set-up a wireless networking
profile as shown in Fig.10.
STEP 9: Once the profile is completed,
Fig.9 (above): click the Wireless button in this dialog to
set up a wireless networking profile.
Fig.10 (right): to set up the profile, first click the New Profile
button, then enter in the details as shown here. You then save
the profile and click the Use This Profile button.
siliconchip.com.au
April 2009 17
Wireless Networking . . .
Locking Down A Wireless Network
It’s surprising just how many unsecured wireless networks there are out
there. Out of the box, most wireless
modems/routers are unsecured and
the owner often has no idea that this
is the case. As a result, the network
is wide open and can be accessed by
other people in the vicinity (eg, your
neighbours).
If you don’t want others using your
wireless Internet connection for free,
there are four steps you should take to
lock your wireless modem or wireless
router down:
STEP 1: change the default user name
and password that’s used to log in to
your wireless modem via your browser
in order to set it up. The default user
names are easy to discover on the net
or even guess, so why make it easy
for someone to gain access?
STEP 2: change the ESSID (ie, the
name given to the wireless network)
from the default, then disable “Broadcast ESSID”. After all, there’s no
point in changing it from the default
if you’re then going to broadcast it to
the world.
STEP 3: Enable MAC address filtering if
available, then enter the MAC address
for your wireless network adaptor into
the set-up.
To explain, each wireless adaptor
is assigned a unique identification
number when it’s manufactured. This
number is in hexadecimal format and
is referred to as the “MAC address”. By
enabling MAC filtering in your wireless
router, you can limit access to those
wireless adaptors that have the corresponding MAC addresses (you can
enter more than one address).
To obtain the MAC address of your
wireless network adaptor, just go to a
terminal window and type ifconfig -a
for a Linux system or ipconfig /all on
a Windows system. This will be listed
as the Hwaddr in Puppy or as the
Physical Address in Windows.
Be sure to use the MAC address
listed for your wireless adaptor, not
for your ethernet adaptor.
Fig.11: you can
check which native
drivers have been
blacklisted by
clicking Menu ->
System -> BootManager Configure
Bootup, then
clicking “Click
Here To Blacklist
A Module”.
click “Save” followed by “Use This
Profile”. If Puppy subsequently reports
that it was able to find a live network,
you then click the Auto DHCP button
to obtain an IP address.
That’s it – you will now be connected to the Internet. Note, however,
that Puppy does not automatically
connect to a wireless network each
time it starts up. Instead, you have to
reload the networking profile (select
the profile, then click “Load”, click
“Use This Profile” and then “Auto
18 Silicon Chip
DHCP” to reacquire an IP address.
Of course, there is a way to make it
automatically connect to a particular
network but let’s not go there.
In practice, the Netgear WG511 &
WG111T adaptors and the Belkin USB
wireless daptor all work reliably using
the Ndiswrapper. In the case of the
WG511, the p54pci driver had to be
blacklisted while for the Belkin device
it was the rt2500usb driver.
No blacklisting was required for the
WG111T, since no native driver was
Alternatively, if you are using an
external adaptor, the MAC address will
be on a label attached to the device.
STEP 4: Enable either WPA or WEP
encryption (WPA = Wifi Protected
Access; WEP = Wired Equivalent Privacy). Provided your network adaptor
supports it, WPA is the one to go for
since WEP is no longer regarded as
being secure (although it’s still better
than nothing if you have no choice).
Note that the wireless router should
be set up from your laptop or PC
using a wired (ie, ethernet or USB)
connection. Don’t set it up using an unsecured wireless connection because
it’s wide open to anyone who may be
snooping while you’re doing so.
Note that it will also be necessary
to enter the WPA (or WEP) key into
the wireless networking profile on
the laptop, otherwise you will not be
able to access the wireless router.
Depending on the operating system,
you may have to enter the MAC address as well.
loaded in the first place. By the way,
the athfmwdl.inf driver was the one
that worked for my WG111T, not the
netwg11t.inf driver which was also on
the Netgear installation CD.
WG111v2 tantrums
The WG111v2 loads the Prism
p54usb driver as its native driver but
despite correctly blacklisting this, it
initially stubbornly refused to work
under Ndiswrapper. It fact, the installed Windows driver wouldn’t even
recognise the device.
A few minutes research on the Internet licked that problem. If you’ve
got a WG111v2 and its serial number
starts with WG72 or WG16, then it’s
really a WG111v1 device (despite what
the label says) and you must use the
WG111v1 driver.
So the incorrect driver was being
used. Downloading and installing
the correct v1 driver from the Netgear
website got it working.
Troubleshooting
If Ndiswrapper doesn’t work, try using a different Windows driver. Some
wireless adaptors come in different
siliconchip.com.au
Useful Command Line Utilities
A USB wireless adaptor
can be used if necessary but
PC card adaptors (eg, the WG511)
are less vulnerable to damage in
laptops.
versions with different chipsets, so
be careful if downloading drivers off
the Internet. You must get the correct
driver for your particular device otherwise it won’t work (see the note about
the Netgear WG111v2 above).
For this reason, try to use the driver
that was supplied on the CD-ROM with
the wireless adapter.
Note that you cannot use Windows
Vista drivers with Ndiswrapper – it’s
limited to Windows XP and Windows
2000 drivers.
If you want to check which files have
been installed under Ndiswrapper,
take a look at the /etc/ndiswrapper
folder. The install procedure should
have copied both the Windows .inf
and .sys files to a sub-folder. Delete
the sub-folder if you want to get rid
of them.
Blacklisting
If you want to check which driver
modules have been blacklisted, click
Menu -> System -> BootManager
Configure Bootup. This allows you
to access the “Module Blacklist Manager” – see Fig.11. The loaded modules
are listed at left, while the blacklisted
modules are in the righthand pane.
To add a module to the blacklist,
simply select it in the lefthand pane
and click “Add”. Conversely, to
remove it from the blacklist, select
it in the righthand pane and click
“Remove”.
Alternatively, you can directly handfettle the /etc/rc.d/modulesconfig file
in a text editor. The blacklisted files
go in the SKIPLIST section. Always be
sure to leave a space between the last
siliconchip.com.au
Fig.12: the ifconfig -a command can be used to discover the MAC address
of any network adaptors attached to the machine. It will also display any
IP addresses that have been assigned.
Fig.13: the iwconfig command gives information on the wireless set-up,
including the broadcast ESSID if connected to a network.
Several useful Linux command-line utilities can be used to help you get
your network (either wireless or cable) up and running. They are as follows:
(1) ifconfig -a, (2) iwconfig and (3) lsmod.
Ifconfig -a is useful for discovering the MAC address of the wireless network adaptor and will also list its IP address if one has been picked up (the
equivalent Windows command is ipconfig /all ). By contrast, iwconfig gives
information on the wireless set-up. It shows the broadcast ID or ESSID (provided it’s connected), the frequency, the bit rate and even the encryption key.
The third command, lsmod, lists the driver modules that Puppy (or Ubuntu)
has loaded. Among other things, this is useful for discovering which native
driver is loading for your wireless adaptor (this driver must be blacklisted if
you are using Ndiswrapper).
To run a command in Puppy, simply click the “Console” icon on the desktop
to open a terminal window, then type the command and press Enter.
entry and the end quote mark.
Finally, if Ndiswrapper stubbornly
refuses to work, try blacklisting the
Broadcom drivers in the /etc/rc.d/
modulesconfig file. Open this file
in a text editor and add bcm43xx
b43 b43legacy ssb to the end of the
SKIPLIST section. Be sure to leave a
space between the final entry and the
SC
end quote mark.
April 2009 19
|