Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Dec 1998 13:17:44 -0500
From:      "Daniel M. Eischen" <eischen@vigrid.com>
To:        freebsd-questions@FreeBSD.ORG
Subject:   PPP subnetting problems
Message-ID:  <367E90C8.41C67EA6@vigrid.com>

next in thread | raw e-mail | index | archive | help
Greetings and salutations,

I'm trying to use [user] PPP to link 2 subnets.  I've got
everything working correctly except the routes on the server
side.  The PPP server box is also a router to my company's
intranet (which also gets us access to the Internet).  The
server box has 4 ethernet network interfaces (both public
and private, with NATD on the private interface).

The server box is running FreeBSD-2.8-stable from a couple
of weeks ago.  I'm using mgetty-1.1.14 to receive the incoming
call from the other subnet.  The connection comes up fine,
but I need to add routes on the server box so that we can
get to the connected [PPP client] subnet.


      PPP server router           PPP client router
          (clcrtr)                     (rebel)
    +-------------------+      +-------------------+
    |                   | ppp  |                   |
    |    192.168.1.1/24 +------+ 192.168.1.2/24    |
    |                   |      |                   | ed0
    |                   |      |    192.168.2.1/24 +-----> other systems
    |  ed0 de0 de1 de2  |      |                   |
    +---+---+---+---+---+      +-------------------+
        |   |   |   |
        |   |   |   +----> 192.168.254/24 with NATD
        |   |   |
        |   |   +--------> public address a.b.c.[0-63]/26
        |   |              (default route to company Intranet)
        |   |
        |   +------------> public address a.b.c.[128-255]/25
        |
        +----------------> public address a.b.c.[64-127]/26

Here are the relevent lines from /etc/ppp/ppp.conf on clcrtr:

  ttyd2:
   allow users [deleted]
   enable passwdauth
   set ifaddr 192.168.1.1 192.168.1.2 255.255.255.0
   add 192.168.1.0 255.255.255.0 INTERFACE
   add 192.168.2.0 255.255.255.0 INTERFACE

When the PPP connection comes up, the tun0 interface gets
configured correctly, but the routes that get added are
marked for the wrong interface (de1).

Internet:
Destination        Gateway            Flags     Refs     Use     Netif Expire
default            153.11.109.1       UGSc        6  1375056       de1
127.0.0.1          127.0.0.1          UH          1    11861       lo0
a.b.c/26           link#2             UC          0        0 
a.b.c.1            0:0:a2:9:f3:9b     UHLW        4        0       de1    589
a.b.c.64/26        link#5             UC          0        0 
a.b.c.128/25       link#1             UC          0        0 
a.b.c.129          0:c0:95:e0:31:20   UHLW        0     1766       lo0
a.b.c.131          8:0:20:77:e0:f3    UHLW        1   287722       de0    250
192.168.0.0        ff:ff:ff:ff:ff:ff  UHLWb       0       11       ed0 =>
192.168            link#5             UC          0        0 
192.168.0.254      2:60:8c:a2:d5:b3   UHLW        0       11       lo0
192.168.0.255      ff:ff:ff:ff:ff:ff  UHLWb       0        7       ed0
192.168.1          192.168.1.1        UGSc        1        1     **de1**
192.168.1.2        192.168.1.1        UH          0        0      tun0
192.168.2          192.168.1.1        UGSc        0        0     **de1**
192.168.254        link#3             UC          0        0 
192.168.254        link#3             UC          0        0 
192.168.254.10     0:80:b6:3:63:50    UHLW        0    23926       de2     39
192.168.254.121    link#3             UHLW        1      263 

The routes to networks 192.168.1.0 and 192.168.2.0 should be for
interface tun0, not de1.  If I delete the routes and manually add
them (with 'route add -net 192.168.1.0 192.168.1.1') the same thing
happens.  But if I use the -interface option:

  route add -net 192.168.1.0 192.168.1.1 -interface
  route add -net 192.168.2.0 192.168.1.1 -interface

then the routes get added correctly.

Now the question is, how do I make PPP do the same thing?  I've tried
doing this from ppp.linkup in a shell script, but it doesn't run as
root and fails trying to modify the routing table.

Any other ideas short of writing a setuid program to do this?

Thanks,

Dan Eischen
eischen@vigrid.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?367E90C8.41C67EA6>