From owner-freebsd-net@FreeBSD.ORG Wed Jul 26 14:12:34 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B3E6816A4DA; Wed, 26 Jul 2006 14:12:34 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7223343D58; Wed, 26 Jul 2006 14:12:34 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id k6QECXbs096425; Wed, 26 Jul 2006 07:12:33 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id k6QECWWK096424; Wed, 26 Jul 2006 07:12:32 -0700 (PDT) (envelope-from rizzo) Date: Wed, 26 Jul 2006 07:12:32 -0700 From: Luigi Rizzo To: net@freebsd.org Message-ID: <20060726071232.A96367@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Cc: Subject: multiple DSL modems and pppoe sessions on the same ethernet ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jul 2006 14:12:34 -0000 hi, i am trying to run, on a single FreeBSD box, multiple (3 in my case) pppoe instances talking to as many DSL modems on the same ethernet cable ------+--------------+--------------+--------------+----- | | | | +-[modem1] +-[modem2] +-[modem3] +-[FreeBSD/ppp] DSL#1 DSL#2 DSL#3 Ideally, in /etc/ppp/ppp.conf i can write something like modem1: set device PPPoE:rl0:dsl1 ... modem2: set device PPPoE:rl0:dsl2 ... modem3: set device PPPoE:rl0:dsl3 ... and the PPPoE spec (RFC2516) says this should work as long as each DSL line has a different 'service name' (tag 0x101 in the packet). The problem is, my provider does not provide specific service names, but it will accept anything i supply. So when i run the three ppp instances, they will all match, and the code in ng_pppoe.c will happily take the first reply as good. The only approach left is then implement some form of MAC filtering, e.g. overloading the 'service name' to specify the mac address of the modem i am interested in. There is a couple of ways to implement this, one is patching the receive path (ng_pppoe_rcvdata(), case PADO_CODE) to filter replies based on the source mac address, and the other one is to patch the code transmitting the PADI packet to replace the broadcast dst address with the unicast MAC taken from the "service name". Any better ideas ? cheers luigi