From owner-freebsd-questions@FreeBSD.ORG Tue Nov 20 00:49:52 2012 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F09E307 for ; Tue, 20 Nov 2012 00:49:52 +0000 (UTC) (envelope-from mail@ozzmosis.com) Received: from icp-osb-irony-out5.external.iinet.net.au (icp-osb-irony-out5.external.iinet.net.au [203.59.1.221]) by mx1.freebsd.org (Postfix) with ESMTP id E6F498FC14 for ; Tue, 20 Nov 2012 00:49:51 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhIFAFPTqlB8qjN0/2dsb2JhbABFhTe9G4EIgkwTZyEBKxgxE4gMnmeREJA2jDQngTsBgklhA5V7hVk1ijaDA4FJ X-IronPort-AV: E=Sophos;i="4.83,282,1352044800"; d="scan'208";a="61186930" Received: from unknown (HELO smtp.phoenix) ([124.170.51.116]) by icp-osb-irony-out5.iinet.net.au with ESMTP; 20 Nov 2012 08:49:39 +0800 Received: by smtp.phoenix (Postfix, from userid 1001) id 1D48135F; Tue, 20 Nov 2012 11:49:39 +1100 (EST) Date: Tue, 20 Nov 2012 11:49:39 +1100 From: andrew clarke To: FreeBSD questions Subject: /usr/sbin/ppp doubling connections on tun0 Message-ID: <20121120004938.GA86793@ozzmosis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2012 00:49:52 -0000 I'm using /usr/sbin/ppp for PPPoE over an ADSL modem in bridged mode: # ifconfig tun0 tun0: flags=8051 metric 0 mtu 1492 options=80000 inet 203.217.27.170 --> 203.215.15.252 netmask 0xffffffff inet 203.214.46.107 --> 203.215.7.251 netmask 0xffffffff Opened by PID 49158 What would cause this? Notice the two IP addresses assigned to the same interface. It should just have one address assigned. Something causes the initial PPPoE session to stop, then another to restart without properly closing the previous PPPoE session. I'm not sure when this started happening but I've noticed it's become more frequent in the past few weeks. One theory I have is that it may have begun after I upgraded FreeBSD from 8.2 to 8.3 a few months back. I suppose concurrent PPPoE sessions aren't the end of the world, but obviously it makes no sense to have two on the same interface, so I'd like to prevent that. (Strictly speaking they aren't concurrent as the previously allocated IP [203.217.27.170 in the case above] no longer responds to pings, etc. It's dead, Jim.) The multiple IP addresses also causes /usr/ports/dns/ddclient to get confused and not tell DynDNS when a new IP address has been assigned, although perhaps that's a bug (sort of) in ddclient. I notice FreeBSD PR 151400 mentions: "The patch also makes a small change to how ppp(8) destroys interfaces at exit. Instead of just dealiasing interfaces and leaving them behind, they are now destroyed in the same manner "ifconfig destroy" works." I wonder if that's the cause? If I get a chance I'll try building a local copy of /usr/sbin/ppp with the patch reverted and test that, although it can be a difficult problem to replicate. Plus of course the patch doesn't explain the initial disconnections. I suspect that's an issue unrelated to /usr/sbin/ppp though. # cat /etc/ppp/ppp.conf default: set log phase chat lcp ipcp ccp tun command lqm set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 nat enable yes disable lqr disable ipv6cp set echoperiod 30 enable echo iinet: set device PPPoE:bge0 set authname secret set authkey secret set dial set login set mru 1492 set mtu 1492 set redial 15 0 add default HISADDR # grep ppp /etc/rc.conf ppp_enable="YES" ppp_mode="ddial" ppp_nat="YES" ppp_profile="iinet" # uname -a FreeBSD blizzard.phoenix 8.3-RELEASE-p3 FreeBSD 8.3-RELEASE-p3 #0: Tue Jun 12 00:39:29 UTC 2012 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 In the meantime I've switched to using mpd5 (/usr/ports/net/mpd5) and /sbin/ipnat. So far, so good: # ifconfig ng0 ng0: flags=88d1 metric 0 mtu 1492 inet 124.170.51.116 --> 203.215.7.251 netmask 0xffffffff Regards Andrew