From owner-freebsd-current@FreeBSD.ORG Tue Jul 29 04:51:08 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 542EE37B401 for ; Tue, 29 Jul 2003 04:51:08 -0700 (PDT) Received: from happygiraffe.net (happygiraffe.net [81.6.215.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id A985943F85 for ; Tue, 29 Jul 2003 04:51:07 -0700 (PDT) (envelope-from dom@happygiraffe.net) Received: by happygiraffe.net (Postfix, from userid 1001) id 449EA5C7A; Tue, 29 Jul 2003 12:51:06 +0100 (BST) Date: Tue, 29 Jul 2003 12:51:06 +0100 To: Martin Blapp Message-ID: <20030729115106.GA45515@ppe.happygiraffe.net> References: <20030729094308.L41136@cvs.imp.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030729094308.L41136@cvs.imp.ch> User-Agent: Mutt/1.4.1i From: dom@happygiraffe.net (Dominic Mitchell) cc: current@freebsd.org Subject: Re: STEP 2, fixing dhclient behaviour with multiple interfaces X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2003 11:51:08 -0000 On Tue, Jul 29, 2003 at 09:56:48AM +0200, Martin Blapp wrote: > I't is my goal to make dhclient really functional, so it can not only > be used with one interface, but several. Yay! This bites me badly on my laptop with a permanent fxp0 and a sometimes-present wi0. > On a well known OS this works just fine. A first interface gets > initialized and the GW gets set as usual. But if a second interface > gets added, and the first one is still active and has a working lease, > the GW will not be overwriten. If you remove now the first interface, > the default GW changes to the one of the second interface. > > "X" = Link on IF > "+" = Interface gets added or has new link > "-" = Interface gets removed or lost link > > IF1 IF2 GW1 GW2 > --------------- > X X > X + X > - X X > + X X > > Too this functionality to dhclient, there is only one way to do it. the > ISC-dhclient package offers a OMAPI Command Shell omsshell(1). There you > can add new interfaces or even remove existing ones. > > The work that needs to be done is: > > - Adding a unix domain socket to OMAPI, so root (or a choosen user) > can access dhclient (or dhcpd) on the local machine without authentification. You can get omshell working without auth over tcp/ip - I managed this today when playing. But a unix domain socket would be nicer because the dhclient server binds to INADDR_ANY by default. > - Providing the omshell scripts for adding and removing interfaces, adding > new default gateways on interface removal etc ... > > - Change our infrastructure (devd, rc.d/dhclient script) to use them. > > If there are other ideas, I'm open to them. At present, dhclient gets given a list of interfaces at startup-time. Would it be better to start it in "no-interfaces" mode (-n -w) and dynamically add /all/ interfaces using omshell? Another (loosely related) thing is that we should be able to use omshell to tell dhclient to pause before going into suspend. This is hinted at in the dhclient man page, but it would be good to get it into the standard infrastructure. -Dom