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

From: "Julian Thomas" <os2-wireless_users@2rosenthals.com> Full Headers
Undecoded message
Subject: Someone (Stu?) wanted scripts
Date: Tue, 14 Jul 2009 16:44:49 -0400 (EDT)
To: "os2wireless" <os2-wireless_users@2rosenthals.com>

to switch between fixed IP and DHCP.

Here's what I use (lan 0 is wired; lan 1 is wireless).

/*  Start wireless wih dhcp   */
say "Activating the wireless network card"
'ifconfig lan0 down'
'ifconfig lan0 delete'
'ifconfig lan1 down'
'ifconfig lan1 delete'
'dhcpmon -l'  /* release lease  */
'dhcpmon -t'  /* terminate dhcp  */
'route flush'
'arp -f'
'dhcpstrt -i lan1 -d 10'
/*  'start' wifiProg  */
'start dhcpmon'
say "Wireless networking enabled"
return


/* start wireless with fixed IP  */

/*
* change to fixed IP
*/
'killem dhcpmon.exe'
'ifconfig lan0 down'
'ifconfig lan0 delete'
'ifconfig lan1 down'
'ifconfig lan1 delete'
'dhcpmon -l'  /* release lease  */
'dhcpmon -t'  /* terminate dhcp  */
'route -fh'
'arp -f'
'ifconfig lo 127.0.0.1'
/*    fixed ip = 192.168.2.60   **/
'ifconfig lan1 192.168.2.60 netmask 255.255.255.0 metric 1 mtu 1500'

/*  router = 192.168.2.9   **/
'route add default 192.168.2.9 -hopcount'
'ipgate off'
say "Now fixed ip 192.168.2.60"

--
 Julian Thomas:   jt@jt-mj.net    http://jt-mj.net
 In the beautiful Genesee Valley of Western New York State!
 -- --
 Blessed are the pessimists, for they have made backups.



--
This email was Anti Virus checked by Astaro Security Gateway. http://www.astaro.com

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