Bug 22930

Summary: User ppp assigns wrong interface to added route
Product: Base System Reporter: greg <greg>
Component: miscAssignee: Brian Somers <brian>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description greg 2000-11-18 04:40:00 UTC
On an incoming ppp connection, ppp assigns the wrong interface name to an added network route.

This means that the new newtork can not function.

-----8<----- extract from ppp.conf

incoming:
 enable chap
 disable pap
 accept dns
 set ifaddr 10.1.7.1 10.1.7.2 255.255.255.0
 set dns 10.1.0.254
 set nbns 10.1.0.254
 # enable proxyall
 add 10.1.5.0/24 10.1.7.2  <<

------>8--------------

netstat -rn

Routing tables

Internet:
Destination        Gateway            Flags     Refs     Use     Netif Expire
default            139.130.59.129     UGSc       11     7961     ppp0
10.1/24            link#1             UC          0        0      xl0
10.1.0.17          0:d0:b7:83:f7:f2   UHLW        1    16540      xl0   1148
10.1.0.18          0:d0:b7:90:8f:2d   UHLW        0      846      xl0    600
10.1.0.251         0:60:8:cd:39:89    UHLW        2    31612      xl0   1172
10.1.0.254         0:0:4c:d1:8e:54    UHLW        0     1885      lo0
10.1.5/24          10.1.7.2           UGSc        0        4     ppp0 <<
10.1.6/24          10.1.0.251         UGSc        0    19761      xl0
10.1.7.2           10.1.7.1           UH          1        0     tun0
127.0.0.1          127.0.0.1          UH          1  1399284      lo0

The route must be deleted by hand and re-added giving:

10.1.5/24          10.1.7.2           UGSc        0        4     tun0

How-To-Repeat: 
Have one link dialed out using kernel ppp (pppd) and one link dialed in using user ppp.
Comment 1 Brian Somers 2000-11-19 02:15:32 UTC
> >Number:         22930
> >Category:       misc
> >Synopsis:       User ppp assigns wrong interface to added route
[.....]
> incoming:
>  enable chap
>  disable pap
>  accept dns
>  set ifaddr 10.1.7.1 10.1.7.2 255.255.255.0
>  set dns 10.1.0.254
>  set nbns 10.1.0.254
>  # enable proxyall
>  add 10.1.5.0/24 10.1.7.2  <<
> 
> ------>8--------------
> 
> netstat -rn
> 
> Routing tables
> 
> Internet:
> Destination        Gateway            Flags     Refs     Use     Netif Expire
> default            139.130.59.129     UGSc       11     7961     ppp0
> 10.1/24            link#1             UC          0        0      xl0
> 10.1.0.17          0:d0:b7:83:f7:f2   UHLW        1    16540      xl0   1148
> 10.1.0.18          0:d0:b7:90:8f:2d   UHLW        0      846      xl0    600
> 10.1.0.251         0:60:8:cd:39:89    UHLW        2    31612      xl0   1172
> 10.1.0.254         0:0:4c:d1:8e:54    UHLW        0     1885      lo0
> 10.1.5/24          10.1.7.2           UGSc        0        4     ppp0 <<
> 10.1.6/24          10.1.0.251         UGSc        0    19761      xl0
> 10.1.7.2           10.1.7.1           UH          1        0     tun0
> 127.0.0.1          127.0.0.1          UH          1  1399284      lo0
> 
> The route must be deleted by hand and re-added giving:
> 
> 10.1.5/24          10.1.7.2           UGSc        0        4     tun0

This is happening due to a mis-configuration.

If you put a hard-coded ``add'' line (ie, one without HISADDR in it), 
ppp simply runs it.

You can probably get away with changing your add line to

  add 10.1.5.0/24 HISADDR

so that ppp re-adjusts the route when the interface address changes, 
or alternatively (and more correctly), put the above line (with 
HISADDR) in ppp.linkup so that it's added *after* the interface has 
been negotiated and set up.
-- 
Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !
Comment 2 Brian Somers freebsd_committer freebsd_triage 2000-11-19 02:18:34 UTC
Responsible Changed
From-To: freebsd-bugs->brian

