Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Aug 1995 13:45:03 -0700
From:      Stephen Melvin <melvin@zytek.com>
To:        freebsd-questions@freefall.freebsd.org
Subject:   Using FreeBSD as a PPP Server
Message-ID:  <199508262045.NAA08859@syzygy.zytek.com>

next in thread | raw e-mail | index | archive | help
Hello,

Finally I have gotten server-side PPP working on 2.0.5.  The ppp man page
and FAQ is a little sparse on this topic.  The biggest suggestion I have for
the man page is make it clear that you need "options GATEWAY" in your kernel
for this to work.  This would have saved me some aggravation.  In any case,
here is my PPP-server mini-FAQ.  (I apologize in advance if the information
below is not particularly useful or duplicates other info).

Steve Melvin
melvin@zytek.com

-----
HOW DO I SET UP A PPP SERVER?

The following instructions relate to a situation such as the following, it
may not be appropriate for other situations.

                      -----------
Internet <---------> |  FreeBSD  | <---ttyd0---> (modem) <---> PPP user
                     |   2.0.5   | <---ttyd1---> (modem) <---> PPP user
                     |           | <---ttyd2---> (modem) <---> PPP user
                     |           | <---ttyd3---> (modem) <---> PPP user
                      -----------

1. Generate a kernel with "options GATEWAY".

2. Use "vipw" to add users, by convention the first letter being a 'P'.
   The last entry on the line should be /usr/local/bin/ppplogin.

3. For best results, make sure /dev/tty's are using hardware handshake.
   The easiest way to so this is add the line:
-------
modem 0 1 2 3
-------
   to the end of the file /etc/rc.serial.  Then type "sh /etc/rc.serial"
   as root.  Update the /etc/ttys file as described in the ppp manual
   page.

4. Create the file /etc/ppp/ppp.conf with an entry for each
   dial in line.  I have assumed that you are able to pre-allocate
   one IP address for each dial in line.  In this case each user
   will get a dynamically assigned address depending on which
   line they dial in on.  In this example the FreeBSD box is 140.174.241.1
   and the dial in lines are 140.174.241.17 - 140.174.241.20.

-------
#################################################################
#
#  	PPP  Configuration File
#
#################################################################
#
#
ttyd0:
 set ifaddr 140.174.241.1 140.174.241.17 255.255.255.255
#
ttyd1:
 set ifaddr 140.174.241.1 140.174.241.18 255.255.255.255
#
ttyd2:
 set ifaddr 140.174.241.1 140.174.241.19 255.255.255.255
#
ttyd3:
 set ifaddr 140.174.241.1 140.174.241.20 255.255.255.255
-------

5. Create an empty file /etc/ppp/ppp.linkup (just so it won't complain), or
   if you need that file for other reasons, add the four "ttyd<n>"
   labels with nothing after them.

6. Create the file /usr/local/bin/ppplogin as follows:
-------
#!/bin/csh
#
set tty=`tty | sed "s/\/dev\///"`
/usr/sbin/ppp -direct $tty
-------

7. Update the name server.  If you are maintaining a name server for the block of
   addresses, you should update the reverse entries so that the IP addresses above
   resolve to names and vice versa.  Some remote sites insist on this before they
   will let anyone do anything.

8. You will have to update whatever router is upstream to use the FreeBSD box as
   a gateway for the four PPP addresses.  In the above example, the following
   command can be used to update the router:
-------
route add 140.174.241.16/29 en0 140.174.241.1
-------
   or whatever the appropriate syntax is.  This defines a 3-bit subnet for the
   dial-in lines and routes packets to those addresses through the FreeBSD
   machine.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508262045.NAA08859>