Penguin
Diff: WirelessSetupNotes
EditPageHistoryDiffInfoLikePages

Differences between version 5 and predecessor to the previous major change of WirelessSetupNotes.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 5 Last edited on Sunday, January 16, 2005 4:40:37 pm by JohnMcPherson Revert
Older page: version 1 Last edited on Wednesday, September 22, 2004 11:11:56 am by CraigBox Revert
@@ -1,293 +1,143 @@
-! Wireless Ad-Hoc connection 
+!!! Notes on Setting Up Wireless Networks in Linux  
+This page details how you can setup a wireless connection under linux, and hopefully some tips and tricks that you can use to simplify the task.  
  
-See also WirelessNetworking , munmap(2), [SYN], tcpdump(8) and ping(8)  
+There are several methods you can use to configure a wireless interface in a linux computer , often these a distribution specific. This page takes the approach of showing you how to manually setup a link at the command line before delving in to distribution specific details. While this page is written with 802.11b in mind it should be generic enough to help with other wireless technologies such as 802.11g as well.  
  
-! These commands were useful  
-  
-http://iptables-tutorial.frozentux.net/iptables-tutorial.html  
+The structure of this page is a number of steps that should be executed in order, at the end of each step is a ''Troubleshooting'' section that should help you to fix any problems that you encountered. Do not proceed to the next step unless you are sure you have completed all the preceding steps correctly
  
+!! Verify Environment  
+First we need to check that there is a wireless card in your computer to. To get a list of all wireless interfaces in the machine use the ''iwconfig'' command. In Debian, this command is part of the package called __wireless-tools__.  
+In the example shown below we can see that this particular computer has a single wireless interface called ''eth2''. The rest of the output provides details of the current configuration of the wireless interface. Ignore that for now, we'll deal with it later - the important thing here is that you have a wireless interface installed and ready to go.  
 <verbatim> 
