Tải bản đầy đủ - 0 (trang)
Hack 41. Get Proprietary Wireless Cards Working

Hack 41. Get Proprietary Wireless Cards Working

Tải bản đầy đủ - 0trang

chipset,though,butonlytoextractthefirmwareneededtooperatethe

cardcorrectly.Seehttp://bcm43xx.berlios.de/formoreinformation.



Installingndiswrapperandndisgtk

Startbyinstallingthendisgtkpackage,whichisaGUI

installationprogramforndiswrapper.Youcanopenaterminal

windowandinstallitfromthecommandlineoruseyour

favoritepackage-managementtool.Pleaseensureyouhavethe

universerepositoryenabled[Hack#60].(Aptitudewill

automaticallygetndiswrapper-utils,sinceit'sadependencyfor

ndisgtk.)Also,makesureyouhavetheWindowsdriversfor

yourparticularwirelessadapterready,sincendisgtkwillprompt

youforthemlateron.IfyoufindthattheWindowsdriversare

trappedina.cabfile,tryinstallingcabextractandunshieldand

usingthosetogetatthepreciousdriverstrappedwithin(both

oftheseareavailableintheuniverserepository):

conner@firetruck:$sudoaptitudeinstallndisgtk





WrappingtheWindowsDrivers

Oncethatisdone,insertorenableyourwirelessadapterand

runndisgtkfromaterminal:

conner@firetruck:$sudondisgtk





ndisgtkwillpresentyouwithawindow(seeFigure4-6),

allowingyoutoinstallanewdriver.



Figure4-6.Ndisgtk'smainwindow



Clickon"Installnewdriver,"andndisgtkwillaskyouforthe

locationofyourWindowsdrivers,asshowninFigure4-7.

ChooseyourWindowsdriversintheLocationfieldandclick

Install.



Figure4-7.Whereareyourdrivers?



Oncendisgtkisfinishedcopyingyourdriversandsettingupthe

files,youwillseethefirstwindowagain,butndisgtkwillhave

populateditwithyourdriver,asshowninFigure4-8.



Figure4-8.Windows-onlyhardware?Ithinknot...



ConfiguringtheAdapter

Atthispoint,thewirelessadapterisjustanotherpieceofLinuxenabledhardware.YoucanusethestandardUbuntutools,such

asthenetworkwizardintheSystemmenuorNetworkManager

