[TAG] LG 127 Wifi
Benjamin A. Okopnik
ben at linuxgazette.net
Sun Aug 6 06:25:47 MSD 2006
Hi, Jeff -
I'm going to CC the LG Answer Gang on my response, since this is pretty
much the purpose of TAG; also, chances are that someone else may be able
to cover any areas that I miss.
On Sat, Aug 05, 2006 at 07:02:23PM -0600, jeff at jeffroot.us wrote:
> Ben Okipnik;
"Okopnik", please. :)
> In the LG#127 article "With Knoppix at a HotSpot", you made the
> comment:
>
> [ I do a lot of travelling, and connect to a wide variety of
> strange WLANs. In my experience, at least, connecting to a
> wireless LAN with Linux is usually just as simple as Edgar
> describes. -- Ben ]
>
> Well, I have a very different experience. I have no trouble at all
> connecting to a managed wifi network; at home or work, I just set
> the ESSID and WEP key in /etc/network/interfaces, and "netscheme
> work" does the rest. But this same machine has never managed to
> connect to an _open_ wifi network.
>
> Today, I visited my municipal wifi and tried to connect. I ran
> Kismet to see that the ESSID was "OldTownWifi" and that wep and
> encryption were both off. So I used iwconfig to set the essid and
> managed mode, then ran dhclient. Nothing. No response from their
> server at all.
>
> So how about this: you help me understand why I can see an open
> hotspot with Kismet but can't seem to give the right incantation to
> connect, and I'll write up a "dummy's guide" for LG.
Well, that sounds like a fair sort of deal... but I don't know that I
can answer the question as posed. In my mind, at least, it comes down to
"why doesn't dhcpclient work as it should?" - and I can't really tell
you, since I don't use it. I suppose you could always take a look at
your '/var/log/{daemon,kern}.log' or '/var/log/messages' and figure out
where it's failing.
To be a bit more specific, I've tried using 'dhcpclient' in the past - I
don't recall why - but it simply didn't work no matter what I tried, on
a "known good" Ethernet connection which worked fine with 'pump' on a
different machine. I pounded on the config file for a while, tried
everything in the manpage - then gave up and installed 'pump'... and
everything instantly started working - and if I recall correctly, it
required no configuration on my part.
I've been using 'pump' ever since.
These days, I usually use the 'ifup/ifdown' front ends instead of using
it directly (although sometimes I forget and use it directly; it works
fine either way.) I never have to set the ESSID unless I'm trying to get
onto a private network; the one time that I ended up wrestling with it
turned out to be a case of solving the wrong problem - the responsible
bit was a broken kernel module for my ipw2200, and not the client at
all. As I've said, It Just Works.
> It sure seems like it's needed. I've spent a great deal of time on
> Google and found no end of info on setting up the hotspot itself,
> but not a word about how to connect to the hotspot from Linux. When
> a professional Sysadmin and programmer can't figure this out, there
> must be something wrong somewhere. (And I'm willing to admit it if
> that something turns out to be me...)
Well, let's assume that we're going to do this with 'pump', and let's
take a look at the relevant info in my '/etc/network/interfaces':
```
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
# automatically added when upgrading
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
# [ Skipping several private network stanzas ]
# Default wlan0 DHCP setup
iface wlan0 inet dhcp
# Set mode to 802.11B/G
pre-up iwpriv wlan0 set_mode 6
pre-up ifconfig eth0 down
post-down ifconfig eth0 up
wireless_mode Managed
'''
So, I set my 'eth0' to a static IP as soon as the machine comes up, but
my 'wlan0' stays down until I invoke it with 'sudo ifup wlan0'. Note, by
the way, that some of the verbiage in this last stanza is mostly
unnecessary - I could probably take out the 'set_mode 6' line and it
would work just fine. I'm also bringing down eth0 so that the primary
gateway in the routing table will be the one that this latest
negotiation returns - I had a problem with this some years ago and fixed
it this way, so that's left over from back then (since it does me no
harm, I've just left it in place.) Of course, since I bring it down when
I start my wireless, it's only "fair" to bring it back when I'm done
with wlan0 - hence, the 'eth0 up' line. In short, the whole thing could
look like this and still work without a problem:
```
iface wlan0 inet dhcp
wireless_mode Managed
'''
...although I'd run right back to my current config if a problem
appeared. :)
Just for reference, here's what the DHCP negotiation looks like in my
'/var/log/daemon.log' when I do connect via my WiFi interface:
```
Jan 31 20:54:48 Fenrir pumpd[4711]: starting at (uptime 0 days, 2:43:09)
Tue Jan 31 20:54:48 2006
Jan 31 20:54:48 Fenrir pumpd[4711]: PUMP: sending discover
Jan 31 20:54:52 Fenrir pumpd[4711]: got dhcp offer
Jan 31 20:54:52 Fenrir pumpd[4711]: PUMP: sending second discover
Jan 31 20:54:55 Fenrir pumpd[4711]: PUMP: got an offer
Jan 31 20:54:55 Fenrir pumpd[4711]: PUMP: got lease
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: device: wlan0
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: set: 416
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: bootServer: 10.0.0.1
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: reqLease: 43200
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: ip: 10.0.0.219
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: next server: 10.0.0.1
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: netmask: 255.255.255.0
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: gateways[0]: 10.0.0.1
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: numGateways: 1
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: dnsServers[0]: 10.0.0.1
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: numDns: 1
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: broadcast: 10.0.0.255
Jan 31 20:54:55 Fenrir pumpd[4711]: intf: network: 10.0.0.0
Jan 31 20:54:55 Fenrir pumpd[4711]: configured interface wlan0
'''
So my advice is - uninstall 'dhcpclient', install 'pump', and give it a
try. If it doesn't work, at least I'll have a little expertise with it
and be able to help you - but I suspect that you'll find it as
problem-free as I have.
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://linuxgazette.net *
More information about the TAG
mailing list