Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Beginning Ubuntu Linux - From Novice To Professional (2006)

.pdf
Скачиваний:
67
Добавлен:
17.08.2013
Размер:
25.54 Mб
Скачать

88

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

Perhaps it goes without saying that you should ensure your wireless card is compatible with WPA before you start. It’s found on models of one or, at most, two years old. You can learn this information from the card’s packaging or by visiting the manufacturer’s web site.

Caution Some earlier wireless cards rushed to include WPA before it was fully certified and may feature buggy implementations. In such cases, it might be possible to update the firmware of the card, usually using a utility that runs in Windows. If you suspect your card has this fault, check the manufacturer’s support site for details.

You’ll also need to know if the card uses a driver module that’s compatible with wpasupplicant, the software that handles WPA management under Ubuntu. As this book went to press, wpasupplicant was compatible with the following wireless drivers: HostAP, Prism54, Madwifi, Atmel, wext, NdisWrapper, and ipw.

You can discover which driver your card uses through Ubuntu’s Device Manager. Open Device Manager (System Administration Device Manager) and look for your wireless card in the list of hardware on the left side of the window. Once you find it, select it, and then click the Advanced tab on the right side of the window. Find the line that reads info.linux.driver, and look in the Value column for the name of the driver. If what you discover isn’t in the list of compatible drivers, then wpasupplicant won’t work with your card. If it is present, make a note of the name of the driver, because you’ll need to know it to complete the configuration.

Finally, you’ll need to know how Ubuntu refers to your wireless card. Open the Network Settings applet (System Administration Networking) and look for the entry in the list referring to your wireless card. It should read, “The interface for x is active/not configured,” where x will be eth0, ath0, or wlan0 (or possibly something else). Whatever the case, make a note of it for later use.

Note There’s a chance that wpasupplicant will support more drivers than those I’ve listed by the time you read this. With the version I used, I could find out which drivers were supported by viewing the help documentation that appeared when I typed wpasupplicant, without any command options, in a GNOME Terminal window.

To install the wpasupplicant software, first configure the Synaptic Package Manager to access Ubuntu’s online software repositories. This is necessary to download the wpasupplicant software package. If you haven’t already set up online repositories, see the “Setting Up Online Software Repositories” section later in this chapter. Once that’s completed, return here.

Obviously, you’ll need to find some way of getting online to do be able to download using the Synaptic Package Manager. Consider making a direct Ethernet connection to your router, or simply turn off WPA on the router for the duration of the download.

Follow these steps to configure WPA:

1.Select System Administration Synaptic Package Manager.

2.Click the Search button. Enter wpasupplicant as a search term.

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

89

3.In the list of results, click the check box next to wpasupplicant and opt to install it.

4.Open a GNOME Terminal window (Applications Accessories Terminal) and type the following to open in Gedit the first wpasupplicant configuration file you’ll need to edit:

sudo gedit /etc/default/wpasupplicant

5.Look for the line that reads ENABLED=0. Change it to ENABLED=1.

6.Beneath this, you’ll see a line that reads OPTIONS="-w". Change this to read as follows:

OPTIONS="-D drivername -i adaptername –c /etc/wpa_supplicant.conf –w"

Replace drivername with the name of the driver you discovered earlier. Enter it in lowercase (for example, prism54 or atmel). Replace adaptername with the name Ubuntu assigns your card, which you also discovered earlier (such as eth0, ath0, wlan0, or something similar).

7.Save the file and close Gedit.

8.Now you need to edit the second wpasupplicant configuration file. In the GNOME Terminal window, type the following:

sudo gedit /etc/wpa_supplicant.conf

9.At the bottom of the file will be four lines, the first one of which will read network={ and the last of which will be a } symbol by itself. At the beginning of each of these lines, insert a # symbol. In other words, the first line will now read #network={, and the last will read #}. Then save the file.

