From owner-freebsd-hackers Mon Sep 8 16:07:16 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA12913 for hackers-outgoing; Mon, 8 Sep 1997 16:07:16 -0700 (PDT) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA12899 for ; Mon, 8 Sep 1997 16:07:11 -0700 (PDT) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id QAA15601; Mon, 8 Sep 1997 16:06:40 -0700 (PDT) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma015599; Mon Sep 8 16:06:21 1997 Received: (from archie@localhost) by bubba.whistle.com (8.8.5/8.6.12) id QAA05241; Mon, 8 Sep 1997 16:06:21 -0700 (PDT) From: Archie Cobbs Message-Id: <199709082306.QAA05241@bubba.whistle.com> Subject: Re: Divert sockets.. In-Reply-To: <199709080045.KAA00615@word.smith.net.au> from Mike Smith at "Sep 8, 97 10:45:18 am" To: mike@smith.net.au (Mike Smith) Date: Mon, 8 Sep 1997 16:06:20 -0700 (PDT) Cc: doconnor@Ist.flinders.edu.au, freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > I was wondering if its possible to write a program which would do > > 'dial on demand', by grabbing packets, and seeing if they are destined > > to go out of the system, and if so, run a script(which would cause a > > dialup). > > You could hang something off a divert socket to do this. IMHO, the proper way to do this is to let the PPP daemon handle it by installing a route first (so you let the routing code determine whether packets are supposed to go over the WAN link or not, as it should) and then checking each outgoing packet for suitability as "demand" (not all are, e.g., NTP packets). When "demand" is seen, it should start dialing, etc. The same "demand" test can also apply to idle timeout calculations. This is how mpd does it, anyway. > > I know ijppp can do this, but I have problems with ijppp =) > > Fix your problems. 8) Or use mpd instead :-) > > The only problem I can see is that since a default route wouldn't be > > established yet(since you aren't dialed up), the packets would be > > killed off before they pass through a divert socket.(I don't know much > > about how that stuff works :) This problem goes away if you do as described above. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com