Mailing List os2-wireless_users@2rosenthals.com Archived Message #2219

From: "Chris Clayton" <os2-wireless_users@2rosenthals.com> Full Headers
Undecoded message
Sender: os2-wireless_users-owner <os2-wireless_users-owner@2rosenthals.com>
Subject: [OS2Wireless] XWLAN script for changing between wifi and wired LANs
Date: Mon, 28 Nov 2005 20:03:02 -0700 (MST)
To: "os2-wireless_users@2rosenthals.com" <os2-wireless_users@2rosenthals.com>

On Tue, 29 Nov 2005 00:39:24 +0100, Christian Langanke wrote:

>Chris Clayton wrote:
>
>>After quite a bit of testing I have developed a xwlan script that
>>changes between a 'Home' profile wifi lan0 and a wired lan1.
>>
>Hi Chris,
>
>great idea !Never thought about handling even NetBios stuff in such a
>way. Is there a specific reason why on "home connect" you don't restart
>the peer within the script ? Just thought about in which way this could
>be added.

This is a holdover from the pre genmac days when I had to remove the
IBM High Rate PC card to be able to suspend/hibernate my laptop.  If
there was any possibility of network activity while the card was
removed, the wifi network would break; requiring a reboot to correct.
This included NetBIOS requests, pending IP port closures, LPR
requests,
etc.  So I always held printer queues, stopped peer and issued
'netstat
-s' to make sure no IP ports had pending actions.

With genmac the nic is always attached so the is no reason not to
restart peer after making the change over between wifi and wired.  The
only hitch is a peer start or stop takes quite a bit of time, 10-30
seconds, so it would be better to run the script detached.  Will this
cause a problem with xwlan settings?

The way I would restart peer is via:  'login name /p:password [/L]'  
This way one is logged in and ready to access shares.  The /L
parameter
is only needed when one is logging into a NetBIOS server network (eg,
WINS [ugh]), not usually a SOHO environment.

>
>I also read your comments about sticking to plain batch instead of using
>REXX. Just my two cents: the REXX script would read much better, because
>lots of comments would not be needed and no problems with batch labels
>would occurr. If the below things are done, and your script can get
>shorter, maybe it makes sense to try a REXX version - this may convince
>you. OTOH I could well think of enhancing XWLAN with some of the things
>your script does, just like starting/stopping peer. The bad part on this
>is that there is no way to safely determine if a NetBIOS compatible
>protocol stack is bound to the Wifi nic. In any way I would appreciate
>if we can proceed on that further, please send pm if you are interested
>in that.

If peer isn't available, wouldn't a call to a peer function return an
error that could be parsed?

>
>But also plain batch will just do fine of course.  I only would suggest
>a slight change in order to make the whole script more configurable:
>specify the real important values as SET vars at the top:
>
>SET WIFI_IF=lan1
>SET CABLED_IF=lan0
>SET IP=192.168.2.56
>SET NETMASK=255.255.255.0
>SET HOMEPRF=Home
>
>and use it in the comands and batchlabel. It is much easier then for
>others to use it as well (I would do the very same for the REXX solution

I agree, if I were to put this script into 'production' I would add a
lot of feature like this to make it more user friendly.  In fact this
is a very good reason to change it to a REXX script where one could
setup a handy config program/file.

>BTW)
>And I just wondered of why you need a hopcount of 2 ...

This is a holdover from my early networking days.  My server is the
network router and connection to the world.  It is beyond the Linksys
AP/router I use to connect to the other systems on my home network,
hence the network router is two hops away from any computer connected
to the Linksys box.  Not really needed now, but in the old days one
needed quite explicit about TCP/IP settings.

>
>About your comments
>
>>1)  When the radio is turned off the SSID does not appear to be passed
>>to the script (I get a NULL string).  So I used the profile name as a
>>test instead of the SSID as indicted in the sample script.
>
>Will check that. The SSID should be empty only when (dis)connectiing from/to a hotspot.

Thanks

>
>>2) I had to disable the TCP/IP setup in the 'Home' profile and do the
>>setup in the script because I got a popup error message about using
>>duplicate fixed IP addresses for both lan0 and lan1.  The 'Travel' DHCP
>>setup was ok, no configuration statements are needed in the script
>>except for ensuring that the wired LAN is deleted.
>
>Just thought about to add a property to suppress this warning in favour either for the wireless or cabled interface. Think this should help you to make your script even shorter.
>
As long as folks understand that only one LAN can be active at any
given time when using the same IP address

>>3) The wifi is sometimes stubborn about connecting to a profile, even
>>if the AP is only a few feet away.  I'm not sure if this is a xwlan
>>script problem or related to interference from local networks.  
>
>May also be a driver issue... I sometimes even get a "no driver available", while the hardware _is_ available and was working before, and that both from genprism and genmac drivers (and the mini pci card csnnot be removed, right ?)

That thought crossed my mind also.

>
>>4) Sometimes the 'Home' profile connects but the connect event is not
>>sent to the script.  In this case, the infamous 'IP disabled' logo is
>>shown.  I correct this by manually issuing the appropriate wifi script
>>commands.
>
>Ah, did not check for this until now, as I had not to rely on the script feature that much. Of course, if such a script does the whole config, one will notice it much earlier. Unfortunately I have no clue how I could check why some events are just not showing up.

Agree.  This is a very intermittent problem. Probably due to a timing
issue that will be very hard to track down.  During my experimentation
and testing I was doing quite a bit of changing back and forth between
the wifi and wired lans.  I may have made a change while setup was
still in progress.

Cheers,

Chris
 
>
>---
>
>I also found a bug that for "radio on" (or was it "radio off") no
>(dis)connect script event is generated. Will have to go after that...
>
>bye, Christian
>
>-------------------------------------------------
>
>Christian Langanke
>COS2E & CWSE
>Team OS/2 Ruhr e.V.
>cla@clanganke.de
>
>
>
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>To unsubscribe from this list, send a message to
>steward@2rosenthals.com with the command
>"unsubscribe os2-wireless_users" in the body
>(omit the quotes).
>
>For help with other commands, send a message
>to steward@2rosenthals.com with the command
>"help" in the body (omit the quotes).
>
>This list is hosted by Rosenthal & Rosenthal
>P.O. Box 281, Deer Park, NY 11729-0281. Non-
>electronic communications related to content
>contained in these messages should be directed
>to the above address. (CAN-SPAM Act of 2003)
>
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
>




=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

To unsubscribe from this list, send a message to
steward@2rosenthals.com with the command
"unsubscribe os2-wireless_users" in the body
(omit the quotes).

For help with other commands, send a message
to steward@2rosenthals.com with the command
"help" in the body (omit the quotes).

This list is hosted by Rosenthal & Rosenthal
P.O. Box 281, Deer Park, NY 11729-0281. Non-
electronic communications related to content
contained in these messages should be directed
to the above address. (CAN-SPAM Act of 2003)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=




Subscribe: Feed, Digest, Index.
Unsubscribe
Mail to ListMaster