openSUSE Forums > Archives > SF Archives > ARCHIVES - Tips, Tricks & Tweaks » Getting Your Wireless Card Up And Running - Encryption & Connectio

Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Tips, Tricks & Tweaks
Forums FAQ Members List Search Today's Posts Mark Forums Read

ARCHIVES - Tips, Tricks & Tweaks Tips and Solutions for SUSE Linux
(Please do not post questions here)

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 26-Dec-2006, 17:17
thelinuxportal
Guest
 
Posts: n/a
Wink

I realize many people who use Linux have a hard time :angry: setting up wireless cards and connections so I am posting this to help those who have decided to take the wireless "root"

Now, before you continue reading this, be aware that as part of my job I test hardware for compatibility with Linux, and as a result, have tested over 40 wireless cards, some with the same chipset. I don't use ndiswrapper, so cannot help you there. However, I highly urge you to find cards that are compatible with Linux. It saves you a lot of time and effort, plus, the costs are the same, so, as with Linux, its your choice.

Right. lets begin:

1.
I assume your drivers were included in the kernel or you have compiled them and when you run iwconfig (as root) your device can be seen, such as the examples below:

ra0 no wireless extensions.

ra0 RT61 Wireless ESSID:" "
Mode:Managed Frequency:2.437 GHz Access Point: " "
Bit Rate=54 Mb/s
RTS thrff Fragment thrff
Encryption key:""
Link Quality=91/100 Signal level:-48 dBm Noise level:-79 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

ra0 RT61 Wireless ESSID:"XPORTAL"
Mode:Managed Frequency:2.437 GHz Access Point: 00:15:E9:CC:91:3C
Bit Rate=54 Mb/s
RTS thrff Fragment thrff
Encryption key:*************
Link Quality=91/100 Signal level:-48 dBm Noise level:-79 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Examples 1 and 2 obviously are not working and thats what this How To is designed to fix. Example 3 is what it will look like when we are done.

2.
Wireless devices are detected/setup as the following eth / ra / ath / wlan, in Linux. The numbering starts as 0, 1, 2, 3 ... depending on the number of devices on you computer. So, ra0 on my machine is the first wireless device on my machine, ra1 would be the second, so on and so forth.

3.
For example 1, the driver you have for your card is working, its just that no configuration data for it exists. For example 2, your card is active but no configuration data exits to help it connect to any wireless points.

4. ------- The Meat --------
Lets get those suckers working.
When you run iwconfig your wireless device should show ra0, eth0, ath0, wlan0 (etc), remember this and navigate to Kmenu >> Applications >> System >> Filemanager >> File Manager - Super User Mode. Enter your root password and now you can browse your files as root and change your system at your will. Be careful.

Next navigate to

/etc/sysconfig/network

Right-click and >> Create new text file >> NAME IT "ifcfg-THE NAME OF YOUR DETECTED WIRELESS DEVICE"
Example, mine is ifcfg-ra0 - so if yours is eth0, then name the file ifcfg-eth0
Right click on the file and Open with KATE and paste this in.

DEVICE='ENTER YOUR DEVICE NAME'
ONBOOT='yes'
BOOTPROTO='dhcp'
STARTMODE='auto'
PRE_UP_SCRIPT='ifup-ENTER YOUR DEVICE NAME'

Save the file and navigate to:

/etc/sysconfig/network/scripts

Right-click and >> Create new text file >> NAME IT "ifup-THE NAME OF YOUR DETECTED WIRELESS DEVICE"
Example, mine is ifup-ra0 - so if yours is eth0, then name the file ifup-eth0
Right click on the file and Open with KATE and paste this in - remember to replace the eth1, with your device name.

#! /bin/bash
# Wireless Boot Script
echo Setting wireless priv
ifconfig eth1 inet up
iwpriv eth1 set NetworkType=(TYPE IN HERE infra - if using a router, adhoc - if using adhoc mode)
iwpriv eth1 set AuthMode=(TYPE IN HERE shared, open - for your authentication mode)
iwpriv eth1 set EncrypType=(TYPE IN YOUR ENCRYPTION TYPE - WEP, WPA - leave blank for none)
iwpriv eth1 set DefaultKeyID=1
iwpriv eth1 set Key1=(ENTER YOUR ENCRYPTION KEY IF YOU USE ENCRYPTION)
iwpriv eth1 set SSID=(Network SSID)
ifup-dhcp eth1

