Scripting with wireless network cards
VirginSnow at vfemail.net
VirginSnow at vfemail.net
Sun Jun 3 21:44:53 EDT 2007
> Date: Sun, 3 Jun 2007 21:26:19 -0400
> From: "Ben Scott" <dragonhawk at gmail.com>
> Finally, you can read the source. Use "which ifup" to find the
> actual file -- on my Fedora 6 box, it's /sbin/ifup. Then use the
> file(1) command to determine the type of file. Again on my box:
>
> $ file /sbin/ifup
> /sbin/ifup: Bourne-Again shell script text executable
>
> Since that's a shell script, I can read it directly. If it was a
> binary, I could pull the source package, and look at that.
Actually, reading the shell script is where I would *start*. If you
can read bash, it's probably the fastest way to find out what you need
to know (well, beyond what the man page tells you). Source, however,
has one unique advantage over documentation: it's always up to date!
If your wireless interface is flaking out (if it decides to quit
sending/receiving packets or whatever), unloading and reloading the
wifi module may help. However, taking an interface down and bringing
it back up has the potential to sever existing TCP/IP connections.
(This is probably what you're seeing.) There are some workarounds:
(1) If you have another point of presence on the 'Net, you can tunnel
all your packets to it, and gateway onto the net from there. That
way, if your IP ever changes, you can reconfigure your tunnel and
your connections will remain intact. Of course, this could be
scripted.
(2) When your wifi goes haywire, you can look for the modules which
need to be reloaded, make a note of your network settings, remove and
reload the modules, and manually restore the network settings. This
could be scripted too.
(3) (Warning: this workaround comes close to being an actual *fix*!)
You could look for a more recent version of your wifi driver and use
that. Note, if you know C, you needn't necessarily upgrade your
kernel to do this. Often, copying the .c and .h files from a newer
kernel tree will suffice. I run Frankenkernels like this all the
time.
More information about the gnhlug-discuss
mailing list