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

From: Christian Langanke <os2-wireless_users@2rosenthals.com> Full Headers
Undecoded message
Sender: os2-wireless_users-owner <os2-wireless_users-owner@2rosenthals.com>
Subject: [OS2Wireless] How to switch between wired and wireless interface by XWLAN (was Re: thanks to all)
Date: Fri, 10 Dec 2004 22:27:02 +0100
To: os2-wireless_users@2rosenthals.com

Julian Thomas wrote:

Better yet, I'll paste them in here.  wireless.cmd and wired.cmd do the
obvious things.  wired is lan0; cisco is lan1.
 

Please somebody tell me why it should be necessary to switch between wireless and wired configurations like shown in the scripts of the mail I am quoting here.

XWLAN does 95% of the "obvious" things already, once you only configure it to do so. Just configure the connection profile to be used to DHCP configuration by XWLAN, and configure the proper interface in the widget properties (!!). Also better don't configure the wireless IP interface in the TCP/IP configuration.

The only thing that is currently missing for a true (half-)automated switch between wired and wireless interface/connection is that no DHCP request for the wired interface is automatically fired off when switching away from wireless. Here the script feature of XWLAN can (as a workaround) be (mis)used to execute such a call when the connection and TCP/IP configuration over WLAN  has been interrupted. Once this is set up (see below), you can (half-)automatically switch between wired and wireless connection by just pulling or pluggin the wireless PCMCIA card or enable/disable radio for a built-in device.

To make things clearer, here is the configuration scheme of XWLAN in detail. Taken that you choose XWLAN to perform DHCP configuration for the wireless IP interface, the XWLAN script, once being activated and provided (that is, copy one of the examples into the script directory [I recommend the REXX script !] and edit according to your needs, see the online help), this script is called for disconnect and connect events.

---------> WLAN disconnect event

when this is called, XWLAN has already done the following (where lanx is the wireless interface):
dhcpmon /l
dhcpmon /t
ifconfig lanx delete
arp -f

A "route -fh" is not necessary, here as the "dhcpmon /l" will release the DHCP lease for the wireless interface, this will already reset all routes pointing to/over that interface.

In order to automatically launch DHCP for the wired interface here, you would have to execute "dhcpstrt lany -d 0" within the connect event part of your XWLAN script, where lany is the wired IP interface. Do not specify a delaywith -d here, otherwise the GUI of the widget will be blocked unnecessarily.

---------> WLAN connect event

when this is called, XWLAN has already done the following (where lanx is the wireless interface. Don't mind that the unconfiguration sequence from above [first four commands here] is completely executed here as well for safety):

dhcpmon /l
dhcpmon /t
ifconfig lanx delete
arp -f
<here DHCPCD.EXE gets killed by internal code if still in memory after half a second, because dhcpmon /t does sometimes not properly terminate the client daemon>
dhcpstrt -i lanx -d 0

For this case the dhcpmon /l and /t will already completely unconfigure the wired IP interface, so there is no need to add commands for it here.

-----

I think it may make more sense switching to that kind of automated setup instead of using own scripts, as once the XWLAN solution fits everybodys needs, nobody is required anymore to fiddle around with IP configuration commands anymore. I would like to see XWLAN be a bullet as well as a fool-proof solution, and only the experienced users, like you are, can help me to achieve this. Please try out the XWLAN way, and if it does not fit your needs, tell me and we discuss whatever solution is required.

BTW, I intend to also make that above stated dhcpstrt command for the wired interface in an XWLAN script obsolete as well in a forthcoming release. If that succeeds, I think at least then really no script for any IP configuration is required anymore to switch between cabled and wireless interfaces. In fact the XWLAN script engine was intended to start/end user applications only....

Moreover, I just started to code cleanup routines for the routing and arp table to not any longer rely on dhcpmon /l (or route -fh) or the "arp -f" command. Instead the cleanup routines I now work on will kick out exactly only these entries being related to the IP interface to be disabled, leaving everything else alone.

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)

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




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