> On Sun, May 16, 1999 at 10:15:48PM +0200, Massimo Dal Zotto wrote:
> > Hi,
> > 
> > I have written a generic network interface management command, net, which
> > can be used to start/stop/show/configure network interfaces, and a smarter
> > replacement for the /etc/init.d/network script.
> > 
> > The net command makes use of configuration files stored in /etc/network/
> > which contain the various interface options. For example my eth0 is:
> > 
> >   # /etc/network/eth0
> >   IPADDR=192.168.0.1
> >   NETMASK=255.255.255.0
> >   NETWORK=192.168.0.0
> >   BROADCAST=192.168.0.255
> >   GATEWAY=192.168.0.1
> > 
> Howabout instead of having eth0, eth1, etc. have like home, work, etc.
> the files could then have an extra section, called DEVICE or something, that
> would be eth0, eth1, etc. It could also have multiple DEVICE sections, so that
> it would setup all the adapters related to that network.

Yon can already do that. Just create a file named /etc/network/home with:

  INTERFACE=eth0        # here is the trick
  IPADDR=192.168.0.1
  NETMASK=255.255.255.0
  NETWORK=192.168.0.0
  BROADCAST=192.168.0.255
  GATEWAY=192.168.0.1

and run 'net start home'. You can stop your net with with 'net stop home'
or 'net stop eth0'.

You can't however put more interfaces in one file. The script is designed to
have one config file for interface. But you could try the following trick:

  # /etc/network/x
  NOAUTO=true
  INTERFACE=eth0
  ...

  # /etc/network/y
  NOAUTO=true
  INTERFACE=eth1
  ...

  # /etc/network/multiple
  NOAUTO=true           # remove this if you want to start automatically
  INTERFACE=eth0        # not used, but should be one of x or y
  IPADDR=0.0.0.0        # not used
  NETWORK=              # no network and no pointopoint, so nothing is
  POINTOPOINT=          # started with ifconfig but net_up is called anyway
  net_up() {
        net start x y
  }
  net_down() {
        net stop x y
  }

I think it should work.

> This would be most usefull on laptops, but usefull on desktop machines too.
> I know some people take their desktop machines arround with them every once
> in awhile(I take mine to the local LUG every other month or so).  You could
> then add the ability to do like, net start home eth0, to start individual 
> parts
> of your home network, while net stop eth0 would still disable eth0.
> 
> Overall it sounds pretty good to me, something just a little better, to make
> things just a little easier.
> 

Nice, "Making things easier". This should be our slogan. Unfortunately
this is not always (not yet?) true with Linux.

-- 
Massimo Dal Zotto

+----------------------------------------------------------------------+
|  Massimo Dal Zotto               email: [EMAIL PROTECTED]               |
|  Via Marconi, 141                phone: ++39-0461534251              |
|  38057 Pergine Valsugana (TN)      www: http://www.cs.unitn.it/~dz/  |
|  Italy                             pgp: finger [EMAIL PROTECTED]  |
+----------------------------------------------------------------------+

Reply via email to