Re: network in mu

From: Michele Andreoli (m.andreoli@tin.it)
Date: Mon Sep 11 2000 - 11:01:20 CEST


On Sun, Sep 10, 2000 at 08:58:22PM +0200, Dumas Patrice nicely wrote:
>
> 1) A .fun for every type of interface that assign an IP to the
> interface, a netmask if needed, and load modules needed by this
> interface. In other words it loads modules and issue ifconfig.
> The .fun then calls a new netconfig script that setup routes associated
> to this interface. A gateway is asked for every route to a net.
> In the .cnf there is only the name of the interfaces. Their
> configuration is put in file residing in /etc/, maybe /etc/net, one file
> per interface (so in /etc/net/eth0, /etc/net/eth1, .....)
> Those files are stored in setup/store/net/eth0.... when store is called.
>
> 2) A global network.fun that setup global stuff llike dhcp, ..., default
> route...

I'm doing exactly that. I have only 3 PCs: a notebook (N), a pentium (P)
and a 486 (486). The (P) has two ethernet cards. I'm testing a lot
of connections scenario, using pcmcia/eth/ppp/plip, with multi-ethernet.
I tested also a simple network using only serial ports.

I'm developing a new versatile script with should replace "netconfig", able
to deal with *any* kind of network interface. I will remove from /setup
any intelligence about networking, demanding all to this new script,
because I wish to use it also in my main system. Setup should call this
"net" script. It uses a non-Unix syntax, like:

        # net ppp0 device=/dev/ttyS0 ip=noipdefault
        # net eth0 card=3c90x irq=11 netmask=...
        # net masquerade from=192.168.1.0/24 to= ...
        # net block from= .... to= ...
        # net ppp0 stop
        ... etc ..

because I have a good parser for this kind of command line syntax that
facilitate a lot: SplitArgs(). You will find in /etc/utils.
For example:

                SplitArgs device=/dev/ttys0 defaultroute

will put in the script's environment two variables:

                device=/dev/ttyS0
                defaultroute=true

(It was designed in order to parse kernel boot options.)

> Note : I haven't find your array() function in /etc/utils ? And also I

That is:
---------------------------------------
Array()
{
array=$1; n=$2
save=$IFS; IFS=","
set -- $array
if [ -z "$n" ]; then
        echo $#
else
        eval echo \$$n
fi
}
---------------------------------------

It use "," as separator. Example:

        # first=`Array a,b,c 1`
        # second=`Array a,b,c 2`
        # n=`Array a,b,c`
        # last=`Array a,b,c $n`

The choice is:

1. differents files in /etc/net, stored in /setup/cnf/store
        by the store() function (Array trick not required)
2. single /setup/cnf/net.cnf with array/tables like:

                INTERFACES="eth0,eth1,ppp0"
                NETWORKS="ip1,ip2,ip3"
                etc?

I'm still hesitating between:
                choice 1. ppp.fun, plip,fun, eth.fun ...
                choice 2. single net.fun with tables/files
                        and internal menu.

Michele

-- 
I'd like to conclude with a positive statement, but I can't 
remember any. Would two negative ones do?       -- Woody Allen
---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk


This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:15 CET