Maybe I'll try that.  Anyway, I also just use a script to run
'ifconfig' and 'route' as appropriate.  Here's my script, I call it
"chip"  (for "CHange IPaddress").  Insert the appropriate network
addresses as needed.   (Of course, this doesn't modify /etc/resolv.conf,
but that could be easily added.)  After I become root, I just run
'chip home' or 'chip office1' or whatever.

---------snip----------
#!/bin/bash
#
#  A simple script to change my ip address and default route.
#  Usage: chip [ home|office1|office2 ]
#
#

PATH=/sbin:/usr/sbin:/bin:/usr/bin

NETWORK=$1

[ -z "$NETWORK" ] && {
    echo "Usage: chip [ home|office1|office2 ]" >&2
    exit 1
}


if [ "$NETWORK" = "home" ]; then
    IPADDR=11.11.11.11
    NETMASK=255.255.255.0
    GATEWAY=11.11.11.1
fi

if [ "$NETWORK" = "office1" ]; then
    IPADDR=22.22.22.22
    NETMASK=255.255.255.0
    GATEWAY=22.22.22.2
fi

if [ "$NETWORK" = "office2" ]; then
    IPADDR=33.33.33.33
    NETMASK=255.255.255.0
    GATEWAY=33.33.33.3
fi

ifconfig eth0 down
sleep 1
ifconfig eth0 up $IPADDR netmask $NETMASK
sleep 1
route add default gw $GATEWAY


-----------snip-----------

Klaus wrote:
>
>On Sun, Jan 23, 2000 at 08:42:01AM -0800, Michael Perry wrote:
>> Just out of curiosity...  Has anyone used the scheme stuff to setup a laptop
>> to be on two different networks?  I have a few simple scripts that bring
>
>Yes, it is very easy.
>Define the scheme in /etc/pcmcia/network.opts, example:
>
>case "$ADDRESS" in
>franken,*,*,*)
>    # Host's IP address, netmask, network address, broadcast address
>    IPADDR="192.168.1.11"
>    NETMASK="255.255.255.0"
>    NETWORK="192.168.1.0"
>    BROADCAST="192.168.1.255"
>    # Gateway address for static routing
>    GATEWAY="192.168.1.1"
>    # Things to add to /etc/resolv.conf for this interface
>    DOMAIN="klaus.franken.de"
>    SEARCH="klaus.franken.de"
>    DNS_1="192.168.1.1"
>...
>
>Change the scheme with 'cardctl scheme <newscheme>'
>The current scheme is stored in /var/lib/pcmcia/scheme.
>
>-- 
>
>        Klaus Franken, [EMAIL PROTECTED]
>
>------------------------------------------------------------
>                   D O N ' T       P A N I C !!!
>------------------------------------------------------------
>Uptime: Linux 2.2.13, 24 Days,  Hours
>

Reply via email to