[Hack#42],tomanagetheconnection.Asasanitycheck,you

canrundmesgandseeifndiswrapperpickedupyouradapter:



conner@firetruck:$dmesg

[4295357.170000]pccard:CardBuscardinsertedintoslot0

[4295357.181000]ndiswrapper:drivertnet1130(TexasInstrument

[4295357.182000]PCI:Enablingdevice0000:02:00.0(0000->000

[4295357.182000]ACPI:PCIInterrupt0000:02:00.0[A]->Link[L

[4295357.183000]PCI:Settinglatencytimerofdevice0000:02:0

[4295357.876000]ndiswrapper(IoCreateUnprotectedSymbolicLink:7



[4295357.876000]ndiswrapper:usingirq11

[4295358.916000]wlan0:vendor:'TNET1130'

[4295358.916000]wlan0:ndiswrapperethernetdevice00:12:0e:0d

[4295358.916000]wlan0:encryptionmodessupported:WEP;TKIPw



Also,thestandardiwconfigcommand-linetoolcanbeusedto

configureyouradapter,ifyou'recomfortablewiththat:



conner@firetruck:~$iwconfigwlan0

wlan0IEEE802.11gESSID:"NullDevice.Net"

Mode:ManagedFrequency:2.462GHzAccessPoint:00:0C

BitRate:54Mb/sTx-Power:10dBmSensitivity=0/3

RTSthr:4096BFragmentthr:4096B

PowerManagement:off

LinkQuality:100/100Signallevel:-42dBmNoiselev

Rxinvalidnwid:0Rxinvalidcrypt:0Rxinvalidfra

Txexcessiveretries:0Invalidmisc:0Missedbeaco



Thereisoneflawwithndiswrapper.Duetothewayitoperates,signal

strengthmeters(suchasthoseprovidedbyNetworkManager[Hack

#42]andthecommand-lineiwconfigtool)donotworkproperly.Those

toolswillalwaysreport100-percentsignalstrength.



Don'tletthefearofincompatiblewirelessnetworkcardskeep

youfromusingUbuntuonyourcomputer.Nowyoucanfree

yourselfandyouroperatingsystembyusingndiswrapperon

Ubuntu!



Hack42.RoamWirelessly



Movingfromonewirelessnetworktoanotherhas

traditionallybeenapainunderLinux.Here'showyoucan

simplifythisaspectofmobilecomputingusingyour

wirelessadapterandNetworkManager.

Oneofthecoolestthingsabouthavingalaptopthat'sWi-Fienabledisbeingabletogofromplacetoplaceandfreely

associatewithanyhotspotsthatmaybearound.Ifyoudothis

often,itreallychangesthewayyouwork,asplaceslikeyour

localcoffeeshophavethepotentialtobecomeyouroffice.If

youuseaWindowsorMacOS-equippedlaptop,bouncingfrom

placetoplaceisn'tmuchofachallenge:yousimplyopenup

yourcomputer,ittellsyouwhataccesspointsarearound,you

clickononetoassociatewiththatnetwork,andyou'reoffand

running.UnderLinux,however,that'sbeenproblematic,as

therehaven'tbeenanytoolsthatmakeWi-Fieasy...untilnow.



UsingYourWirelessNetworkCard

Ubuntusupportsagoodnumberofwirelesscardsandadapters

outofthebox;simplypluginyouradapteranditshouldbe

recognizedautomatically(ifnot,see"GetProprietaryWireless

CardsWorking"[Hack#41]).Toverifyyouradapteris

recognized,openaterminalwindowandissuethefollowing

command:

bill@defiant:~$iwconfig

lonowirelessextensions.

eth0nowirelessextensions.



eth1IEEE802.11gESSID:"ItsAGrind"

Mode:ManagedFrequency:2.412GHzAccessPoint:00:0

BitRate=24Mb/sTx-Power=20dBm

Retrylimit:7RTSthr:offFragmentthr:off

PowerManagement:off

LinkQuality=53/100Signallevel=-69dBmNoiseleve

Rxinvalidnwid:0Rxinvalidcrypt:0Rxinvalidfra

Txexcessiveretries:41Invalidmisc:0Missedbeac



Ifyouseeoutputsimilartowhat'sabovementioninganIEEE

interface,thenyourcardisrecognizedbyUbuntuandyoucan

eitherusethebuilt-innetworkingtools(System

Administration Networking)tomanageit,orproceedonwith

thishacktoinstallNetworkManager.Ifyoudon'tseeawireless

cardlistedthere,thenyou'llneedtofollowtheinstructionsin

"GetProprietaryWirelessCardsWorking"[Hack#41]toget

yourcardworkingusingndiswrapper.



NetworkManagerandYou

ThefolksoveratRedHathavecomeupwithatoolthatmakes

Wi-Fimanagementaseasyasacoupleofmouseclicks.The

tool'scalledNetworkManager(seeFigure4-9),andit'sa

GNOMEappletthatsitsinyournotificationarea.

NetworkManagerwillnotonlymanageWi-Ficonnections,it'll

automaticallyhookupyourlaptopwithawiredconnection

whenyoupluginanEthernetcable.



Figure4-9.NetworkManagerinaction



NetworkManagercannotmanageanycardsthathaveentriesin

/etc/network/interfaces.Ifyou'veaddedyournetworkcardtothatfile,

makesureyouremoveitbeforeyoustartworkingwith

NetworkManager.



FromtheNetworkManagerwebsite:

Alaptopusershouldneverneedtousethecommandlineor

configurationfilestomanagetheirnetwork;itshould"Just

Work"asautomaticallyaspossibleandintrudeaslittleas

possibleintotheuser'sworkflow.NetworkManagerattemptsto

makenetworkinginvisible.Whenmovingintoareasyou'vebeen

before,NetworkManagerautomaticallyconnectstothelast

networktheuserchosetoconnectto.Likewise,whenbackat

thedesk,NetworkManagerwillswitchtothefaster,more

reliablewirednetworkconnection.

So,nowthatwe'vewhettedyourappetite,let'sget

NetworkManagerinstalled.First,you'vegottomeetacouple

prerequisites:

YoumusthaveawirelessEthernetadapter,eitherbuilt-inor

PCMCIA.



NetworkManagerworksonlywithDHCP-assignedaddresses.

IfyoumusthaveastaticIPaddress,workwithyourDHCP

administratortogetauniqueDHCPreservation,oryou'll

needtouseanothertool(suchasSystem Administration

Networking).

Let'sgetNetworkManagerinstalledandworking.It's

surprisinglyeasy.

First,apt-getthepackages.Fromaterminal,run:

bill@defiant:~$sudoapt-getinstallnetwork-manager-gnome





ThiswillinstallboththeNetworkManagerdaemon(asa

dependency)andthenm-appletthatsitsintheGNOME

notificationarea.You'llnoticethattheNetworkMangerservice

getsstartedwhentheinstallationcompletes.Allthatremainsis

toverifythatnm-applethasbeenaddedtoyoursessionandto

rebootthesystem,sincechangestoHAL(thehardware

abstractionlayer)weremadewhenthepackagesinstalled.

ToverifythatNetworkManager'snm-appletprogramhasbeen

addedtoyourautostartupsessions,clickontheSystemMenu

inyourmenubar,selectPreferences,andthenclickon

Sessions.ClickonStartupPrograms,asshowninFigure4-10.

Youshouldseeannm-appletlistingthere.Ifthereisn'tone,

youcanadditbyclickingonAddandthenbyfillingoutthe

dialog.



Figure4-10.ThesessionsdialogshowingStartup

Programs



Nowallthatremainsforyoutodoistoreboot.Onceyou've

rebootedandloggedintoyourmachine,you'llseethe

NetworkManagericoninyournotificationarea.Ifyou're

pluggedintoEthernet,youshouldseealittle"plug"icon.Touse

Wi-Fi,clickontheNetworkManagericonandselecttheaccess

pointwithwhichyouwanttoassociate.IftheWi-Fiaccesspoint

requiresanencryptioncode,you'llbepromptedtoenterit.

Also,ifthisisyourfirsttimeusingtheGNOMEkeyringservices,

you'llbepromptedtoselectakeyringpassword.TheGNOME

keyringcachesalltheWEPkeysforyou,soallyouneedto

rememberisyourGNOMEkeyringpassword.

That'sallyouneedtogetwirelessroamingworking,thanksto

NetworkManager!



Hack43.MakeLaptopSettingsRoamwithYour

Network



Usethelaptop-netprogramtoconfiguresettingsthat

changeasyouconnecttodifferentnetworks.Makeyour

worksettingsfollowyoutowork,andyourhome

settingsfollowyouhome.

Whenyouusealaptop,particularlyasyourprimarysystem,

youstarttonoticesomeofthewaysmostsystemsarebiased

towardadesktopcomputer.Primarily,theassumptionisthatall

ofyoursettingswillstaythesamenomatterwhereyouare.

Yet,ifyoutakeyourlaptoptoandfromworkyouknowthis

simplyisn'tthecase.Notonlydonetworksettingsoften

change,butprinters,fileshares,andallsortsofotheraspects

ofthesystemaredifferentdependingonwhereyouare.Asa

laptopuser,itwouldcertainlybeniceiftherewereawayto

haveclassesofsettingsthatappliedbasedonwhereyouwere.

Luckyforyou,thelaptop-netpackagetakescareofthesebasic

needsandmore.

Thelaptop-netprogramdoesanumberofthings,butthe

primarythingitallowsyoutodoistorunparticularscriptsand

applyparticularsettingsbasedonwhichIPaninterface

currentlyhas.Eventhoughyourhome,work,andfriend'shouse

mayalluseprivateIPaddressranges,theyallprobablyuse

slightlydifferentschemes,and,moreimportantly,youprobably

getassignedaparticularIPorrangeofIPsdependingonwhich

networkyouareon.Withlaptop-net,youcansay"WheneverI

havethisIP,runtheseprogramsandenablethesesettings."

Becauseofthewaylaptop-netisdesigned,whatyoucandois

limitedonlybyyourscriptingability.Inthishack,wewill

describehowtointegratelaptop-netintoanUbuntusystemand



walkyouthroughsomecommonconfigurationschemes.



Installlaptop-net

Thefirststepistoinstalllaptop-net.Usingyourpreferred

packagemanagerinstallthelaptop-netandlaptop-net-doc

packages.Onceeverythingisinstalled,youwillwantto

reconfigurelaptop-net:

$sudodpkg-reconfigurelaptop-net





Now,bydefault,laptop-netcandoanumberofnicethingssuch

asdetectcableinsertionandautomaticallybringupandtake

downinterfaces.We'venoticed,however,thattheseautomatic

functionscansometimesinterferewiththewayUbuntuwants

toconfigurethenetworkespeciallyifyouareusingapackage

likeNetworkManagersoyouneedtodisablesomeofthis

functionalityinlaptop-net.

Asthelaptop-netconfigurationprogramruns,besuretotellit

thatyouaregoingtouseDHCPforyournetworkandthatyour

EthernetadapterdoesnotsupportMII,evenifitdoes.

Sincelaptop-netwon'tautomaticallyengagewhenevery

interfaceisbroughtup,youmustaddaspecialscriptto

/etc/dhcp3/dhclient-exit-hooks.d.Scriptsinthisdirectoryare

executedwhenchangesoccurindhclient(specifically,whenthe

/etc/dhcp3/dhclient-scriptrunsandexecutestheexit_with_hooks

function).Namethefollowingfile/etc/dhcp3/dhclient-exithooks.d/laptop-net:

if[$reason='BOUND'];then

/usr/share/laptop-net/profile-change$interface



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Hack 41. Get Proprietary Wireless Cards Working

Tải bản đầy đủ ngay(0 tr)

×