Save the file
Then type ifdown YOUR DEVICE, and then ifup YOUR DEVICE.
It will then use the configuration scripts to setup your card!!!

Have fun, and post back your results

If you want a more detailed explanation on what we have done, and how it all ties together, feel free to ask and I will post an outline.
Regards





  #2 (permalink)  
Old 10-Feb-2007, 08:43
John Doe
Guest
 
Posts: n/a
Default

Hi.
I used this method for my rt61 based wifi card in SuSE 10.2 with serialmonkey's driver. On every bootup I have to setup encryption manualy. I created /etc/sysconfig/network/ifcfg-ra0 as:

Code:
DEVICE='ra0'
ONBOOT='yes' 
BOOTPROTO='static' 
STARTMODE='auto' 
PRE_UP_SCRIPT='ifup-ra0'
IPADDR='172.22.1.13'
NETMASK='255.255.255.0'
and /etc/sysconfig/network/scripts/ifup-ra0 as:

Code:
#! /bin/bash
ifconfig ra0 inet up
iwpriv ra0 set NetworkType=infra
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=TKIP
iwpriv ra0 set DefaultKeyID=1
iwpriv ra0 set SSID=<my-ssid>
iwpriv ra0 set WPAPSK=<my-key>
but still ra0 isn't connected on startup and I have to run /etc/sysconfig/network/scripts/ifup-ra0 manualy (then everything runs fine). Boot.msg says:

Code:
ra0****** device: RaLink RT2561/RT61 802.11g PCI
ra0****** warning: using NO encryption
ra0****** IP address: 172.22.1.13/24** done
Setting up service network**.**.**.**.**.**.**.**.**.**.**.**.**.**.**.**.done
There's also relevant settings in /etc/Wireless/RT61STA/rt61sta.dat so I commented identical out. Did I missed somethig?
  #3 (permalink)  
Old 19-Feb-2007, 22:57
thelinuxportal
Guest
 
Posts: n/a
Default

Quote:
Hi.
I used this method for my rt61 based wifi card in SuSE 10.2 with serialmonkey's driver. On every bootup I have to setup encryption manualy. I created /etc/sysconfig/network/ifcfg-ra0 as:

Code:
DEVICE='ra0'
ONBOOT='yes' 
BOOTPROTO='static' 
STARTMODE='auto' 
PRE_UP_SCRIPT='ifup-ra0'
IPADDR='172.22.1.13'
NETMASK='255.255.255.0'
and /etc/sysconfig/network/scripts/ifup-ra0 as:

Code:
#! /bin/bash
ifconfig ra0 inet up
iwpriv ra0 set NetworkType=infra
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=TKIP
iwpriv ra0 set DefaultKeyID=1
iwpriv ra0 set SSID=<my-ssid>
iwpriv ra0 set WPAPSK=<my-key>
but still ra0 isn't connected on startup and I have to run /etc/sysconfig/network/scripts/ifup-ra0 manualy (then everything runs fine). Boot.msg says:

Code:
ra0****** device: RaLink RT2561/RT61 802.11g PCI
ra0****** warning: using NO encryption
ra0****** IP address: 172.22.1.13/24** done
Setting up service network**.**.**.**.**.**.**.**.**.**.**.**.**.**.**.**.done
There's also relevant settings in /etc/Wireless/RT61STA/rt61sta.dat so I commented identical out. Did I missed somethig?
[/b]

Eek, question, have you disabled your wired network port in your BIOS?

  #4 (permalink)  
Old 21-Feb-2007, 16:27
Snakedriver
Guest
 
Posts: n/a
Default

thelinuxportal,

Let me add a few lines to your excellent howto. I have been trying out a number of Live CDs and have a few items to add regarding the rt2500. I too do not address ndiswrapper; Andrew has an excellent howto in the wireless subforum for ndiswrapper @ http://www.suseforums.net/index.php?showtopic=17317.

Addendum:

