From owner-freebsd-net Sat Nov 3 13:53:38 2001 Delivered-To: freebsd-net@freebsd.org Received: from Awfulhak.org (gw.Awfulhak.org [217.204.245.18]) by hub.freebsd.org (Postfix) with ESMTP id 1966737B417 for ; Sat, 3 Nov 2001 13:53:31 -0800 (PST) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [fec0::1:12]) by Awfulhak.org (8.11.6/8.11.6) with ESMTP id fA3LrKH07272; Sat, 3 Nov 2001 21:53:20 GMT (envelope-from brian@freebsd-services.com) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.6/8.11.6) with ESMTP id fA3LrG813154; Sat, 3 Nov 2001 21:53:16 GMT (envelope-from brian@freebsd-services.com) Message-Id: <200111032153.fA3LrG813154@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Federico Quevedo Cc: freebsd-net@FreeBSD.ORG, Julian Elischer , brian@freebsd-services.com Subject: Re: ng_pppoe accounting? In-Reply-To: Message from Federico Quevedo of "Wed, 31 Oct 2001 04:40:59 +0100." <3BDF72CB.77B15F5C@cuimail.unige.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Date: Sat, 03 Nov 2001 21:53:16 +0000 From: Brian Somers Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I've just implemented a ``log'' command in ppp. You can now do something like ``log ${MACADDR} HISADDR USER UPTIME'' = to your ppp.linkdown. The only missing bit is getting pppoed to put $MACADDR into ppp's = environment.... > Julian Elischer wrote: > = > > On Tue, 30 Oct 2001, QUEVEDO BUSTILLOS Jose Federico wrote: > > > > > Hi, > > > > > > I'm a newbie in netgraph structures and I will like to ask your adv= ice > > > about some PPPoE related ideas. > > > > > > I'm using a FreeBDS box with PPPoE installed and working as a gatew= ay. My > > > goal is to establish basic administration and accounting for PPPoE = users. > > > > > > > You are using pppoed to offer pppoe service? > = > I'm thinking of using pppoed as a server that offers connection to inte= rnal > network boxes (essentially laptops) that want to establish an Internet = connexion > acces. > = > = > Lab > University Network > = > -------=A6 > =A6--------- > internal network =A6 ----------- FreeBSD box ---------------=A6= Internet > = > pppoe clients ------=A6 > (pppoed) =A6-------- > = > = > = > > > The basic accounting needs (not with commercial goals) are: > > > > As a server or as a client? > > > > > > > > 1. Keep track of the MAC addresses and users names of the PPPoE > > > connections to the gateway, store time connection of the session an= d > > > traffic generated. > > > > Is this the kind of logging you want? > > (I don't have this.. I did it by hand) > > > > 13:23:20 2001-10-29 00:23:33:01:23:54 julian 192.168.1.1 > > 13:24:30 2001-10-29 00:01:43:11:45:78 bob 192.168.1.3 > > 13:25:11 2001-10-29 00:23:33:76:2:24 paul 192.168.1.5 > > 13:35:10 2001-10-29 00:23:33:01:23:54 *close* 12334354 in 32412344 = out > > ... > = > Is exactly what I would like to generate! > = > > The ppp daemon could do this if it knew the associated link and could= > > retrieve the MAC address associated with it. > > > > there are several roadblocks.. > > 1/the ppp daemon doesn't keep a control socket associated with the > > connection so it can't inquire about the MAC address. > = > I was thinking to give pppoed (during the discovery phase) the possibil= ity to > select the IP from a pool of IP address (the same as ppp does - FreeBS= D pppd > does?), match it with MAC address of client that is well known at this= stage > and generate this part of our supposed loggin file: > = > Time_of_starting_connection MAC_address IP_address > 13:23:20 00:23:33:01:23:54 19= 2.168.1.1 > = > 13:24:30 00:01:43:11:45:78 19= 2.168.1.3 > = > Then, the call message to ppp could be: > = > exec /usr/sbin/ppp -direct -set ifaddr "localhost_ip" "IP_assigned_by_p= ppoed" > = > and the log file already generated could be used by ppp to retrive MAC > address.....??? > = > > 2/ If it were to try create a new control socket, it could not connec= t it > > to the existing data socket. > > > > It may be possible that the ppp daemon might know the netgraph node n= ame > > for the data socket node, in which case it could get the information > > requested. > > This would require an answer from Brian > > > > > 2. Dynamic assignation of IP address. (I think on two possibilities= a) > > > PPPoE assignation: when PADR arrives, the gw should look into a poo= l of IP > > > adresses and assign one "before calling PPP". B) leave PPP the assi= gnation > > > and capture the IP in other way). > > > > I think you need to leave it to ppp. > > but maybe ppp can become aware of teh MAc address. > > > > > > > > Result: A log file produced with a session match of: > > > > > > MAC add - IP add - username - time of session. > > > > > > Should I touch the ng_pppoe code? or should I create a netgraph nod= e to > > > place between ng_node and ng_ppp? > > > Am I on the good way > > > > Probably not good to touch the pppoe code.. > > until you discuss it with Brian. > > Then when you can agree on what needs to be changed we can change it.= > > the ppp code needs to be in charge.. > = > Thanks, > = > Federico > = > > > > > > > > Thanks in advance, > > > > > > Federico Quevedo > > > > > > ................................................................. > > > Federico Quevedo [.....] -- = Brian http://www.freebsd-services.com/ Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message