/usr/sbin/ppp doubling connections on tun0

Fbsd8 fbsd8 at a1poweruser.com
Tue Nov 20 13:48:34 UTC 2012


andrew clarke wrote:
> I'm using /usr/sbin/ppp for PPPoE over an ADSL modem in bridged mode:
> 
> # ifconfig tun0
> tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1492
>         options=80000<LINKSTATE>
>         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 at 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<UP,POINTOPOINT,RUNNING,NOARP,SIMPLEX,MULTICAST> metric 0 mtu 1492
>         inet 124.170.51.116 --> 203.215.7.251 netmask 0xffffffff 
> 
> Regards
> Andrew
> 
>

Add these statements to your ppp.conf file


  disable iface-alias    # Stop adding old IP address as alias
                         # when ppp redials because line was
                         # lost. These old IPs showed using
                         # ifconfig -a on tun0.

iface clear             # Remove all previous IP addresses






More information about the freebsd-questions mailing list