10.It’s now time to enter the WPA passphrase. Typing the following will immediately prompt you for the passphrase and also automatically update your configuration files:

wpa_passphrase wifi_station_name | sudo tee -a /etc/wpa_supplicant.conf

Replace wifi_station_name with the SSID name of your wireless base station. The SSID name is how the base station identifies itself and, provided the base station is set to broadcast its name, you can discover it by using the Network Settings applet and looking in the Network Name (ESSID) drop-down list for your wireless card.

11.The cursor will move to a blank line. Type the WPA passphrase for your router, and then press Enter.

12.Now you need to make wpasupplicant start at bootup. Type the following in the terminal window:

sudo ln –s /etc/init.d/wpasupplicant /etc/rc2.d/S40wpa

13.Reboot, and you should now find that you are able to connect to the WPA-protected wireless network.

90

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

USING NDISWRAPPER

You might find that your wireless card is not supported under Ubuntu. While the people who write drivers for Linux endeavor to have the operating system work with all wireless cards, they often need to reverse-engineer wireless card technology, and this can mean that drivers take a while to appear. In cases such as this, it’s sometimes possible to use NdisWrapper. This allows you to use Windows XP drivers for the wireless card. It’s not a perfect solution, but it’s certainly worth a try.

Sadly, although NdisWrapper is fundamentally simple to use, there are special considerations for each card and it’s not possible to provide an all-encompassing guide here. The best policy if you wish to use NdisWrapper is to search the Ubuntu Forums (www.ubuntuforums.org) for a guide to configuring your particular card. It’s almost certain that at least one other person will have posted a how-to tutorial. However, you should first check http://ndiswrapper.sourceforge.net/mediawiki/index.php/List to see if your card is listed among those known to work.

Configuring Dial-Up Internet Access

At one time, nearly all home users (and even some workplaces) used dial-up modems across phone lines to access the Internet. But since the boom in broadband courtesy of DSL and cable television, dial-up access has declined in popularity.

Ubuntu has excellent support for dial-up connections but, unfortunately, only for certain modems. In simple terms, it supports many external serial modems and some internal models (including PCI and PCMCIA cards), but it doesn’t directly support so-called Winmodems, which are the most popular type of dial-up modem on the market today.

Winmodems rely on Windows taking care of the coding/decoding work, hence the name. This is done to save on component costs during manufacturing.

The companies that make the hardware behind Winmodems aren’t always helpful to the Linux kernel programmers, and it can be difficult for them to make the modems work under Linux. Yet more manufacturers provide the required drivers but under a software license that’s not compatible with the GNU Public License (GPL) used throughout the rest of Linux. This means that including the software with Linux brings with it ethical and even legal issues.

A project that works to bring support for most Winmodems to Linux is called Linmodems. However, the Ubuntu developers have decided not to include its software within Ubuntu at the moment. If you would like to try to make your Winmodem work under Ubuntu, visit the Linmodem project’s web page, http://linmodems.org. You’ll find a welcoming community of users who are dedicated to helping others get online. Alternatively, you can skip straight to the guide that’s written for beginners who would like to make a Winmodem work under Linux: http://linmodems.technion.ac.il/first.html. Searching the Ubuntu forums (www.ubuntuforums.org) might also reveal useful information.

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

91

Note The easiest solution if you have a Winmodem and intend to use dial-up connections on your computer is to buy an external modem that connects to your computer via its serial port. These types of modems can be purchased for as little as $10 to $20, if you shop around. Auction sites like eBay (www.ebay.com) are a particularly good place to look for external modems. Practically all external modems are guaranteed to work with Ubuntu.

Before you start configuring your dial-up modem, you’ll need to know your dial-up username and password, and also the phone number to use in order to get online. You should ensure that your modem is plugged into the phone socket and is powered up.

1.Right-click a blank spot on the Panel at the top of the Ubuntu desktop and select Add to Panel.

2.In the list of applets, scroll down to the System & Hardware section and click Modem Monitor. Then click the Add button.

