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

Re: Networking, /etc/network/interfaces, mapping, iface, and multiple configurations



On Wed, Feb 07, 2001 at 03:43:39AM -0800, kmself@ix.netcom.com wrote:
> Question regarding use of /etc/network/interfaces to allow autmajick
> detection and configuration of eth0 on a laptop that wanders widely.
> 
> What I'd like is for the beast to configure itself to:
> 
>   - Standalone operation
>   - Static assignment (home)
>   - Other arbitrary static assignment (TBD)
>   - DHCP (various)
> 
> ...but I can't quite get the swing of it.
> 
> What's really blowing it for me is trying to figure out what the
> 'script' part of the networking configuration does.  What I'd like are
> some pointers to some solid docs on this, /usr/share/doc/ifupdown
> examples don't quite do the trick.

Well, the problem with that is that there aren't any solid docs on it...

Basically, the idea is that the "script" can do basically anything to
determine what mode you're meant to be in. I have it basically:

	for each place it could be:
		configure the network as though it is there
		try pinging a host that should be on that network
		if you get a response:
			we know where we are
	otherwise:
		no idea where we are, don't configure anything

But you could also do it based on GPS coordinates if you have a GPS, or
something else.

The API is basically that you get the interface (eth0) as $1, and you get
the "map" lines (without the word "map") in standard input, and you just have
to echo the name of the logical interface you want on standard output when
you're done (or exit 1 if you give up).

Dunno if that helps.

Cheers,
aj

-- 
Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. GPG signed mail preferred.

``_Any_ increase in interface difficulty, in exchange for a benefit you
  do not understand, cannot perceive, or don't care about, is too much.''
                      -- John S. Novak, III (The Humblest Man on the Net)



Reply to: