[pptp-server] 2.2.16 + mppe patch + ppp-2.3.11 HOWTO (working one this time)

Vanja Hrustic vanja at relaygroup.com
Sun Jun 11 14:52:31 CDT 2000


Hi!

I've setup the PoPToP on 2.2.16 kernel again, and this time I've checked
that it works properly, even after few reboots.

I've made the small 'howto', and I hope it is ok this time. Basically,
there is no much difference between this one and the 'official' RedHat
HOWTO, except the fact that you need to copy 2 files from ppp-2.3.11
distribution manually.

But here it is anyway.

Some changes to ppp driver have been introduced with kernel 2.2.15, and
there is a chance that following directions from this 'howto' might
break some things. It works fine for me though.

It is also available at http://www.vanja.com/PPTP.txt

Any comments or suggestions are more than welcome.

Thanks.

--

---------------------------------------------------------------
Any comments/suggestions should be sent to vanja at relaygroup.com
---------------------------------------------------------------

WARNING:

This setup was tested on RedHat 6.1 boxes only. Also, some changes in
ppp driver have been made in Kernel 2.2.15 (as opposed to 2.2.14 and
earlier), and there is a possibility that installing files from
ppp-2.3.11.tar.gz distribution will break something.

Use it on your own risk!



NOTES:

- You might want to check for updated OpenWall patches for Linux kernel
(by Solar Designer) at http://www.openwall.com/linux/
- You might want to check for updated IDE drivers at
http://republika.pl/bkz/ or
http://www.kernel.org/pub/linux/kernel/people/hedrick/ or
http://www.linux-ide.org/ (last 2 are 'official' ones, but the first
site might have patches available first)

First, we will download kernel sources, and additional patches (if you
need them):

# cd /usr/src
# wget http://www.kernel.org/pub/linux/kernel/v2.2/linux-2.2.16.tar.bz2
<download progress...>
# wget http://www.openwall.com/linux/linux-2.2.16-ow1.tar.gz
<download progress...>
# wget http://republika.pl/bkz/ide.2.2.16.patch.bz2
<download progress...>

Then, remove 'linux' directory (if it exists), or 'linux' symlink (if it
exists):

# rm linux (for symlink)
# rm -rf linux (for directory)

Unpack kernel sources. Note that 'I' option for tar is available for tar
1.13 and above:

# tar Ixvf linux-2.2.16.tar.bz2

In case you don't have tar 1.13, use bzip2 first:

# bzip2 -d linux-2.2.16.tar.bz2
# tar xvf linux-2.2.16.tar

It is better to have 'linux' as a symlink (for maintenance reasons :):

# mv linux linux-2.2.16
# ln -s linux-2.2.16 linux

Move the patches to the 'linux' dir:

# mv linux-2.2.16-ow1.tar.gz linux/
# mv ide.2.2.16.patch.bz2 linux/
# cd linux

Unpack patches:

# bzip2 -d ide.2.2.16.patch.bz2
# tar zxvf linux-2.2.16-ow1.tar.gz

Apply patches:

# patch -p1 < ide-2.2.16.patch
# patch -p1 < linux-2.2.16-ow1/linux-2.2.16-ow1.diff
(you might want/need to apply 2 other patches - read the README file!)

Create a link for 'asm' in includes:
# cd include
# ln -s asm-i386/ asm

Now, we need to get pptp/ppp stuff:

# cd /var/tmp
# mkdir pptp
# cd pptp
# wget ftp://ftp.linuxcare.com.au/pub/ppp/ppp-2.3.11.tar.gz
<download progress...>
# wget
ftp://ftp.binarix.com/pub/ppp-mppe/ppp-2.3.11-openssl-0.9.5-mppe.patch.gz
<download progress...>
# wget http://www.moretonbay.com/vpn/releases/pptpd-1.0.0.tgz
<download progress...>

Unpack pppd, and apply the patch:

# tar zxvf ppp-2.3.11.tar.gz
# gzip -d ppp-2.3.11-openssl-0.9.5-mppe.patch.gz
# mv ppp-2.3.11-openssl-0.9.5-mppe.patch ppp-2.3.11/
# cd ppp-2.3.11/
# patch -p1 < ppp-2.3.11-openssl-0.9.5-mppe.patch

