个人工具

“UbuntuHelp:WifiDocs/Device/WG121”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/WifiDocs/Device/WG121}} {{Languages|UbuntuHelp:WifiDocs/Device/WG121}} == WG121 HowTo == This page details the procedure to enable the Netgear WG...)
 
 
(未显示2个用户的6个中间版本)
第2行: 第2行:
 
{{Languages|UbuntuHelp:WifiDocs/Device/WG121}}
 
{{Languages|UbuntuHelp:WifiDocs/Device/WG121}}
 
== WG121 HowTo ==
 
== WG121 HowTo ==
 
+
This page details the procedure to enable the Netgear WG121 USB Wireless Adapter to work on Ubuntu, the first section is a quickstart on Hardy Heron(8.04), this should also work on Gutsy Gibbon(7.10) also.. For earlier versions please use the second part of the guide..
This page details the procedure to enable the Netgear WG121 USB Wireless Adapter to work on Ubuntu 6.10 (Edgy Eft).
+
=== Hardy Heron (8.04) & Gutsy Gibbon (7.10) ===
 
+
Okay with Hardy the whole process has been streamlined alot..
 +
First step is to install Ubuntu, next is to reboot, ('''UNPLUG the adapter at this point''') and put the install cd back in.. Go to System -> Administration -> Synaptic Package Manager (or Adept in Kubuntu).
 +
Install the build-essential & ndisgtk packages.. (And related dependencies)
 +
Find the driver cd, or ndis5 drivers from netgear.com and put it into the drive..
 +
Go to System -> Administration -> Windows Wireless Drivers.. Hit install new driver, go to the driver cd and then into the /ndis5 folder and select the netwg121.inf file..
 +
Now I plugged in the adapter at this point and nothing happened.. So I rebooted and it worked..
 +
Hope this works for you, Alex Latchford
 +
=== All Other Previous Versions ===
 
'''Note:''' To install on Feisty you will need to grab a newer copy of ndiswrapper, I am presuming this is a libc6 issue. I grabbed 1.37 but anything close to that should work. Go up to and including step 4, after modprobing ndiswrapper the new network manager took over for me, worked like a charm - Alex Latchford (20070226)
 
'''Note:''' To install on Feisty you will need to grab a newer copy of ndiswrapper, I am presuming this is a libc6 issue. I grabbed 1.37 but anything close to that should work. Go up to and including step 4, after modprobing ndiswrapper the new network manager took over for me, worked like a charm - Alex Latchford (20070226)
 
+
'''Note:''' Ubuntu Feisty Fawn 7.04 requires additional drivers blacklisting (prism54usb and prism54common), plus i used version 1.38 of ndiswrapper instead of 1.16. Tested with Xubuntu and Kubuntu-  Oimon
=== Step 1 - Prerequisites ===
+
'''Note:''' Gutsy Gibbon: This card will also work with this [[UbuntuHelp:HowTo|HowTo]], however it does require the latest ndiswrapper source.. I used 1.51 which works a charm.. Also Step 5 should now be redundant as it should be picked up through the network-manager past step 4. - Alex Latchford (20071221)
 
+
==== Step 1 - Prerequisites ====
 
First thing, if you have the Adapter plugged in, please remove it until you are told to insert it. As this will cause problems later if left inserted.
 