Is My Wifi Card Supported? See: http://www.suseforums.net/index.php?showtopic=22476

I'll be using my card ID, just substitute yours and all this should work for you (but not ndiswrapper). I have used a static setup because it is the toughest to accomplish.

1st, if you are brand new to Linux, let's find out what your wireless card is, then you can go looking for help. Folks don't like to help when a newbie asks for help and can't tell them what card is installed.
In a terminal as root
"lspci -v" here is part of mine"
Code:
00:05.0 Network controller: RaLink RT2500 802.11g Cardbus/mini-PCI (rev 01)
********Subsystem: Micro-Star International Co., Ltd. Unknown device 6833
********Flags: bus master, slow devsel, latency 64, IRQ 169
********Memory at 54020000 (32-bit, non-prefetchable) [size=8K]
********Capabilities: [40] Power Management version 2
Now we know exactly what card we have (RaLink RT2500 802.11g), so let's press on.

Still in the terminal:
"lsmod" which finds all the kernel modules loaded, of course we are looking for the rt2500 module, here's part of mine:
Code:
ieee1394**************130552**1 ohci1394
pcmcia_core************61988**3 pcmcia,yenta_socket,rsrc_nonstatic
usbcore************** 148064**4 usb_storage,zc0301,ehci_hcd,uhci_hcd
rt2500****************210152**1**<-- what we are looking for <<<<<
parport_pc************ 58984**1
(Note: If you see rt2500pci, I recommend doing "rmmod rt2500pci" and installing the rt2500 cvs module, see: http://linux.wordpress.com/2006/05/14/suse...wi-fi/#more-614
The SuSE rt2500 driver of the distro installed rt2500pci is broken with respect to the smp kernel; do the install.)
Now, if you don't see rt2500, do:
"modprobe rt2500" and when the computer is done, do "lsmod" again, it should be there if it is in the kernel.

Now, assuming we have the correct driver module, let's find out what the system says about it. I am going to be using some commands that you can only use if you have the wireless-tools rpm installed.
Still in the terminal:
"iwlist scan" here's mine (I have my card working by the way):
Code:
lo********Interface doesn't support scanning.

wlan0**** Scan completed :
**********Cell 01 - Address: xx:xx:xx:xx:xx:xx
********************Mode:Managed
********************ESSID:"default"
********************Encryption key:on
********************Channel:n
********************Quality:93/100**Signal level:-102 dBm**Noise level:-202 dBm

eth0******Interface doesn't support scanning.

sit0******Interface doesn't support scanning.
Note that it returns all the interfaces, but only the ones with wireless extensions will have detailed information next to it.
Note that mine comes up wlan0 whereas thelinuxportal''s was ra0, no big deal just remember it.
Note the capital M in Mode:Managed.
Note that Cell 01 - Address: xx:xx:xx:xx:xx:xx provides the access point "AP", useful for later on.

Now switch on your wireless card:
"ifconfig wlan0 up"
Now do:
"iwconfig" here's mine from my running system with a static setup & WEP activated:
Code:
wlan0**** RT2500 Wireless**ESSID:"myessid"**Nickname:"nameoflaptop"
**********Mode:Managed**Frequency=2.437 GHz**Access Point: xx:xx:xx:xx:xx:xx
**********Bit Rate=54 Mb/s** Tx-Power:-3 dBm
**********RTS thr:off** Fragment thr:off
**********Encryption key:1234-5678-90** Security mode:restricted
**********Link Quality=92/100**Signal level=-39 dBm**Noise level:-203 dBm
**********Rx invalid nwid:0**Rx invalid crypt:0**Rx invalid frag:0
**********Tx excessive retries:0**Invalid misc:0** Missed beacon:0
So your's doesn't have that, there's a lot of empty spaces, what to do???
Let's start at the top & tell it:
iwconfig wlan0 essid myessid
iwconfig wlan0 nick "nameoflaptop"
iwconfig wlan0 mode Managed
iwconfig wlan0 channel n <--from iwlist
iwconfig wlan0 freq 2.437G
iwconfig wlan0 key 1234567890 restricted

