[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to switch PCMCIA network config



Hi FB

On Sat, Dec 30, 2000 at 12:27:26PM +0100, FB wrote:
> Hi,
> 
> I have a laprop with Potato on it. I have a PCMCIA ethernet card which
> I use to plug my laptop in different networks.
> The way I do it, I have several network.opts.xxxx files under /etc/pcmcia
> one fore each network I plug in.        
> 
> When I switch network, I use a simple 'switch' script to change the network 
> parameters.
> It does the following:
>    /etc/pcmcia/network stop eth0
>    cp /etc/pcmcia/network.opts.$1 /etc/pcmcia/network.opts
>    /etc/pcmcia/network start eth0
> 
> All this works well enough. But I half remember that I read something
> about 'schemes'(??), which was designed to make the configuration
> switch automatically ( assuming that I remember correctly and I understood
> correctly what I read).
> I can't find anymore any docs related to this. 
> Anybody knows what I'm talking about? ( or any way to make config switch
> easier? ).

You remembered correctly - schemes is a much better way of doing it.

I also have a laptop running Potato.  I only have the one network.opts
file which contains a number of different ``schemes''.  It you read the
PCMCIA-HOWTO it is all in there.  The basic idea is the four parts of the
"$ADDRESS" in the switch statement are:
   scheme
   socket
   instance
   hardware Address

I have just the one network card, and I use the schemes and socket parts 
of the ADDRESS to configure the card.  

I assume that you plug your laptop into three networks: home, base and 
customer.  `home' is your home network and runs on a private IP address
(192.168.xxx.xxx for example), `base' is your normal place of work and
has its own IP subnet of the internet, and `customer' is a site that 
runs DHCP.

If you change your network.opts file to look something like this:

    case "$ADDRESS" in
    *,1,*,*)
	INFO="Home Setup"
	DHCP="n"
	IPADDR="192.168.10.2"
	NETMASK="255.255.0.0"
	NETWORK="192.168.0.0"
	DOMAIN="home"
	DNS_1="192.168.1.1"
	;;
    work,0,*,*)
	INFO="Work Setup"
	DHCP="n"
	IPADDR="1.2.3.4"
	NETMASK="255.255.255.0"
	NETWORK="1.2.3.0"
	DOMAIN="work.com"
	DNS_1="1.2.3.1"
	DNS_1="1.2.3.2"
	DNS_1="1.2.3.3"
	;;
    customer,0,*,*)
	INFO="Off site working"
	DHCP="y"
	DNS_1="...."
	;;


Well something like that anyway - you should get the idea then if you
plug your network card into the top slot it will always be configured 
for your home network.

If you plug the network card into the bottom slot then it will be
configured depending upon the setting of your scheme.  If you change
scheme (cardctl scheme <name>) then the network is reconfigured (you
don't even need to pull the card our and push it back in).

Hope this helps.

Steve




Reply to: