Re: Problem setting up wireless lan connection
From: Floyd L. Davidson (floyd_at_barrow.com)
Date: 01/15/05
- Next message: Toni Erdmann: "Re: Possible? eth0:1 ... eth0:50000"
- Previous message: johnc_at_richmatt.com: "Re: telnet port 110"
- In reply to: insomniux: "Problem setting up wireless lan connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 15 Jan 2005 01:46:32 -0900
"insomniux" <mike.bosschaert@hccnet.nl> wrote:
>Hi,
>I try to connect my laptop with my Zaurus (linux PDA with wifi card) by
>wireless lan but with no succes. On both machines pinging the local
>cards work. However pinging form one box to the other does not work. I
>use 192.168.2.22 for the laptop and 192.168.2.23 for the pda.
>Furthermore the laptop has an eth0 to connect to the wired lan.
>
>Could anyone please help me getting this to work?
>
>Mike
>
>This is the output of iwconfig and ifconfig:
>laptop iwconfig
>wlan0 IEEE 802.11-b ESSID:""
Generally, you need an ESSID, and it has to match that of
the device you are going to connect to. Hence you might
use "bosschaert" as your ESSID, and on both devices when
you do the iwconfig command include "essid bosschaert".
>Mode:Ad-Hoc Frequency:2.412GHz Cell: 00:00:00:00:00:00
When the Cell: is filled with 00's it means there is no
connection established.
...
>laptop ifconfig
I take it the label is wrong here, and you actually meant
that this is the PDA, not the laptop (the IP matches what
was described above for the PDA).
...
>wlan0 Link encap:Ethernet HWaddr 00:02:8A:A7:0B:F4
>inet addr:192.168.2.23 Bcast:192.168.2.255
>Mask:255.255.255.0
...
>iwconfig laptop:
>wlan0 IEEE 802.11b ESSID:off/any
>Mode:Auto Frequency:2.412 GHz Access Point:
>00:00:00:00:00:00
I.e., not connected. Note also that I'm not sure if
setting it to "Mode:Auto" is going to work, or not.
Apparently you want an Ad-Hoc network, with only two
devices that talk to each other. That is as opposed
to having an Access Point such as a router, and having
one or more clients connecting to it. Is that correct?
>ifconfig laptop:
>eth0 Link encap:Ethernet HWaddr 00:C0:9F:3F:99:84
>inet addr:192.168.1.2 Bcast:192.168.1.255
>Mask:255.255.255.0
...
>wlan0 Link encap:Ethernet HWaddr 00:0B:6B:29:05:E9
>inet addr:192.168.2.22 Bcast:192.168.2.255
>Mask:255.255.255.0
You are missing two things. One is a proper iwconfig command
for each of the two devices. Two is proper routing commands
to send the IP packets to the right interface.
Basically, you need this sequence of commands to initiate a
wifi connection,
1) load the kernel module for the wifi card.
2) Configure the interface (wlan0 or whatever)
using ifconfig. This binds an IP address to the
interface. If the interface configuration is
successful, "ifconfig wlan0" should indicate the
interface is up.
3) Configure the wifi card using iwconfig. Several
parameters *must* match between the two wifi
devices that are expected to talk to each other.
They must have the same ESSID, use the same
encryption and key, be set for the same mode
(Ad-Hoc or Managed). Hence the minimal command
to use would look something like this:
iwconfig wlan0 essid "myessid" mode Ad-Hoc \
key 1234567890
Following that command on both of the devices,
using just "ifconfig wlan0" should show a Cell
number that is not all 0's, thus indicating a
connection has been made. If not, determine what
parameters do not match between the two units, and
use iwconfig to reconfigure one or the other.
I'm not positive, but with an Ad-Hoc topology you
might also need to specify the frequency (or
channel) to force both units to the same channel.
4) You must use the route command to provide what
ever routing your network requires. The ifconfig
command sets a route for the subnet indicated by
the IP address assigned to an interface, so if that
is sufficient, nothing else is needed. If the IP
address is a.b.c.d, the automatically set route will
be masked for any a.b.c.x, where x is anything from
1 to 255. All other addresses require another route
command to set up. A default gateway route also
requires another command.
Example: My LAN has address in the 192.168.0.x range.
I have a wireless network, using managed mode and a
router as an access point. All wireless units have
IP addresses in the range of 192.168.1.x. On any given
wireless unit, I have to add routes for 192.168.0.x
addresses, and a default.
route add -net 192.168.0.0 netmask 255.255.255.0 dev wlan0
Note that the netmask could be changed to 255.255.0.0,
and the automatic route for 192.168.1.x could be deleted.
Each unit then needs a default gateway route:
route add default 192.168.0.2 dev wlan0
Note that on any host with both an ethernet and a
wifi device, routes to both must be set manually *if*
any IP address on those subnets are outside the range
of the route set by ifconfig.
5) You must also have some sort of DNS, so that network
names can be translated to IP addresses. I use static
IP addresses and simply put them into /etc/hosts on all
of my machines. A larger network, or one using DHCP,
clearly needs something better.
Okay, in your particular case it appears that the appropriate
kernel modules have been loaded, so you do have a wifi device.
The appropriate ifconfig commands have been run, and each device
is listed as "up". But correct iwconfig commands do not appear
to have been run. (You can use the "iwlist wlan0 scan" command
to get an idea what each unit is seeing, which can be
interesting and useful.)
Given what you have described, the only additional routing
commands you'll need will be to assign a default gateway.
-- Floyd L. Davidson <http://web.newsguy.com/floyd_davidson> Ukpeagvik (Barrow, Alaska) floyd@barrow.com
- Next message: Toni Erdmann: "Re: Possible? eth0:1 ... eth0:50000"
- Previous message: johnc_at_richmatt.com: "Re: telnet port 110"
- In reply to: insomniux: "Problem setting up wireless lan connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|