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

Re: RFC: new network config (was: Re: network configuration)



On Sat, Feb 06, 1999 at 05:07:39PM +0000, Christian Hammers wrote:
> On Sat, Feb 06, 1999 at 04:48:28AM +1000, Anthony Towns wrote:
> > For PCMCIA netcards, you need some way of saying all this stuff,
> > and also that you don't want to do this automatically at bootup, but
> > that pcmcia-cs or something will take care of it when a card actually
> > gets inserted. Possibly a "noauto" option, as per fstab, or something
> > similar. That way pcmcia can just "mount" it later.
> what about:
> /sbin/ifconfig   	eth0	192.168.1.1 	netmask 255.255.255.0 up
> /sbin/pcmcia-cs  	eth1   	192.168.4.5 	netmask 255.255.255.0
> /sbin/what_for_dhcp	eth2	0.0.0.0		netmask 0.0.0.0

Well, in addition to this, you need some way of saying "this card is a
PCMCIA card, and will use DHCP". I'm fairly confident that the proper way
to do it is more like:

eth0	192.168.1.1	netmask 255.255.255.0	broadcast 192.168.1.0
eth1	192.168.4.5	netmask 255.255.255.0	noauto
eth2	/sbin/dhcpcd
eth3    /dbin/dhcpcd	noauto

that is:
	eth0 is started automatically by /etc/init.d/interfaces start,
	(and is therefore always in the machine), and has the above IP,
	netmask, and weird broadcast address.

	eth1 isn't started automatically, and thus has to be done by hand
	or by some other daemon, namely cardmgr (the PCMCIA daemon). When
	it comes up, the IP address is 192.168.4.5, netmask is as given,
	and broadcast is the default.

	eth2 is started automatically, and thus must always be in the
	machine, and will get (and maintain) its address by running
	/sbin/dhcpcd (the DHCP client daemon)

	eth3 will be started by some other daemon (cardmgr again), and
	will get its address by running the DHCP client also.

(in particular pcmcia-cs watches for *any* kind of card you insert,
not for a particular one. Having the netbase start a program to watch
for a hard disk being inserted isn't the right way of doing things)



Something like the above should also let you say:

eth0	192.168.1.1	netmask 255.255.255.0 ipx_net 00000010	

...or whatever other weird options you might need.



Parsing it like:

	trim non-interface options (ie, noauto)
	if address is a program
		run PROGRAM INTERFACE REMAINING_OPTIONS
	else
		run ifconfig INTERFACE ADDRESS REMAINING_OPTIONS up

...might work fairly well. Then you could have:

eth0	/sbin/dhcpcd				# standard DHCP client
eth1	/sbin/dhcpcd	-I 00:00:DE:AD:BE:EF	# pretend I've got this ID

...work without needing any wrapper scripts or anything (I think).

My only problem with making it easy to parse like this, is that it might
turn out too limiting (when we start supporting IPv6, in particular).

(I'd also stress that the theory is that when we move to IPv6 DHCPv6
clients will be the over-riding norm, not the exception)

> > Not requiring a netmask would probably be nice, and having an optional
> > broadcast address might also be nice.
> A netmask is absolutely necessary I think - and with the above way
> everything is possible :-)

The netmask is usually the default (ie 255.0.0.0 for class A, 255.255.0.0
for class B, and 255.255.255.0 for class C), so it seems a shame to have
to specify it in these cases. :-/

> > Note also that it's just plain not possible to list all routes here,
> > for clients that use DHCP and friends in particular (where the routes
> > aren't known in advance and can even change).
> You will say that using /etc/gateways is not possible ?

No, I *think* it should be okay, it's just something to note.



So, if that all made sense we have:

configuration info:
	/etc/interfaces
		IFACE	ADDRESS		OPTIONS
		IFACE	PROGRAM		ARGUMENTS

	/etc/gateways
		net ADDRESS gateway default metric 1 external

extra scripts: (to parse /etc/interfaces, mainly)
	/sbin/ifup [IFACE | -a]
		IFACE -- bring the specified interface up
		-a -- bring all not-noauto interfaces up

	/sbin/ifdown IFACE

init.d scripts:
	/etc/init.d/firewalling
	/etc/init.d/interfaces
	/etc/init.d/routing



Two questions:
	is all the "metric 1 external" "net vs host" stuff more complication
	than we really want in /etc/gateways?

	should /etc/init.d/routing and /etc/init.d/interfaces really
	be separate? PCMCIA and /etc/init.d/routing both have to
	parse /etc/gateways -- maybe this should just be incorporated
	into ifup?  If so, then this will happen automagically in
	/etc/init.d/interfaces and /etc/init.d/routing is completely
	redundant.

Cheers,
aj

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

``Like the ski resort of girls looking for husbands and husbands looking
  for girls, the situation is not as symmetrical as it might seem.''

Attachment: pgpuLco3HWec4.pgp
Description: PGP signature


Reply to: