From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-dev-return-1933-arch-gentoo-dev=gentoo.org@gentoo.org> Received: (qmail 21545 invoked by uid 1002); 19 Mar 2003 17:15:19 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: <mailto:gentoo-dev@gentoo.org> List-Help: <mailto:gentoo-dev-help@gentoo.org> List-Unsubscribe: <mailto:gentoo-dev-unsubscribe@gentoo.org> List-Subscribe: <mailto:gentoo-dev-subscribe@gentoo.org> List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org> X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 1917 invoked from network); 19 Mar 2003 17:15:18 -0000 Date: Wed, 19 Mar 2003 18:16:25 +0100 (CET) From: Wout Mertens <wmertens@cisco.com> To: gentoo-dev@gentoo.org Message-ID: <Pine.GSO.4.53.0303191815490.15485@oaktree.cisco.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [gentoo-dev] net.eth0 X-Archives-Salt: 54f0da6d-4719-42a1-8f33-2e901c54d54f X-Archives-Hash: c2ff6e5c5888a7589189ca2641752eae Argh, wrong again :( ---------- Forwarded message ---------- Date: Wed, 19 Mar 2003 16:47:07 +0100 (CET) From: Wout Mertens <wmertens@gentoo.org> To: gentoo-dev@gentoo.com Cc: Joseph Carter <knghtbrd@efn.org>, Frederick Reeve <frederick@woodland-i.org>, Alain Penders <alain@gentoo.org>, Martin Schlemmer <azarah@gentoo.org> Subject: Re: [gentoo-dev] net.eth0 (People in Cc: Sorry for the repost, I used the wrong email-address) On Tue, 18 Mar 2003, Martin Schlemmer wrote: > On Mon, 17 Mar 2003 16:35:30 +0100 (CET) > Wout Mertens <wmertens@gentoo.org> wrote: > > > I guess Azarah could add support for a /etc/net.d/ directory with > > scripts that are called with the arguments <interface> <state>. Or > > something along those lines. I know I would like something that > > reconfigures my wwwoffle for the current network automatically. > > I have been thinking about this in the past (think there is a bug > about ipv6 that I suggested that we make it much more modular), > but I have been too busy, and I do not want to rush it and do > an half backed job that have to be redone/bandaged at some stage > in the future again. Well, maybe we can kick off a conversation? Some issues: - Some people have static networks. It would be nice if there was a set way to detect and configure those. They can always hand-roll their own network scripts, but those will not be the same quality that we all can do. - Some services bind on specific interfaces, and need to be notified when one comes up. (apache, squid, ...) - Some services only need to know if there is network connectivity or not, and they need to be notified when the first interface comes up and the last interface goes down (ntp daemons, wwwoffle, ...) - Some services would like to know when the ip address changes (dynamic dns, etc) - There is currently no fixed way to setup your wireless interfaces. They have extra parameters that can be set by iwconfig (wireless-tools), which needs to be done before dhcpcd is called. A simple matter of adding iwconfig_${IFACE}, I think. - At my company, we use LEAP authentication for wireless. This is a proprietary extension, but it's used by thousands of people. I'm not claiming that they are all using gentoo, but it would be cool to have support for this. How I do it, I first let dhcpcd fail, then set up the card for LEAP, run interactive authentication (xterm for the console user), and if it succeeded, run dhcpcd again. - Some people want to use a different dhcp client - Some interfaces have media detection. These could be automatically brought up when a cable is inserted. (See sys-apps/ifplugd) So here is a modular approach: - To bring an interface up, try a list of "activation" scripts that try to bring it up and test the outcome. Examples: a list of ips with an ip that should be active when up, dhcpcd, pump, leap-auth+dhcp, ... . The user chooses the order by setting up a net/activate.d directory, and several standard scripts are included (and they get info from /etc/conf.d/net). Scripts that just set up interfaces, like iwconfig, always fail after doing their stuff. These scripts also provide the command that needs to be run to shut down the interface again. This could be the script itself with different parameters. - Any time networking parameters change, scripts in a net/event.d get called in order. They get the following parameters: - interface that changed - What happened to it: up, down, ipchange, linkup, linkdown - ip address of that interface - the "global" networking state: netup, netdown, netsame. This is for scripts that only care about the networking state and not about interfaces. If possible, the dhcp clients should also call these scripts when the ip address changed. Ifplugd could notify these script that the link went down, but wait a little while before actually bringing the interface down. This could be used to set wwwoffled or chronyd in offline mode without impacting running tcp connections. And when the link goes up again before the interface is brought down, this could be used to kick dhcpcd to verify the lease (dhcpcd -n). A similar, and maybe cleaner approach would not use directories but just strings with functions/scripts to be called, defined in /etc/conf.d/net. (The rest stays the same) Something like activate_eth0="dhcp static" activate_eth1="iwconfig static dhcp leap" activate_ppp0="ppp" # Extra parameters in net.ppp0 events_eth0="apache" events_ppp0="dyndns" events_global="wwwoffled chronyd" What do you think? I think this would be able to take all the things I tried to do over the last few years :) We could start prototyping something in a separate ebuild, sys-apps/gentoo-net or something, and when it is stable, merge it back in baselayout. Comments? Wout. -- gentoo-dev@gentoo.org mailing list