3.You should find a new phone icon on your Panel. Right-click it and select Properties.

4.In the window that appears, put a check in the Enable This Connection box, and then fill in the details in the rest of the dialog box.

5.In the Phone Number field, type the ISP’s dial-up number, including any area code or other prefix.

6.In the Dial Prefix field, type the number that you might need to access an outside line if you’re in an office. Alternatively, you might choose to enter the prefix you normally dial to activate a particular call plan. Otherwise, this box can be left empty.

7.In the Username and Password fields, enter your dial-up username and password (not your Ubuntu login username and password!).

8.Click the Modem tab and, if you have an external modem, select /dev/ttyS0 in the Modem Port drop-down list. This assumes that the modem is plugged into the first of your serial ports. If you know that it’s plugged into the second serial port, select /dev/ ttyS1. If your modem is internal, you may need to select /dev/modem or /dev/ttyS4, depending on your hardware configuration. If you find your modem connection doesn’t work when you test it, come back to this step and try a different port setting.

9.If you wish to hear your modem dialing and making the connection, click the Volume drop-down list.

10.Click the OK button.

After this setup, you can connect to your ISP by right-clicking the phone icon and selecting Activate, as shown in Figure 8-5. When you wish to hang up, right-click and select Deactivate. Note that you’ll be prompted to enter your Ubuntu login password whenever you attempt to go online.

92

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

Figure 8-5. Going online with your dial-up modem is simply a matter of right-clicking the icon and selecting Activate.

Using a USB-Based DSL Modem

Some people connect to broadband Internet services using a DSL modem that connects to the computer via USB. This is very common in the United Kingdom, where such modems are provided free of charge as part of ADSL broadband subscriptions.