-nmap -v mordor  
-Starting nmap 3.50 ( http ://www.insecure.org/nmap/ ) at 2004-09-21 16:03 EDT  
-Host mordor .localdomain (192.168.1.1) appears to be up ... good.  
-Initiating SYN Stealth Scan against mordor.localdomain (192.168.1.1) at 16:03  
-Adding open port 5000/tcp  
-Adding open port 139/tcp  
-Adding open port 135/tcp  
-The SYN Stealth Scan took 2 seconds to scan 1659 ports.  
-Interesting ports on mordor.localdomain (192.168.1.1):  
-(The 1656 ports scanned but not shown below are in state: closed)  
-PORT STATE SERVICE  
-135/tcp open msrpc  
-139/tcp open netbios-ssn  
-5000/tcp open UPnP  
+xenon :~# iwconfig  
+lo no wireless extensions
  
-Nmap run completed -- 1 IP address (1 host up) scanned in 72 .847 seconds  
+eth0 no wireless extensions
  
-</verbatim>  
+eth1 no wireless extensions.  
  
-<verbatim>  
-! tcpdump -i eth1  
-cat /etc/rc .d/init.d/iptables  
-cat /proc/sys/net/ipv4/ip_forward  
-echo 1 > /proc/sys/net/ipv4/ip_forward  
-/sbin/iptables -t nat -A PREROUTING -s 192.168. 1. /255.255.255. 0 -d 10.. 4./16 -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128  
-iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE  
-kedit /etc/dhcpd.conf.sample  
-kedit /etc/dhcpd.conf  
-dhcpcd -i eth1 &  
-dhcpcd eth1  
-watch -n 1 iwconfig eth1  
-ping -c 4 localhost  
-netstat  
-netstat -r  
-traceroute mordor  
+eth2 IEEE 802.11-DS ESSID:"test" Nickname:"test"  
+ Mode:Ad -Hoc Frequency:2 .462GHz Cell: 00:02:2D:39:A9:31  
+ Bit Rate=11Mb /s Tx -Power=15 dBm Sensitivity: 1/  
+ Retry limit: 4 RTS thr:off Fragment thr:off  
+ Power Management:off  
+ Link Quality:36 /0 Signal level: -61 dBm Noise level: -97 dBm  
+ Rx invalid nwid:0 Rx invalid crypt:3 Rx invalid frag:6514  
+ Tx excessive retries:6 Invalid misc:0 Missed beacon:  
 </verbatim> 
  
-<verbatim>  
-nslookup  
-> mordor  
-Server: 192 .168.1.1  
-Address: 192.168. 1.1#53  
+!Troubleshooting  
+If ''iwconfig'' does not show any wireless interfaces in your computer you have a problem! Steps to fix it  
+* Check that you do actually have a wireless card installed  
+* Check that you have the appropriate modules (driver) for your card compiled and successfully loaded, see WirelessChipsets for more information on this  
+* Check that [PCMCIA] is correctly configured if you are using a miniPCI card  
+* If still stuck, try google, or try emailing the WlugMailingList .  
+* As with most system settings commands, you must su( 1) to the root user for the command to have permissions to query hardware devices
  
-Non-authoritative answer:  
-Name: mordor .mshome.net  
-Address: 192.168..3  
-</verbatim>  
-  
-<verbatim>  
-ping -c 4 192.168.1.1  
-PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data .  
-64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=6.48 ms  
-64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=3.19 ms  
-64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=3.23 ms  
-64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=3.75 ms  
-</verbatim>  
-  
-!Edit Config files  
-''Why are you editing them? What are you adding to them? ''  
-<verbatim>  
-kedit /etc/sysconfig/network  
-kedit /etc/pcmcia/config  
-kedit /etc/wlan/wlancfg -DEFAULT  
-kedit /etc/wlan/wlancfg-deb1  
-chmod 777 /etc/wlan/wlancfg-deb1  
-kedit /etc/wlan/wlan .conf  
-kedit /etc/hosts  
-You should see a line  
-127 . . .1 localhost  
-we need to add a host on a new line  
-192 .168 ..1 mordor.localdomain mordor  
-192.168.1.1 mordor.localdomain mordor  
-kedit /etc/host.conf  
-kwrite /etc/sysconfig/network  
-kwrite /etc/sysconfig/network-scripts/ifcfg-eth1  
-kwrite /etc/sysconfig/networking/default/ifcfg-eth1  
-kwrite /etc/sysconfig/network-scripts/ifcfg-eth0  
-kwrite /etc/sysconfig/networking/default/ifcfg-eth0  
-kedit /etc/resolv.conf  
-search mshome.net  
-nameserver 192.168.1.1  
-</verbatim>  
-  
-  
-!Get wlan up  
-Setup Windows PC using manual IP on Wifi TCP 192 .168.1.1 mask 255.255.255 .  
+!! Determine Wireless Settings  
+At this step we need to determine the parameters of our wireless . The biggest question here is the mode of the link . If you are connecting to an Access-Point then you will ned to configure your interface in ''Managed'' mode, otherwise for connecting two or more computers directly to each other you will need to use ''Ad -Hoc'' mode . The following steps will provide an example of each mode . The other three peices of information that you need are ''Channel'', ''ESSID'' and ''Network'' . ''Channel'' specifices the Physical frequency that your wireless card transmits and receives on . ''ESSID'' can be thought of as a Network Name and is used to allow multiple logically seperate wireless networks to operate on the same channel . ''Network'' is the IP settings that you will use to communicate with the other end of the link . All four of these parameters (Mode, Channel, ESSID and Network) need to be agreed on between the two ends of the link for it to function correctly . The values that the remainder of this example will use for these parameters are shown below
  
-wifi mode Ad-Hoc essid deb1 channel
+!Managed Mode  
+* Mode: Managed  
+* Channel: 6  
+* ESSID: wlug-test  
+* Network: 10.10.10./24, this computer will be 10.10.10.1, Access Point will be 10.10.10.128  
  
-Run USB Wifi  
+!Ad-Hoc Mode  
+* Mode: Ad-Hoc  
+* Channel: 6  
+* ESSID: wlug-test  
+* Network: 10.10.10./24, this computer will be 10.10.10.1, Remote Computer will be 10.10.10.254  
  
-add 192 .168.1.1 range to Windows firewall  
+!! Setup Wireless  
+This step configures the wireless settings shown in the previous section
  
-Linux Machine as SU (root)  
-''Again, what are you doing in these files?''  
+!Managed Mode  
 <verbatim> 
-kedit /etc/wlan/wlancfg-deb1  
-kedit /etc/modules.conf  
-alias eth1 prism54  
-kedit /etc/wlan/wlancfg-deb1  
-ifdown eth1  
-kedit /etc/dhcpd.conf  
-dhcpcd -i eth1 &  
-dhcpcd eth1  
-iwconfig eth1 mode Ad-Hoc essid "deb1 " channel 6  
-ifconfig eth1 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255  
-ping -c 4 192.168.1.1  
-/etc/pcmcia/network start eth1  
-route -n  
-ifconfig eth1 up  
-ifup eth1  
-iwlist eth1 scanning  
-samba status  
-hostname  
+iwconfig eth2 mode Managed  
+iwconfig eth2 essid "wlug-test
 </verbatim> 
-  
+You'll notice that we didn't set the channel - this is intentional. In Managed mode the channel is automatically set by the access point and should not be specified on the client. If you did everything correctly you should now be able to get output similar to below, the important settings are ESSID, Mode and Frequency.  
 <verbatim> 
-route -n  
-Kernel IP routing table  
-Destination Gateway Genmask Flags Metric Ref Use Iface  
-10...3 ...0 255.255.255.255 UH 1 0 0 sl0  
-192.168.1.0 ...0 255.255.255.0 U 0 0 0 eth1  
-127. ..0 ...0 255...0 U 0 0 0 lo  
-...0 192.168.1.1 ...0 UG 0 0 0 eth1  
-...0 ...0 ...0 U 1 0 0 sl0  
+xenon:~# iwconfig eth2  
+eth2 IEEE 802.11 -DS ESSID:"wlug-test" Nickname:"test"  
+ Mode:Managed Frequency:2.437GHz Access Point: 00:02:2D:39:A9:31  
+ Bit Rate=11Mb/s Tx-Power=15 dBm Sensitivity: 1/  
+ Retry limit:4 RTS thr:off Fragment thr:off  
+ Power Management:off  
+ Link Quality:36/ 0 Signal level:-61 dBm Noise level:-97 dBm  
+ Rx invalid nwid: 0 Rx invalid crypt:3 Rx invalid frag:6514  
+ Tx excessive retries:6 Invalid misc: 0 Missed beacon:  
 </verbatim> 
  
-Windows Wifi is Zyair B220 looks like only 802b  
-LAN is 192.168..1  
-Wlan is 192.168.1.1  
-  
-Almost humming !  
-  
-! Wireless Ad-Hoc PC to Notepad  
------------------------------  
-Usng PC Windows ME Zyxel USB Wlan  
-Dell Notepad;  
-The wifi card's a Netgear WG511.  
-www.netgear.com  
-I have a Dell Notepad Inspiron 2650  
-Intel Chip  
-running Mandrake 10 KDE 3.2  
-Kernel 2.6.3-7mdk  
-  
-! Results  
--------  
-Windows machine  
-netstat shows TCP to Notepad  
-ping 192.168.1.1 excellent  
-  
-Linux machine  
-apradar result  
+!Ad-Hoc Mode  
 <verbatim> 
-eth1 Scan completed :  
- NEW AP from accesspoint scan  
-essid.length 4 ESSID: "deb1 "  
- Mode:Ad-Hoc 1  
- Encryption key:off  
- Frequency:2.437GHz  
- quality: -56  
+iwconfig eth2 mode Ad-Hoc  
+iwconfig eth2 essid "wlug-test "  
+iwconfig eth2 channel 6  
 </verbatim> 
-  
+If you did everything correctly you should now be able to get output similar to below, the important settings are ESSID, Mode and Frequency.  
 <verbatim> 
-ping 192 .168 ..1  
-PING 192.168.. 1 (192.168. .1) 56(84) bytes of data.  
-  
-[1]+ Stopped ping 192.168. .1  
+xenon:~# iwconfig eth2  
+eth2 IEEE 802 .11-DS ESSID:"wlug-test" Nickname:"test"  
+ Mode:Ad-Hoc Frequency:2 .437GHz Cell: 00:02:2D:39:A9:31  
+ Bit Rate=11Mb/s Tx-Power=15 dBm Sensitivity: 1/  
+ Retry limit:4 RTS thr:off Fragment thr:off  
+ Power Management:off  
+ Link Quality:36/0 Signal level:-61 dBm Noise level:-97 dBm  
+ Rx invalid nwid:0 Rx invalid crypt:3 Rx invalid frag:6514  
+ Tx excessive retries:6 Invalid misc:0 Missed beacon:  
 </verbatim> 
-Hangs!  
  
-<verbatim>  
-iwlist eth1 scanning  
-eth1 Scan completed :  
- Cell 01 - Address: 42:F5:A8:9E:54:CF  
- ESSID:"deb1"  
- Mode:Ad-Hoc  
- Encryption key:off  
- Frequency:2 .437GHz  
- Quality:190/0 Signal level:-55 dBm Noise level:-245 dBm  
-</verbatim>  
+! Verify Configuration  
+If your output matches the examples above for the 3 important parameters then you are ready to move on to the next step
  
-<verbatim>  
-iwspy eth1  
-eth1 Statistics collected:  
- 00:00:00:00:28:C2 : Quality:0 Signal level:0 Noise level:  
- Link/Cell/AP : Quality:188/0 Signal level:-53 dBm Noise level:-5 dBm (updated )  
- Typical/Reference : Quality:/0 Signal level:-80 dBm Noise level:-256 dBm  
-</verbatim>  
+! Troubleshooting  
+If you don't get output similar to above you could try the following  
+* Bring the interface up (some cards don't update their config until the interface is brought up ) eg. ifconfig eth2 up, then try iwconfig again  
+* Check dmesg, syslog, etc for any error messages printed  
+* If still stuck, google, or try the wlug mailing list.  
  
-<verbatim>  
-iwconfig  
-lo no wireless extensions.  
-  
-eth0 no wireless extensions.  
-  
-eth1 IEEE 802.11b/g ESSID:"deb1" Nickname:"mordor"  
- Mode:Ad-Hoc Channel:6 Cell: 42:F5:A8:9E:54:CF  
- Bit Rate:11Mb/ s Tx-Power=31 dBm Sensitivity=20/200  
- Retry min limit:8 RTS thr:2347 B Fragment thr:2346 B  
- Encryption key:off  
- Link Quality:177/0 Signal level:-53 dBm Noise level:-32 dBm  
- Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:  
- Tx excessive retries:0 Invalid misc:0 Missed beacon:  
-  
-sl0 ESSID:off/ any Nickname:""  
- NWID:8 Channel:80 Access Point: FF:BF:21:00:00:00  
- Bit Rate=-1.07375e+06kb/s Tx-Power=-1073746380 dBm Sensitivity=8/  
- Retry:on RTS thr=-1073746380 B Fragment thr=-1073746380 B  
- Encryption key:0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000  
- Power Management:on  
-</verbatim>  
-NB sl0 is my Modem  
+!! Setup IP  
+This is a pretty generic step and isn't actually related to Wireless in any way, it' s the same as bringing up any interface at all!  
  
+!Managed Mode, Ad-Hoc Mode  
 <verbatim> 
-cat /proc/net/dev  
-Inter-| Receive | Transmit  
- face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed  
- lo: 36700 511 0 0 0 0 0 0 36700 511 0 0 0 0 0  
- eth0: 0 0 0 0 0 0 0 0 5476 18 0 0 0 0 18  
- eth1: 985616 12647 0 0 0 0 0 0 111013 868 0 0 0 0 0  
- sl0: 0 0 0 0 0 0 0 0 68564 819 0 0 0 0 0  
- sit0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
+ifconfig eth2 10.10.10.1 netmask 255.255.255. 0 broadcast 10.10.10.255 up  
 </verbatim> 
  
+!Verify Configuration - Managed Mode  
 <verbatim> 
-iwconfig eth1  
-eth1 IEEE 802 .11b/g ESSID :"deb1" Nickname :"mordor"  
- Mode:Ad-Hoc Channel :6 Cell: 9E:05:A8:9E:54:CF  
- Bit Rate :11Mb/s Tx-Power =31 dBm Sensitivity =20/200  
- Retry min limit:8 RTS thr:2347 B Fragment thr:2346 B  
- Encryption key:off  
- Link Quality:196/0 Signal level:-55 dBm Noise level:-245 dBm  
- Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:  
- Tx excessive retries:0 Invalid misc:0 Missed beacon:  
-</verbatim>  
+xenon:~# ping 10.10.10.128  
+PING 10 .10.10.128 (10.10.10.128) : 56 data bytes  
+64 bytes from 10.10.10.128 : icmp_seq=0 ttl=64 time=3.9 ms  
+64 bytes from 10.10.10.128 : icmp_seq=1 ttl=64 time=3. 6 ms  
+64 bytes from 10.10.10.128 : icmp_seq =2 ttl =64 time=3.6 ms  
  
-<verbatim>  
-route -n  
-Kernel IP routing table  
-Destination Gateway Genmask Flags Metric Ref Use Iface  
- 10. . .3 ...0 255.255.255.255 UH 1 0 0 sl0  
-192 .168 . .0 ...0 255.255.255.0 U 0 0 0 eth1  
-127...0 ...0 255...0 U 0 0 0 lo  
-...0 ...0 ...0 U 1 0 0 sl0  
+--- 10.10 .10 .128 ping statistics ---  
+3 packets transmitted, 3 packets received, % packet loss  
+round-trip min/avg/max = 3 .6/3 .7/3 .9 ms  
 </verbatim> 
  
+!Verify Configuration - Ad-Hoc Mode  
 <verbatim> 
-ifconfig eth1  
-eth1 Link encap :Ethernet HWaddr 00:09:5B:C2:C7:1A  
- inet addr:192 .168 . .5 Bcast:192 .168 . .255 Mask :255 .255 .255 .  
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric :1  
- RX packets:0 errors:0 dropped:0 overruns:0 frame:  
- TX packets:48 errors:0 dropped:0 overruns:0 carrier:  
- collisions:0 txqueuelen:1000  
- RX bytes:0 ( .0 b) TX bytes :5316 (5 .1 Kb)  
- Interrupt:10  
-</verbatim>  
+xenon :~# ping 10.10.10.254  
+PING 10 .10 .10 .254 (10 .10 .10 .254) : 56 data bytes  
+64 bytes from 10 .10 .10 .254: icmp_seq= 0 ttl=64 time=3.9 ms  
+64 bytes from 10.10.10.254 : icmp_seq= 1 ttl=64 time=3.6 ms  
+64 bytes from 10 .10.10.254 : icmp_seq=2 ttl=64 time=3 .6 ms  
  
-If I remove WLAN and insert LAN I get  
-<verbatim>  
-ping 192 .168 . .1  
-PING 192.168. .1 (192.168..1) 56(84) bytes of data.  
-64 bytes from 192.168..1: icmp_seq =1 ttl=64 time= .549 ms  
-64 bytes from 192 .168..1: icmp_seq=2 ttl=64 time=.328 ms  
-64 bytes from 192.168..1: icmp_seq= 3 ttl=64 time= .322 ms 
+--- 10 .10 .10 .254 ping statistics ---  
+3 packets transmitted, 3 packets received, % packet loss  
+round-trip min/avg/max = 3 .6/3 .7/ 3.9 ms 
 </verbatim> 
  
-NOTE: It's important that you setup the interface in the following steps  
-%%% 1) Make sure the interface (eth1) is down  
-%%% 2) Execute the iwconfig commands  
-%%% 3) Execute the ifconfig command (will Add IP and bring interface up)  
-%%% 4) Perform tests  
-%%% The main things was doing the card firmware and using a different subset  
-  
-This order is crucial because the new network settings are not written  
-to the wireless card until you bring the interface up (via the ifconfig  
-command) .  
-  
-Now the Internet!  
-  
--- BillRosoman  
+!Troubleshooting  
+* Check settings at remote end - do they match configured settings here  
+* Check for any error messages in dmesg, syslog, etc  
+* If still stuck, google, or try the wlug mailing list
  
+!! Done  
+At this point you are done and successfully have a wireless interface up and running in linux! Now on to how to configure it in your distribution....  
 ---- 
 CategoryWireless, CategoryNotes