First thing, if you have the Adapter plugged in, please remove it until you are told to insert it. As this will cause problems later if left inserted.
 
 
Second thing, this guide was originally written for Ubuntu and therefore contain Gnome Specific commands, however I am fairly confident that this will work on Kubuntu, Edubuntu and Xubuntu. A [http://www.ubuntuforums.org/showthread.php?t=298306/ user with Xubuntu], has already been successful in following this guide. I'm presuming you will fall into the same sorts of errors. Just remember to change all '''gedit''' commands to: Kubuntu - '''kdesu''' and on Xubuntu - '''mousepad'''. Doing this should avoid those sorts of errors.
 
Second thing, this guide was originally written for Ubuntu and therefore contain Gnome Specific commands, however I am fairly confident that this will work on Kubuntu, Edubuntu and Xubuntu. A [http://www.ubuntuforums.org/showthread.php?t=298306/ user with Xubuntu], has already been successful in following this guide. I'm presuming you will fall into the same sorts of errors. Just remember to change all '''gedit''' commands to: Kubuntu - '''kdesu''' and on Xubuntu - '''mousepad'''. Doing this should avoid those sorts of errors.
 
+
In order to install the utilities needed for this card you will need a few other packages. Just run these commands, and all others displayed inside the dashed boxes in this [[UbuntuHelp:HowTo|HowTo]], through the '''''terminal'''''
In order to install the utilities needed for this card you will need a few other packages. Just run these commands, and all others displayed inside the dashed boxes in this HowTo, through the '''''terminal'''''
+
<pre><nowiki>
 
+
sudo apt-get update
<pre><nowiki>sudo apt-get update
+
 
sudo apt-get install build-essential</nowiki></pre>
 
sudo apt-get install build-essential</nowiki></pre>
 
 
Alternatively if you do not have wired Internet access, (as you are using wireless), install these by downloading the packages manually and [https://help.ubuntu.com/6.10/ubuntu/desktopguide/C/install-file.html/ installing them by hand].
 
Alternatively if you do not have wired Internet access, (as you are using wireless), install these by downloading the packages manually and [https://help.ubuntu.com/6.10/ubuntu/desktopguide/C/install-file.html/ installing them by hand].
 
 
You will also need to make a symbolic link from kernel sources directory to the modules directory, I do not really know why this is needed, but in the ndiswrapper documentation, (ndiswrapper being the package that we will using later), it says it is needed to suppress an error when compiling.
 
You will also need to make a symbolic link from kernel sources directory to the modules directory, I do not really know why this is needed, but in the ndiswrapper documentation, (ndiswrapper being the package that we will using later), it says it is needed to suppress an error when compiling.
 
 
Run the commands
 
Run the commands
 
+
<pre><nowiki>
<pre><nowiki>sudo apt-get install linux-headers-`uname -r`
+
sudo apt-get install linux-headers-`uname -r`
 
sudo ln -s /usr/src/linux-`uname -r` /lib/modules/`uname -r`/build</nowiki></pre>
 
sudo ln -s /usr/src/linux-`uname -r` /lib/modules/`uname -r`/build</nowiki></pre>
 
+
==== Step 2 - Removing existing drivers. ====
=== Step 2 - Removing existing drivers. ===
+
 
+
 
Ubuntu 6.10 (Edgy Eft) comes complete with a suite of drivers that are used to control Wireless Networking, however they dont really work for this card, so we are going to have to disable them.
 
Ubuntu 6.10 (Edgy Eft) comes complete with a suite of drivers that are used to control Wireless Networking, however they dont really work for this card, so we are going to have to disable them.
 
 
Run the command.
 
Run the command.
 
+
<pre><nowiki>
<pre><nowiki>gksudo gedit /etc/modprobe.d/blacklist
+
gksudo gedit /etc/modprobe.d/blacklist
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This will open up your text editor. Scroll down to the bottom and add these lines to the end of the file.
 
This will open up your text editor. Scroll down to the bottom and add these lines to the end of the file.
 
+
<pre><nowiki>
<pre><nowiki>blacklist islsm
+
blacklist islsm
 
blacklist islusb
 
blacklist islusb
 
blacklist islsm_usb
 
blacklist islsm_usb
第46行: 第44行:
 
blacklist net2280</nowiki></pre>
 
blacklist net2280</nowiki></pre>
 
('''Note:''' Not all of these drivers are 100% necessary in order to get the system to function, if you experience problems at a later date try removing the drivers; prism2_usb, islsm_pci & net2280)
 
('''Note:''' Not all of these drivers are 100% necessary in order to get the system to function, if you experience problems at a later date try removing the drivers; prism2_usb, islsm_pci & net2280)
 
+
If you have Feisty Fawn 7.04 or greater then add
 +
<pre><nowiki>
 +
blacklist prism54usb
 +
blacklist prism54common</nowiki></pre>
 
This would probably be a good time to restart your system as these wont changes take effect until this has taken place.
 
This would probably be a good time to restart your system as these wont changes take effect until this has taken place.
 
+
==== Step 3 - Downloading and Compiling ====
=== Step 3 - Downloading and Compiling ===
+
 
+
 
In order to get the card working we will need to use the Windows Wireless Driver Emulator, ''ndiswrapper''. I like to install all my programs through the /usr/src directory as it enables me to keep my Home folder clear of any unneeded code. So this is where we will install through.
 
In order to get the card working we will need to use the Windows Wireless Driver Emulator, ''ndiswrapper''. I like to install all my programs through the /usr/src directory as it enables me to keep my Home folder clear of any unneeded code. So this is where we will install through.
 
 
I am currently going to install version 1.16 of ndiswrapper, as this is the version I know is functioning correctly, you can try to use newer versions, but to me it seems like harder work, as 1.16 installs fine.
 
I am currently going to install version 1.16 of ndiswrapper, as this is the version I know is functioning correctly, you can try to use newer versions, but to me it seems like harder work, as 1.16 installs fine.
 
+
Run the commands.  
Run the commands.
+
'''Note:''' Feisty replace 1.16 with 1.38. Gutsy replace 1.16 with 1.51
 
+
<pre><nowiki>
<pre><nowiki>cd /usr/src
+
cd /usr/src
 
sudo wget http://kent.dl.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-1.16.tar.gz
 
sudo wget http://kent.dl.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-1.16.tar.gz
 
sudo tar -zxvf ndiswrapper-1.16.tar.gz
 
sudo tar -zxvf ndiswrapper-1.16.tar.gz
 
cd ndiswrapper-1.16</nowiki></pre>
 
cd ndiswrapper-1.16</nowiki></pre>
 
 
Ok, you should now have the package on your system, we are now going to compile it.
 
Ok, you should now have the package on your system, we are now going to compile it.
 
 
Run the commands.
 
Run the commands.
 
+
<pre><nowiki>
<pre><nowiki>sudo make uninstall
+
sudo make uninstall
 
sudo make
 
sudo make
 
sudo make install</nowiki></pre>
 
sudo make install</nowiki></pre>
 
 
Now you should have a copy of ndiswrapper installed and working on your system. You can test this by running the command.
 
Now you should have a copy of ndiswrapper installed and working on your system. You can test this by running the command.
 
+
<pre><nowiki>
<pre><nowiki>ndiswrapper -v
+
ndiswrapper -v
 
</nowiki></pre>
 
</nowiki></pre>
 
 
The expected output should be something like..
 
The expected output should be something like..
 
+
<pre><nowiki>
<pre><nowiki>alex@alex-ubuntu:~$ ndiswrapper -v
+
alex@alex-ubuntu:~$ ndiswrapper -v
 
utils version: 1.8
 
utils version: 1.8
 
driver version:        1.16
 
driver version:        1.16
 
vermagic:      2.6.17-10-generic SMP mod_unload 586 REGPARM gcc-4.1</nowiki></pre>
 
vermagic:      2.6.17-10-generic SMP mod_unload 586 REGPARM gcc-4.1</nowiki></pre>
 
+
==== Step 4 - Installing the Adapter ====
=== Step 4 - Installing the Adapter ===
+
 
+
 
Ok, the next step is to install the drivers for the card so it is actually functioning and can be detected.
 
Ok, the next step is to install the drivers for the card so it is actually functioning and can be detected.
 
 
First, insert the cd that came with the adapter in a CD Drive, open up the cd and copy across the folder called ndis5/ to your home folder. According to the installation guide for ndiswrapper this is needed as it will not install through the cd.
 
First, insert the cd that came with the adapter in a CD Drive, open up the cd and copy across the folder called ndis5/ to your home folder. According to the installation guide for ndiswrapper this is needed as it will not install through the cd.
 
 
Once that is done, Run the commands.
 
Once that is done, Run the commands.
 
+
<pre><nowiki>
<pre><nowiki>cd ~/ndis5
+
cd ~/ndis5
 
sudo ndiswrapper -i netwg121.inf
 
sudo ndiswrapper -i netwg121.inf
 
ndiswrapper -l</nowiki></pre>
 
ndiswrapper -l</nowiki></pre>
 
 
You should now see that your card is installed. Now you can insert the adapter into a USB Port and then run the command again. ndiswrapper -l), you should now see.
 
You should now see that your card is installed. Now you can insert the adapter into a USB Port and then run the command again. ndiswrapper -l), you should now see.
 
+
<pre><nowiki>
<pre><nowiki>alex@alex-ubuntu:~$ ndiswrapper -l
+
alex@alex-ubuntu:~$ ndiswrapper -l
 
Installed drivers:
 
Installed drivers:
 
netwg121                driver installed, hardware present </nowiki></pre>
 
netwg121                driver installed, hardware present </nowiki></pre>
 
 
You will also need to load the ndiswrapper module. You can do this by running the commands.
 
You will also need to load the ndiswrapper module. You can do this by running the commands.
 
+
<pre><nowiki>
<pre><nowiki>sudo depmod -a
+
sudo depmod -a
 
sudo modprobe ndiswrapper</nowiki></pre>
 
sudo modprobe ndiswrapper</nowiki></pre>
 
 
You can check the system log, (System->Administration->System Log), to make sure that the driver was loaded successfully. It should say something like this.
 
You can check the system log, (System->Administration->System Log), to make sure that the driver was loaded successfully. It should say something like this.
 
+
<pre><nowiki>
<pre><nowiki>ndiswrapper version 1.16 loaded (preempt=no,smp=yes)
+
ndiswrapper version 1.16 loaded (preempt=no,smp=yes)
 
ndiswrapper: driver netwg121 (NETGEAR, Inc.,11/13/2003, 1.0.5.1000) loaded
 
ndiswrapper: driver netwg121 (NETGEAR, Inc.,11/13/2003, 1.0.5.1000) loaded
 
wlan0: vendor: 'NETGEAR WG121 802.11g Wireless USB2.0 Adapter'
 
wlan0: vendor: 'NETGEAR WG121 802.11g Wireless USB2.0 Adapter'
第113行: 第100行:
 
wlan0: encryption modes supported: WEP; TKIP with WPA; AES/CCMP with WPA
 
wlan0: encryption modes supported: WEP; TKIP with WPA; AES/CCMP with WPA
 
usbcore: registered new driver ndiswrapper</nowiki></pre>
 
usbcore: registered new driver ndiswrapper</nowiki></pre>
 
+
==== Step 5 - Configuring the Adapter ====
=== Step 5 - Configuring the Adapter ===
+
'''Note:''' If you are running Feisty Fawn 7.04 or greater then you should be able to use the network-manager to manage the wireless connection now, left-click the icon in the system tray (top-right), it should now present you with a list of available networks, Please then proceed to step 6. If this is not the case then follow this step.
 
+
 
Ok, getting close to the end now. First run the command,
 
Ok, getting close to the end now. First run the command,
 
+
<pre><nowiki>
<pre><nowiki>iwconfig
+
iwconfig
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This will list all the available network connections, testing them to see if they are suitable for wireless activity.
 
This will list all the available network connections, testing them to see if they are suitable for wireless activity.
 
 
You should see something like this.
 
You should see something like this.
 
+
<pre><nowiki>
<pre><nowiki>alex@alex-ubuntu:~$ iwconfig
+
alex@alex-ubuntu:~$ iwconfig
 
lo        no wireless extensions.
 
lo        no wireless extensions.
  
第135行: 第119行:
  
 
eth2      IEEE 802.11g  ESSID: off/any   
 
eth2      IEEE 802.11g  ESSID: off/any   
Mode:Auto  Frequency:2.462 GHz  Access Point: None
+
          Mode:Auto  Frequency:2.462 GHz  Access Point: None
Bit Rate:54 Mb/s   
+
          Bit Rate:54 Mb/s   
RTS thr:2432 B  Fragment thr:2432 B   
+
          RTS thr:2432 B  Fragment thr:2432 B   
Power Management:off
+
          Power Management:off
Link Quality:100/100  Signal level:0 dBm  Noise level:0 dBm
+
          Link Quality:100/100  Signal level:0 dBm  Noise level:0 dBm
Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
+
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
Tx excessive retries:0  Invalid misc:0  Missed beacon:0</nowiki></pre>
+
          Tx excessive retries:0  Invalid misc:0  Missed beacon:0</nowiki></pre>
 
+
The wireless connection on my setup is through eth2, but it could be through eth1, eth3 or even wlan0. (wlan0 is probably the most common, but ethX works fine too).
The wireless connection on my setup is through eth2, but it could be through etj1, eth3 or even wlan0. (wlan0 is probably the most common, but ethX works fine too).
+
'''Note:''' ''If no connections have come up, take a look in the /var/syslog file, (after unplugging and re-plugging in the adapter), it should attempt to start up the card, it might state that it is has deactivated the adapter after the "ESSID could not be set to ' '".''
 
+
''I solved this issue by manually putting in the ESSID (network name), myself. To do this run the command.''
 +
<pre><nowiki>
 +
sudo iwconfig eth2 ESSID LATCHFORD
 +
</nowiki></pre>
 
Next step to to scan and try to find some networks. Run the command.
 
Next step to to scan and try to find some networks. Run the command.
 
+
<pre><nowiki>
<pre><nowiki>iwlist eth2 scan
+
iwlist eth2 scan
 
</nowiki></pre>
 
</nowiki></pre>
 
(Obviously changing eth2 to whatever your connection is.)
 
(Obviously changing eth2 to whatever your connection is.)
 
 
You should get a reply back with your Wireless Network, it should look a little like this.
 
You should get a reply back with your Wireless Network, it should look a little like this.
 
+
<pre><nowiki>
<pre><nowiki>alex@alex-ubuntu:~$ iwlist eth2 scan
+
alex@alex-ubuntu:~$ iwlist eth2 scan
 
eth2      Scan completed :
 
eth2      Scan completed :
Cell 01 - Address: 00:09:5B:C4:B2:E6
+
          Cell 01 - Address: 00:09:5B:C4:B2:E6
ESSID:"LATCHFORD"
+
                    ESSID:"LATCHFORD"
Protocol:IEEE 802.11b
+
                    Protocol:IEEE 802.11b
Mode:Managed
+
                    Mode:Managed
Frequency:2.462 GHz (Channel 11)
+
                    Frequency:2.462 GHz (Channel 11)
Quality:0/100  Signal level:-36 dBm  Noise level:-256 dBm
+
                    Quality:0/100  Signal level:-36 dBm  Noise level:-256 dBm
Encryption key:off
+
                    Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
+
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
+
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
48 Mb/s; 54 Mb/s
+
                              48 Mb/s; 54 Mb/s
Extra:bcn_int=100
+
                    Extra:bcn_int=100
Extra:atim=1</nowiki></pre>
+
                    Extra:atim=1</nowiki></pre>
 
+
 
Now you need to configure your card to connect to that particular network, as there may be more than one. You can do this by running the command.
 
Now you need to configure your card to connect to that particular network, as there may be more than one. You can do this by running the command.
 
+
<pre><nowiki>
<pre><nowiki>sudo iwconfig eth2 essid LATCHFORD mode Managed channel 11
+
sudo iwconfig eth2 essid LATCHFORD mode Managed channel 11
 
</nowiki></pre>
 
</nowiki></pre>
 
(Notice I have taken the ESSID, Mode and Channel Number from the scan to ensure the best results.)
 
(Notice I have taken the ESSID, Mode and Channel Number from the scan to ensure the best results.)
 
 
If you wish to use an encrypted network then this is indeed cool too.. Run the command.
 
If you wish to use an encrypted network then this is indeed cool too.. Run the command.
 
+
<pre><nowiki>
<pre><nowiki>sudo iwconfig eth2 key xxxxxxxxxxxxxxxxxxxxxxxxxx
+
sudo iwconfig eth2 key xxxxxxxxxxxxxxxxxxxxxxxxxx
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Obviously replacing the xxx with the key of your choice..
 
Obviously replacing the xxx with the key of your choice..
 
 
Once you have run the commands above re-run iwconfig and you should get something that looks like this.
 
Once you have run the commands above re-run iwconfig and you should get something that looks like this.
 
+
<pre><nowiki>
<pre><nowiki>alex@alex-ubuntu:~$ iwconfig
+
alex@alex-ubuntu:~$ iwconfig
 
lo        no wireless extensions.
 
lo        no wireless extensions.
  
第193行: 第175行:
  
 
eth2      IEEE 802.11g  ESSID:"LATCHFORD"   
 
eth2      IEEE 802.11g  ESSID:"LATCHFORD"   
Mode:Managed  Frequency:2.462 GHz  Access Point: 00:09:5B:C4:B2:E6   
+
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:09:5B:C4:B2:E6   
Bit Rate:54 Mb/s   
+
          Bit Rate:54 Mb/s   
RTS thr:2432 B  Fragment thr:2432 B   
+
          RTS thr:2432 B  Fragment thr:2432 B   
Power Management:off
+
          Power Management:off
Link Quality:100/100  Signal level:-25 dBm  Noise level:-256 dBm
+
          Link Quality:100/100  Signal level:-25 dBm  Noise level:-256 dBm
Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
+
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
Tx excessive retries:0  Invalid misc:0  Missed beacon:0</nowiki></pre>
+
          Tx excessive retries:0  Invalid misc:0  Missed beacon:0</nowiki></pre>
 
+
 
Next you actually have to connect to the network, this is done with a simple command.
 
Next you actually have to connect to the network, this is done with a simple command.
 
+
<pre><nowiki>
<pre><nowiki>sudo dhclient eth2
+
sudo dhclient eth2
 
</nowiki></pre>
 
</nowiki></pre>
 
 
It will go through and check the connection and should hopefully connect.
 
It will go through and check the connection and should hopefully connect.
 
 
The output should look like..
 
The output should look like..
 
+
<pre><nowiki>
<pre><nowiki>alex@alex-ubuntu:~$ sudo dhclient eth2
+
alex@alex-ubuntu:~$ sudo dhclient eth2
 
There is already a pid file /var/run/dhclient.pid with pid 4807
 
There is already a pid file /var/run/dhclient.pid with pid 4807
 
killed old client process, removed PID file
 
killed old client process, removed PID file
第226行: 第205行:
 
DHCPACK from 192.168.0.1
 
DHCPACK from 192.168.0.1
 
bound to 192.168.0.5 -- renewal in 36910 seconds.</nowiki></pre>
 
bound to 192.168.0.5 -- renewal in 36910 seconds.</nowiki></pre>
 
 
This should now mean that you are connected to the Internet, go into the Network Manager (System->Administration->Networking) and disable all other connections, (Wired etc..). Please don't touch the wireless connection as this could cause problems.
 
This should now mean that you are connected to the Internet, go into the Network Manager (System->Administration->Networking) and disable all other connections, (Wired etc..). Please don't touch the wireless connection as this could cause problems.
 
+
==== Step 6 - Establishing a lasting connection ====
=== Step 6 - Establishing a lasting connection ===
+
 
+
 
Well, we have got the connection working now, but one you restart you are not going to be able to connect again, because its not going to fire up ndiswrapper on boot unless you tell it too.
 
Well, we have got the connection working now, but one you restart you are not going to be able to connect again, because its not going to fire up ndiswrapper on boot unless you tell it too.
 
 
Run the command.
 
Run the command.
 
+
<pre><nowiki>
<pre><nowiki>sudo ndiswrapper -m
+
sudo ndiswrapper -m
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This command will load the module at boot time.
 
This command will load the module at boot time.
 
 
The next step is to use the Network Manager, (System->Administration->Networking), Plug-in the ESSID and then connect to the network. It seems to work for me, as a consistent connection through the boot-ups. There may be no need for the previous steps, but I am not really too bothered about that at this point in time, someone can edit this if they find a quicker way.
 
The next step is to use the Network Manager, (System->Administration->Networking), Plug-in the ESSID and then connect to the network. It seems to work for me, as a consistent connection through the boot-ups. There may be no need for the previous steps, but I am not really too bothered about that at this point in time, someone can edit this if they find a quicker way.
 
+
I think that concludes this [[UbuntuHelp:HowTo|HowTo]]. Hope it has been very informative.
I think that concludes this HowTo. Hope it has been very informative.
+
==== Credit, where credits due. ====
 
+
 
+
=== Credit, where credits due. ===
+
 
+
 
I would also like to state that [http://www.ubuntuforums.org/member.php?u=63500/ oimon] should take credit for the discovery of this method, I merely tested it after he worked it out and am writing it up on his behalf. Thanks a lot to [http://www.ubuntuforums.org/member.php?u=63500/ oimon].
 
I would also like to state that [http://www.ubuntuforums.org/member.php?u=63500/ oimon] should take credit for the discovery of this method, I merely tested it after he worked it out and am writing it up on his behalf. Thanks a lot to [http://www.ubuntuforums.org/member.php?u=63500/ oimon].
 
 
Thanks.. Alex Latchford
 
Thanks.. Alex Latchford
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年10月20日 (一) 01:12的最新版本

WG121 HowTo

This page details the procedure to enable the Netgear WG121 USB Wireless Adapter to work on Ubuntu, the first section is a quickstart on Hardy Heron(8.04), this should also work on Gutsy Gibbon(7.10) also.. For earlier versions please use the second part of the guide..

Hardy Heron (8.04) & Gutsy Gibbon (7.10)

Okay with Hardy the whole process has been streamlined alot.. First step is to install Ubuntu, next is to reboot, (UNPLUG the adapter at this point) and put the install cd back in.. Go to System -> Administration -> Synaptic Package Manager (or Adept in Kubuntu). Install the build-essential & ndisgtk packages.. (And related dependencies) Find the driver cd, or ndis5 drivers from netgear.com and put it into the drive.. Go to System -> Administration -> Windows Wireless Drivers.. Hit install new driver, go to the driver cd and then into the /ndis5 folder and select the netwg121.inf file.. Now I plugged in the adapter at this point and nothing happened.. So I rebooted and it worked.. Hope this works for you, Alex Latchford

All Other Previous Versions

Note: To install on Feisty you will need to grab a newer copy of ndiswrapper, I am presuming this is a libc6 issue. I grabbed 1.37 but anything close to that should work. Go up to and including step 4, after modprobing ndiswrapper the new network manager took over for me, worked like a charm - Alex Latchford (20070226) Note: Ubuntu Feisty Fawn 7.04 requires additional drivers blacklisting (prism54usb and prism54common), plus i used version 1.38 of ndiswrapper instead of 1.16. Tested with Xubuntu and Kubuntu- Oimon Note: Gutsy Gibbon: This card will also work with this HowTo, however it does require the latest ndiswrapper source.. I used 1.51 which works a charm.. Also Step 5 should now be redundant as it should be picked up through the network-manager past step 4. - Alex Latchford (20071221)

Step 1 - Prerequisites

First thing, if you have the Adapter plugged in, please remove it until you are told to insert it. As this will cause problems later if left inserted. Second thing, this guide was originally written for Ubuntu and therefore contain Gnome Specific commands, however I am fairly confident that this will work on Kubuntu, Edubuntu and Xubuntu. A user with Xubuntu, has already been successful in following this guide. I'm presuming you will fall into the same sorts of errors. Just remember to change all gedit commands to: Kubuntu - kdesu and on Xubuntu - mousepad. Doing this should avoid those sorts of errors. In order to install the utilities needed for this card you will need a few other packages. Just run these commands, and all others displayed inside the dashed boxes in this HowTo, through the terminal

sudo apt-get update
sudo apt-get install build-essential

Alternatively if you do not have wired Internet access, (as you are using wireless), install these by downloading the packages manually and installing them by hand. You will also need to make a symbolic link from kernel sources directory to the modules directory, I do not really know why this is needed, but in the ndiswrapper documentation, (ndiswrapper being the package that we will using later), it says it is needed to suppress an error when compiling. Run the commands

sudo apt-get install linux-headers-`uname -r`
sudo ln -s /usr/src/linux-`uname -r` /lib/modules/`uname -r`/build

Step 2 - Removing existing drivers.

Ubuntu 6.10 (Edgy Eft) comes complete with a suite of drivers that are used to control Wireless Networking, however they dont really work for this card, so we are going to have to disable them. Run the command.

gksudo gedit /etc/modprobe.d/blacklist

This will open up your text editor. Scroll down to the bottom and add these lines to the end of the file.

blacklist islsm
blacklist islusb
blacklist islsm_usb
blacklist islsm_device
blacklist prism2_usb
blacklist islsm_pci
blacklist net2280

(Note: Not all of these drivers are 100% necessary in order to get the system to function, if you experience problems at a later date try removing the drivers; prism2_usb, islsm_pci & net2280) If you have Feisty Fawn 7.04 or greater then add

blacklist prism54usb
blacklist prism54common

This would probably be a good time to restart your system as these wont changes take effect until this has taken place.

Step 3 - Downloading and Compiling

In order to get the card working we will need to use the Windows Wireless Driver Emulator, ndiswrapper. I like to install all my programs through the /usr/src directory as it enables me to keep my Home folder clear of any unneeded code. So this is where we will install through. I am currently going to install version 1.16 of ndiswrapper, as this is the version I know is functioning correctly, you can try to use newer versions, but to me it seems like harder work, as 1.16 installs fine. Run the commands. Note: Feisty replace 1.16 with 1.38. Gutsy replace 1.16 with 1.51

cd /usr/src
sudo wget http://kent.dl.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-1.16.tar.gz
sudo tar -zxvf ndiswrapper-1.16.tar.gz
cd ndiswrapper-1.16

Ok, you should now have the package on your system, we are now going to compile it. Run the commands.

sudo make uninstall
sudo make
sudo make install

Now you should have a copy of ndiswrapper installed and working on your system. You can test this by running the command.

ndiswrapper -v

The expected output should be something like..

alex@alex-ubuntu:~$ ndiswrapper -v
utils version: 1.8
driver version:        1.16
vermagic:       2.6.17-10-generic SMP mod_unload 586 REGPARM gcc-4.1

Step 4 - Installing the Adapter

Ok, the next step is to install the drivers for the card so it is actually functioning and can be detected. First, insert the cd that came with the adapter in a CD Drive, open up the cd and copy across the folder called ndis5/ to your home folder. According to the installation guide for ndiswrapper this is needed as it will not install through the cd. Once that is done, Run the commands.

cd ~/ndis5
sudo ndiswrapper -i netwg121.inf
ndiswrapper -l

You should now see that your card is installed. Now you can insert the adapter into a USB Port and then run the command again. ndiswrapper -l), you should now see.

alex@alex-ubuntu:~$ ndiswrapper -l
Installed drivers:
netwg121                driver installed, hardware present 

You will also need to load the ndiswrapper module. You can do this by running the commands.

sudo depmod -a
sudo modprobe ndiswrapper

You can check the system log, (System->Administration->System Log), to make sure that the driver was loaded successfully. It should say something like this.

ndiswrapper version 1.16 loaded (preempt=no,smp=yes)
ndiswrapper: driver netwg121 (NETGEAR, Inc.,11/13/2003, 1.0.5.1000) loaded
wlan0: vendor: 'NETGEAR WG121 802.11g Wireless USB2.0 Adapter'
wlan0: ndiswrapper ethernet device 00:09:5b:d2:6d:72 using driver netwg121, 0846:4210.F.conf
wlan0: encryption modes supported: WEP; TKIP with WPA; AES/CCMP with WPA
usbcore: registered new driver ndiswrapper

Step 5 - Configuring the Adapter

Note: If you are running Feisty Fawn 7.04 or greater then you should be able to use the network-manager to manage the wireless connection now, left-click the icon in the system tray (top-right), it should now present you with a list of available networks, Please then proceed to step 6. If this is not the case then follow this step. Ok, getting close to the end now. First run the command,

iwconfig

This will list all the available network connections, testing them to see if they are suitable for wireless activity. You should see something like this.

alex@alex-ubuntu:~$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

sit0      no wireless extensions.

eth2      IEEE 802.11g  ESSID: off/any  
          Mode:Auto  Frequency:2.462 GHz  Access Point: None
          Bit Rate:54 Mb/s   
          RTS thr:2432 B   Fragment thr:2432 B   
          Power Management:off
          Link Quality:100/100  Signal level:0 dBm  Noise level:0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

The wireless connection on my setup is through eth2, but it could be through eth1, eth3 or even wlan0. (wlan0 is probably the most common, but ethX works fine too). Note: If no connections have come up, take a look in the /var/syslog file, (after unplugging and re-plugging in the adapter), it should attempt to start up the card, it might state that it is has deactivated the adapter after the "ESSID could not be set to ' '". I solved this issue by manually putting in the ESSID (network name), myself. To do this run the command.

sudo iwconfig eth2 ESSID LATCHFORD

Next step to to scan and try to find some networks. Run the command.

iwlist eth2 scan

(Obviously changing eth2 to whatever your connection is.) You should get a reply back with your Wireless Network, it should look a little like this.

alex@alex-ubuntu:~$ iwlist eth2 scan
eth2      Scan completed :
          Cell 01 - Address: 00:09:5B:C4:B2:E6
                    ESSID:"LATCHFORD"
                    Protocol:IEEE 802.11b
                    Mode:Managed
                    Frequency:2.462 GHz (Channel 11)
                    Quality:0/100  Signal level:-36 dBm  Noise level:-256 dBm
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Extra:bcn_int=100
                    Extra:atim=1

Now you need to configure your card to connect to that particular network, as there may be more than one. You can do this by running the command.

sudo iwconfig eth2 essid LATCHFORD mode Managed channel 11

(Notice I have taken the ESSID, Mode and Channel Number from the scan to ensure the best results.) If you wish to use an encrypted network then this is indeed cool too.. Run the command.

sudo iwconfig eth2 key xxxxxxxxxxxxxxxxxxxxxxxxxx

Obviously replacing the xxx with the key of your choice.. Once you have run the commands above re-run iwconfig and you should get something that looks like this.

alex@alex-ubuntu:~$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

sit0      no wireless extensions.

eth2      IEEE 802.11g  ESSID:"LATCHFORD"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:09:5B:C4:B2:E6   
          Bit Rate:54 Mb/s   
          RTS thr:2432 B   Fragment thr:2432 B   
          Power Management:off
          Link Quality:100/100  Signal level:-25 dBm  Noise level:-256 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Next you actually have to connect to the network, this is done with a simple command.

sudo dhclient eth2

It will go through and check the connection and should hopefully connect. The output should look like..

alex@alex-ubuntu:~$ sudo dhclient eth2
There is already a pid file /var/run/dhclient.pid with pid 4807
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth2/00:09:5b:d2:6d:72
Sending on   LPF/eth2/00:09:5b:d2:6d:72
Sending on   Socket/fallback
DHCPREQUEST on eth2 to 255.255.255.255 port 67
ip length 321 disagrees with bytes received 534.
accepting packet with data after udp payload.
DHCPACK from 192.168.0.1
bound to 192.168.0.5 -- renewal in 36910 seconds.

This should now mean that you are connected to the Internet, go into the Network Manager (System->Administration->Networking) and disable all other connections, (Wired etc..). Please don't touch the wireless connection as this could cause problems.

Step 6 - Establishing a lasting connection

Well, we have got the connection working now, but one you restart you are not going to be able to connect again, because its not going to fire up ndiswrapper on boot unless you tell it too. Run the command.

sudo ndiswrapper -m

This command will load the module at boot time. The next step is to use the Network Manager, (System->Administration->Networking), Plug-in the ESSID and then connect to the network. It seems to work for me, as a consistent connection through the boot-ups. There may be no need for the previous steps, but I am not really too bothered about that at this point in time, someone can edit this if they find a quicker way. I think that concludes this HowTo. Hope it has been very informative.

Credit, where credits due.

I would also like to state that oimon should take credit for the discovery of this method, I merely tested it after he worked it out and am writing it up on his behalf. Thanks a lot to oimon. Thanks.. Alex Latchford