From owner-freebsd-net@FreeBSD.ORG Wed Mar 9 20:49:17 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D564E106564A for ; Wed, 9 Mar 2011 20:49:17 +0000 (UTC) (envelope-from melissa-freebsd@littlebluecar.co.uk) Received: from filter.blacknosugar.com (filter.blacknosugar.com [212.13.204.214]) by mx1.freebsd.org (Postfix) with ESMTP id 495C58FC13 for ; Wed, 9 Mar 2011 20:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=littlebluecar.co.uk; s=dkim; h=Subject:To:References:Message-Id:Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Content-Type:Mime-Version; bh=uVuImmkUmlAcVAhOYy/1JLBs3lfEX9LcFcqvXDnRCdI=; b=CYjv34JxvsqBcUBRtBygj/zPHJ9TXFzo+mkjsM6Kps04bqIHLKjAMNGBnQq4GDY6XC1j1iwkZwPFDQsNSyjFGLrGJsu3PzZAqM0FBDs4hSTlPfggGyb2gokG1Rq4QvWN; Received: from bowser.blacknosugar.com ([78.86.203.16] helo=[192.168.1.59]) by filter.blacknosugar.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.74 (FreeBSD)) (envelope-from ) id 1PxPis-000Dxl-Lv; Wed, 09 Mar 2011 20:11:09 +0000 Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Melissa Jenkins In-Reply-To: Date: Wed, 9 Mar 2011 20:11:00 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <63A5C79A-B4C3-42C3-9B76-1F2EB04DB871@littlebluecar.co.uk><01EE1F52-3393-4A43-882F-C35677CB0754@gmail.com> To: freebsd-net@freebsd.org X-Mailer: Apple Mail (2.1082) X-SA-Exim-Connect-IP: 78.86.203.16 X-SA-Exim-Mail-From: melissa-freebsd@littlebluecar.co.uk X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on filter X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on filter.blacknosugar.com) Cc: Qing Li Subject: Re: PPP and Route Delete 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, 09 Mar 2011 20:49:18 -0000 > The self-pointing route 10.0.5.1 should have multiple references set = on > it, and that route won't be deleted from the routing table until the=20= > last reference is removed. >=20 > You can verify that by checking the "netstat" output, the "Ref" column > after tun1 has been created. Unfortunately PPP doesn't increase the reference count: After connecting 1 VPN: Destination Gateway Flags Refs Use Netif = Expire 10.0.5.1 link#12 UHS 0 0 lo0 After connecting the second VPN: Destination Gateway Flags Refs Use Netif = Expire 10.0.5.1 link#12 UHS 1 0 lo0 When you disconnect the second VPN all the routes pointing to 10.0.5.1 = are removed. If I add 10.0.5.1 as an proper alias to an interface (eg loopback) it = seems to work as you would expect and disconnecting one VPN doesn't = disconnect all the rest. >> I've been working on migrating a PPTP server from FreeBSD 7.1 to = FreeBSD 8.1. The server is configured using PopTop (from ports) and PPP = (/usr/sbin) rather than MPD. (Before anybody tells me to use MPD we = can't because it doesn't inject packets into the kernel in the same way = and it's not possible to filter on them correctly) >>=20 >> Basic PPTP connection works properly.=20 >>=20 >> The fun happens when I have two simultaneous users. The first one to = DISCONNECT deletes the routes for both of them and all PPTP traffic = ceases. >=20 > Just been working my way through the PPP code - which doesn't actually = appear to have changed. >=20 > However, the netinet/in.c does have some comments in the SVN history = about deleting the loopback address, this appears to have been merged in = as part of the 8 release cycle (r197231 perhaps) (though I'm not an = expert at SVN etc) >=20 > What should happen when there are multiple interfaces with the same = address. When I have two tunnels configured they show up as (eg) >=20 > tun0: flags=3D8051 metric 0 mtu 1398 > options=3D80000 > inet 10.0.5.1 --> 10.0.0.31 netmask 0xffffffff > Opened by PID 12616 >=20 > tun1: flags=3D8051 metric 0 mtu 1398 > options=3D80000 > inet 10.0.5.1 --> 10.0.0.32 netmask 0xffffffff > Opened by PID 12630 >=20 > If the loop back address is 10.0.5.1 and closing one of them deletes = the loopback what should happen? Should it delete all routes that refer = to 10.0.5.1?