Now do "iwconfig" again and see if you get the AP & Link Quality=something decent.
if not,
Enter the AP from iwlist
iwconfig eth0 ap 00:60:1D:01:23:45 <--straight from man iwconfig, use your's from iwlist scan
The two should now match Cell 01 - Address: xx:xx:xx:xx:xx:xx and Access Point: xx:xx:xx:xx:xx:xx

Now let's get to the router, you need to get these #IDs from your router setup:
"ifconfig wlan0 192.168.0.110 broadcast 192.168.0.255 netmask 255.255.255.0 up"
"route add default gw 192.168.0.5"

We should now be able to "ping" the router, (see "man ping"):
"ping -c4 192.168.0.5" example, use your gateway, here's mine"
Code:
laptop:/home/jim # ping -c4 192.168.0.5
PING 192.168.0.5 (192.168.0.5) 56(84) bytes of data.
64 bytes from 192.168.0.5: icmp_seq=1 ttl=127 time=2.27 ms
64 bytes from 192.168.0.5: icmp_seq=2 ttl=127 time=2.26 ms
64 bytes from 192.168.0.5: icmp_seq=3 ttl=127 time=1.26 ms
64 bytes from 192.168.0.5: icmp_seq=4 ttl=127 time=1.24 ms

--- 192.168.0.5 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 1.249/1.761/2.272/0.506 ms
laptop:/home/jim #****************
To further reach the ISP you need to know the "nameserver" which you can get from the ISP or use some tools later on to find them. These nameservers need to be entered into /etc/resolv.conf like:
Code:
nameserver nn.n.nnn.nn
nameserver nn.nnn.nnn.nn
nameserver nn.n.nn.nn
search www.yourISP.com
On a temporary basis, you can enter them with (example):
"echo nameserver 192.168.1.10 > /etc/resolv.conf
echo nameserver 212.135.1.47 >> /etc/resolv.conf
etc."
Note that the first line will OVERWRITE (>) the resolv.conf file, the second command will APPEND (>>) 'nameserver 212.135.1.47' onto the end of it!
Or you can just edit /etc/resolv.conf and add them.

After a few seconds,
"ping -c4 212.135.1.47(from above example, use your ISP), here's mine:
Code:
laptop:/home/jim # ping -c4 212.135.1.47
PING 212.135.1.47 (212.135.1.47) 56(84) bytes of data.
64 bytes from 212.135.1.47: icmp_seq=1 ttl=56 time=74.9 ms
64 bytes from 212.135.1.47: icmp_seq=2 ttl=56 time=71.3 ms
64 bytes from 212.135.1.47: icmp_seq=3 ttl=56 time=74.1 ms
64 bytes from 212.135.1.47: icmp_seq=4 ttl=57 time=73.5 ms

--- 212.135.1.47 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 71.318/73.499/74.933/1.362 ms
laptop:/home/jim #****************************************
You should now be able to fire up Firefox and the web is yours.




Let's finish:
There are a number of tools that help you get the nameserver info, find the networks and even help you get logged on.

If your distro supports "dhclient", you can:
"dhclient wlanO" and it will do the nameservers for you.
From man dhclient"": The Internet Systems Consortium DHCP Client, dhclient, provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address.

If your distro supports "pump", you can:
"pump -i wlan0"
From "man pump":
NAME
pump - configure network interface via BOOTP or DHCP protocol.

In SuSE, you can use "NetworkManager" after you get the card up.

An alternative to NetworkManager for those who want profiles
It's called "WIFI Radar"; see http://www.suseforums.net/index.php?showtopic=24390.

I'm sure that there are others.

Finally, with thelinuxportal's howto and this addendum, you should be able to go to any wireless on any computer and get it up including Live CDs (except for "ndiswrapper" cards and even there once the driver is installed you can use most of these wireless tools to get online).

Links:
List Of Wifi Downloads And How-to's @ http://www.suseforums.net/index.php?showtopic=22475
Title: HowTo: Configure a WiFi Card on SuSE @ http://www.suselinuxsupport.de/wikka.php?w...oConfigWifiCard
Howto: Configure Network Cards @ http://forums.remote-exploit.org/showthrea...hlight=wireless
If you have any other good links add them!

Hope this helps down the road.

Have fun...
 


Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2