Sadly, as with dial-up modems, support for the majority of USB-based DSL modems isn’t included in Ubuntu. To get such modems working, you must download and install additional drivers, as well as configuration software. This can be rather complicated and, if you can afford it, by far the best policy is to upgrade to a router-based modem and connect via an Ethernet or wireless connection. Such modem routers are inexpensive nowadays, and most modern PCs have Ethernet ports built in. The popular HowStuffWorks site (http://computer.howstuffworks. com/home-network.htm) produces a good guide for beginners that explains home networking.

Here, I’ll explain how to configure the BT Voyager series, which is common in the United Kingdom, and the Alcatel SpeedTouch series, shown in Figure 8-6, which is more common in the United States and Europe. The BT Voyager uses the Globespan chipset, and with some minimal adaptation, the instructions provided here should work for all modems based on this hardware. See http://eciadsl.flashtux.org/modems.php?lang=en for a complete list. On this web page, you’ll also find links to software that supports other USB ADSL modems, such as those made by Olitec, Alcatel, and Elsa (follow the Conexant link for Olitec).

Prior to following these steps, you’ll need to find out your DSL technical settings, including the VPI/VCI settings as well as your username and password. These can be discovered by phoning your ISP’s technical support line or by looking through the documentation sent to you when you subscribed to the service.

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

93

Figure 8-6. If you use an Alcatel SpeedTouch USB modem, you can get online with just a little configuration work.

Setting Up a BT Voyager USB ADSL Modem

The instructions in this section will work with all USB models of the Voyager modem, up to Voyager 105. If you have a Voyager 205, which includes both USB and router functionality, you’re strongly advised to connect via Ethernet instead of USB. This simply involves running a Cat 5 cable from your PC’s Ethernet port to one of the Ethernet inputs on the Voyager modem, and then following the instructions to configure a DHCP Ethernet connection, presented earlier in this chapter.

You’ll need to download a package file, so you must go online by some other means, perhaps via dial-up (see the previous section). Alternatively, you might grab the files on a different computer and transfer them onto your Ubuntu system via a floppy disk or USB memory stick (see the “Using a USB Memory Stick” section later in this chapter).

Follow these steps to set up a BT Voyager modem:

1.Visit http://eciadsl.flashtux.org/download/ and download the eciadsl-synch_bin. tar.bz2 file to your /home directory.

2.At the same download site, grab the latest version of the eciadsl-usermode file that has an .i386.deb file extension. The version numbers appear in the middle of the filename. At the time of writing, the latest version was eciadsl-usermode_0.11-1.i386.deb. Create a new directory within your /home directory called packages and download it there.

3.Visit http://archive.ubuntu.com/ubuntu/pool/universe/r/rp-pppoe/ and download the latest version of the pppoe file (not rp-pppoe!) that has an .i386.deb file extension. At the time of writing, this was pppoe_3.5-4ubuntu1_i386.deb. Save it into the packages directory you created earlier.

94

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

4.Open a GNOME Terminal window (Applications Accessories Terminal) and type the following in sequence (the ~ symbol can be found above the # key on UK keyboards and above the top-left key on US keyboards). Note that you’ll need to type your login password when prompted.

cd ~/packages/ sudo dpkg –i * cd ~

tar xjf eciadsl-synch_bin.tar.bz2

sudo mv eciadsl-synch_bin/* /etc/eciadsl/ rm –rf eciadsl-synch_bin/

5.To run the modem configuration program, type the following: sudo eciadsl-config-tk

6.You’ll see the window shown in Figure 8-7. Start by entering your username and password (if required) in the User and Password fields.

Figure 8-7. It’s possible to get USB-based DSL modems working with a little effort.

7.Enter the VPI and VCI values in the fields at the top right of the program window.

8.In the Select Your Modem list, click the entry relating to your modem.

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

95

9.Put a check alongside Update Provider DNS and select your ISP from the list.

10.In most cases, the Select a PPP Mode, Chipset, and Change Synch .bin File settings can be left unchanged. However, if you use a Voyager 105 modem, put a check in the box alongside Change Synch .bin File, and then select gs7470_synch03.bin from the list.

11.Click the Create Config button.

12.Back in the GNOME Terminal window, type the following: sudo eciadsl-start

13.This will connect you to your ISP via the modem. Attempt to browse a web site to see if the connection works.

14.In order for your connection to start automatically every time you boot, you will need to create a startup script. In the GNOME Terminal window, type the following:

sudo gedit /etc/init.d/voyager_start

15.This will open a Gedit window in which you should type the following, and then press Enter:

eciadsl-start

16.Save the file.

17.In the GNOME Terminal window, type the following:

sudo chmod +x /etc/init.d/voyager_start

sudo ln –s /etc/init.d/voyager_start /etc/rc2.d/S20voyager_start

18.Finally, delete the package directory you created earlier, as well as the eciadsl-synch_ bin.tar.bz2 file.

Don’t forget that logging on via DSL can take some time, depending on the quality of your connection. On my test system, I found that it could take up to a minute after the desktop appeared to establish a connection. I also found the modem wouldn’t work unless other network interfaces, such as Ethernet, were deactivated via the Network Settings applet (it was necessary to double-click the network card’s entry in the list and remove the check from Enable This Connection). I also found that I had to unplug and reattach the modem before undertaking step 12 in order to reset the modem.

Setting Up an Alcatel SpeedTouch Series USB DSL Modem

Before commencing configuration of an Acatel SpeedTouch modem, you’ll need to find out if your ISP uses the PPPoE or PPPoA technical standard. You can discover this by browsing to http://linux-usb.sourceforge.net/SpeedTouch/faq/index.html#q12 and searching for your country’s entry in the table. If your country is listed as using both standards, you should follow the instructions for PPPoA in the following steps.

You’ll need to download several files to complete this configuration, so you will either need to get your computer online by some other method, such as dial-up, or grab the files mentioned on a different computer and transfer them across to Ubuntu via floppy disk or

96

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

USB memory stick (see the “Using a USB Memory Stick” section later in this chapter). The SpeedTouch driver has two components, and you’ll need to download both.

Follow these steps to configure your modem (these instructions are adapted from a guide that you can find at http://linux-usb.sourceforge.net/SpeedTouch/ubuntu/warty.html):

1.Download the first driver file by browsing to www.speedtouch.com/download/drivers/ USB/SpeedTouch330_firmware_3012.zip in your browser. Place the downloaded file in your /home directory.

2.Visit http://linux-usb.sourceforge.net/SpeedTouch/ubuntu/modem_run. This will download the GPL component of the driver. Again, place the downloaded file in your /home directory.

3.If your ISP uses PPPoE, you’ll also need to visit http://linux-usb.sourceforge.net/ SpeedTouch/ubuntu/br2684ctl_20040226-1_i386.deb and download an additional file. Place it in your /home directory.

4.Because different drivers are used for each revision of the hardware, you will need to discover which version of the modem firmware you have. Open a GNOME Terminal window (Applications Accessories Terminal), and then type the following two lines, hitting the Enter key after each (the straight line is called a pipe symbol, which you can type by pressing Shift+\):

cat /proc/bus/usb/devices | grep -B 1 THOMSON cat /proc/bus/usb/devices | grep -B 1 ALCATEL

In the results will be a line that reads, at the end, Rev=x, where x is the firmware version number. Make a note of it for later.

5.Make sure the files you downloaded earlier are in your /home directory, and then type the following in the GNOME Terminal window to copy the firmware files to your system directories (the ~ symbol can be found above the # key on UK keyboards and above the top-left key on US keyboards). Note that you’ll need to type your login password when prompted.

cd ~

unzip SpeedTouch330_firmware_3012.zip

If your modem uses firmware version 4, type the following sudo cp ZZZL_3.012 /etc/ppp/mgmt.o

Otherwise, type the following:

sudo cp KQD6_3.012 /etc/ppp/mgmt.o

6.Now you must copy the modem_run file you downloaded earlier to your system directories and make it executable:

cd ~

sudo cp modem_run /usr/sbin

sudo chmod +x /usr/sbin/modem_run

C H A P T E R 8 G E T T I N G E V E R Y T H I N G U P A N D R U N N I N G

97

7.If your ISP uses PPPoE, you’ll need to install the br2684ctl_20040226-1_i386.deb file as well:

sudo dpkg –i br2684ctl_20040226-1_i386.deb

8.Now you must add your login details to the files pap-secrets and chap-secrets. The following will open both files in Gedit on two separate tabs:

sudo gedit /etc/ppp/pap-secrets /etc/ppp/chap-secrets

9.In both files, add the following line to the bottom:

"username" * "password"

Replace username and password with your ISP login details. For example, my username for my ISP is keir.thomas@btbroadband.com. My ISP doesn’t use passwords, so I simply typed "" in the password area. If you find this doesn’t work when you test this connection, try repeating this step and typing any word between the password quotation marks; it doesn’t matter what you type.

10.Save each file, and then exit Gedit.

11.Type the following to create the speedtch configuration file and edit it with Gedit: sudo gedit /etc/ppp/peers/speedtch

12.Add the following lines:

noipdefault defaultroute user 'username' noauth

updetach usepeerdns

plugin rp-pppoe.so nas0

VPI.VCI

Replace username with your ISP username, and replace VPI.VCI with your VPI and VCI settings, separated by a period. For example, because I live in the United Kingdom, I typed 0.38. Your ISP’s technical support line will be able to supply these values. (Note that VPI/VCI values are sometimes referred to as VP/VC.)

13.Save the file.

14.Type the following at the GNOME Terminal command-line prompt:

sudo rm -f /etc/resolv.conf

sudo ln -s /etc/ppp/resolv.conf /etc/resolv.conf

15.Next, you need to ensure certain modules load during boot. Load the modules file into Gedit:

sudo gedit /etc/modules