Pejman Moghadam / Slackware

Slackware 12.2 - pptpclient / pppoe client

Public domain


pptpclient

cd /usr/src
wget -c "http://pmoghadam.com/homepage/Pages/Deposit/Source-packages/pptp-1.7.2.tar.gz"
tar zxf pptp-1.7.2.tar.gz
cd pptp-1.7.2
make
make install

Commands

mkdir -p /etc/ppp/peers
touch /etc/ppp/ip-up
chmod +x /etc/ppp/ip-up
mv /etc/ppp/options.pptp{,.bak}

/etc/ppp/options.pptp

lock noauth nobsdcomp nodeflate refuse-eap
persist maxfail 0 proxyarp
#debug dump logfd 2 nodetach

/etc/ppp/chap-secrets

pejman PPTP 123456 *

/etc/ppp/peers/pptp-peer

pty "pptp 192.168.205.1 --nolaunchpppd"
name pejman
remotename PPTP
file /etc/ppp/options.pptp

Connection

pppd call pptp-peer

/etc/ppp/ip-up

#!/bin/bash
#
# parameters
#       $1      the interface name used by pppd (e.g. ppp3)
#       $2      the tty device name
#       $3      the tty device speed
#       $4      the local IP address for the interface
#       $5      the remote IP address
#       $6      the parameter specified by the 'ipparam' option to pppd
#
case "$5" in
  10.0.0.1)
    /sbin/route del default
    /sbin/route add default dev $1
    /bin/echo "nameserver 8.8.8.8" > /etc/resolv.conf
    /usr/sbin/iptables -t nat -A POSTROUTING -o $1 -j MASQUERADE
    /bin/echo 1 >  /proc/sys/net/ipv4/ip_forward
    ;;
  188.34.68.1)
    /sbin/route add -host 192.168.205.1 dev $1
    /sbin/route add -host 10.20.30.10 dev $1
    ;;
  *)
esac

exit 0

/etc/dhcpd.conf

# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#
ddns-update-style none;
subnet 172.16.20.0 netmask 255.255.255.0 {
  option routers              172.16.20.1;
  option subnet-mask          255.255.255.0;
  option domain-name-servers  8.8.8.8;
  range  172.16.20.100 172.16.20.200;
}

/etc/ppp/pppoe.conf

PPPD_EXTRA="noccp persist maxfail 0"

/etc/rc.d/rc.local

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

/usr/sbin/dhcpd -q
/usr/sbin/pppoe-start
/usr/sbin/pppd call pptp-peer

BY: Pejman Moghadam
TAG: pptpclient, vpn-client, pppoe-client, ip-up, dhcpd
DATE: 2010-05-28 12:23:09


Pejman Moghadam / Slackware [ TXT ]