Make pppd:

# ./configure
# make
# make install

Copy required files to kernel source dir:

# make kernel
# cp common/zlib.h /usr/src/linux/drivers/net/
# cp include/linux/if_pppvar.h /usr/src/linux/include/linux/

Make kernel configuration:

# cd /usr/src/linux
# make menuconfig

NOTE: kernel configuration is covered on many other places - no need for
it here; make sure that you build ppp/slip modules though :)

Make kernel and modules:

# make dep; make bzImage; make modules; make modules_install

or (if you have SMP machine)

# make dep; make -j3 bzImage; make -j3 modules; make modules_install

NOTE: If you already have /lib/modules/2.2.16 directory, remove it
before installing modules

Install new kernel:

# cp System.map /boot/System.map-2.2.16
# rm /boot/System.map (if you have it)
# ln -s /boot/System.map-2.2.16 /boot/System.map
# cp arch/i386/bzImage /boot/linux-2.2.16

Edit your /etc/lilo.conf, and make new entry to this kernel. It should
probably look like:

-- cut --
image=/boot/linux-2.2.16
        label=linux
        read-only
        root=/dev/hda3
-- cut --

NOTE: Make sure that 'root' points to the right device, and if you are
using initrd images, create one using 'mkinitrd' command, and add
appropriate entry!

Create /etc/ppp/options file. The following is just an example:

-- cut ---
debug
#kdebug 1 (you can turn this on if you require more debugging)
auth
+chap
+chapms
+chapms-v2
mppe-40
mppe-128
mppe-stateless
proxyarp
ms-wins <your WINS server>
ms-dns <your primary DNS>
ms-dns <your secondary DNS>
require-chap
name servername (you can use some other name, it is up to you)
netmask 255.255.255.0
-- cut --

Create /etc/ppp/chap-secrets file. The following is just an example:

-- cut --
# Secrets for authentication using CHAP
# client        server       secret                  IP addresses
username        servername   password                *
-- cut --

Make sure permissions are properly set on /etc/ppp/chap-secrets file:

# chown root:root /etc/ppp/chap-secrets
# chmod 600 /etc/ppp/chap-secrets

Add ppp-compress-18 entry into /etc/conf.modules:

-- cut --
alias ppp-compress-18 ppp_mppe
-- cut --

Now, build and install pptpd:

# cd /var/tmp/ppp/
# tar zxvf pptpd-1.0.0.tar.gz
# cd pptpd-1.0.0
# ./configure
# make
# make install-strip

Create /etc/pptpd.conf file. The following is just an example:

-- cut --
speed 115200
option /etc/ppp/options
debug
localip 192.168.1.230 (IP address which PPTP server will have - can be
single IP)
remoteip 192.168.1.231-253 (pool of IP addresses which will be assigned
to clients)
listen 192.168.1.200 (IP address where pptpd will listen)
-- cut --

You can add init script into /etc/rc.d/init.d directory. It was
originally made by Henri Gomez:

-- cut --
#!/bin/sh
#
# Startup script for pptpd 
#
# chkconfig: 345 85 15
# description: PPTP server
# processname: pptpd
# config: /etc/pptpd.conf


# Source function library.
. /etc/rc.d/init.d/functions
# See how we were called.
case "$1" in
  start)
        echo -n "Starting pptpd: "
        if [ -f /var/lock/subsys/pptpd ] ; then
                echo
                exit 1
        fi

        daemon /usr/local/sbin/pptpd
        echo
        touch /var/lock/subsys/pptpd
        ;;
  stop)
        echo -n "Shutting down pptpd: "
        killproc pptpd
        echo
        rm -f /var/lock/subsys/pptpd
        ;;
  status)
        status pptpd
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
esac

exit 0
-- cut --

Activate it (on RedHat) using command:

# chkconfig --add pptpd

If you wish to see some pptpd debugging messages, add the following
entry to /etc/syslogd.conf:

-- cut here --
daemon.debug     /var/log/pptp.log
-- cut here --

Reboot...

After the reboot, pptpd should be running.



More information about the pptp-server mailing list