ppp's mine.  A followup is on it's way
Comment 3 Brian Somers freebsd_committer freebsd_triage 2000-11-19 02:23:49 UTC
State Changed
From-To: open->closed

This is a configuration error
Comment 4 greg 2000-11-19 14:59:58 UTC
Thanks Brian! :))

Maybe someone should change the 'man' page for ppp.

I had a problem with the man page!

It said :- it is possible to use HISADDR, MYADDR .... It does not say that
the link will be given a random interface name if you DO NOT use HISADDR. Or
say it is
important that you use HISADDR for new incoming IP addresses............just
traps for newbies I suppose :)

It also does not help when you read the 'man' examples of 'add' like
this....

------- start ppp man entract
>
>The entry in /etc/ppp/ppp.conf on awfulhak (the initiator) >should contain
the following:
>
>           ui-gate:
>            set escape 0xff
>            set device ui-gate:ppp-in/tcp
>            set dial
>            set timeout 30
>            set log Phase Chat Connect hdlc LCP IPCP CCP tun
>            set ifaddr 10.0.4.2 10.0.4.1
>            add 10.0.2.0/24 10.0.4.1   <<

---- END ppp man extract

Maybe this should read "add 10.0.2.0/24 HISADDR" instead.

Many thanks again, Brian!

Greg


:)

----- Original Message -----
From: "Brian Somers" <brian@Awfulhak.org>
To: <greg@macquarrie.com.au>
Cc: <freebsd-gnats-submit@FreeBSD.ORG>; <brian@Awfulhak.org>
Sent: Sunday, November 19, 2000 1:15 PM
Subject: Re: misc/22930: User ppp assigns wrong interface to added route


> > >Number:         22930
> > >Category:       misc
> > >Synopsis:       User ppp assigns wrong interface to added route
> [.....]
> > incoming:
> >  enable chap
> >  disable pap
> >  accept dns
> >  set ifaddr 10.1.7.1 10.1.7.2 255.255.255.0
> >  set dns 10.1.0.254
> >  set nbns 10.1.0.254
> >  # enable proxyall
> >  add 10.1.5.0/24 10.1.7.2  <<
> >
> > ------>8--------------
> >
> > netstat -rn
> >
> > Routing tables
> >
> > Internet:
> > Destination        Gateway            Flags     Refs     Use     Netif
Expire
> > default            139.130.59.129     UGSc       11     7961     ppp0
> > 10.1/24            link#1             UC          0        0      xl0
> > 10.1.0.17          0:d0:b7:83:f7:f2   UHLW        1    16540      xl0
1148
> > 10.1.0.18          0:d0:b7:90:8f:2d   UHLW        0      846      xl0
600
> > 10.1.0.251         0:60:8:cd:39:89    UHLW        2    31612      xl0
1172
> > 10.1.0.254         0:0:4c:d1:8e:54    UHLW        0     1885      lo0
> > 10.1.5/24          10.1.7.2           UGSc        0        4     ppp0 <<
> > 10.1.6/24          10.1.0.251         UGSc        0    19761      xl0
> > 10.1.7.2           10.1.7.1           UH          1        0     tun0
> > 127.0.0.1          127.0.0.1          UH          1  1399284      lo0
> >
> > The route must be deleted by hand and re-added giving:
> >
> > 10.1.5/24          10.1.7.2           UGSc        0        4     tun0
>
> This is happening due to a mis-configuration.
>
> If you put a hard-coded ``add'' line (ie, one without HISADDR in it),
> ppp simply runs it.
>
> You can probably get away with changing your add line to
>
>   add 10.1.5.0/24 HISADDR
>
> so that ppp re-adjusts the route when the interface address changes,
> or alternatively (and more correctly), put the above line (with
> HISADDR) in ppp.linkup so that it's added *after* the interface has
> been negotiated and set up.
> --
> Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
>       <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
> Don't _EVER_ lose your sense of humour !
>
>
>
Comment 5 Brian Somers 2000-11-19 17:01:24 UTC
> It also does not help when you read the 'man' examples of 'add' like
> this....

Ah, yes, this stuff is a bit wrong :-I  I've made some modifications. 
Please let me know if they don't make sense.

Cheers.

-- 
Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !