PPTPd Server on Debian

PPTP Server

Install & config

$ sudo aptitude install pptpd

$ sudo nano /etc/pptpd.conf

localip 192.168.222.1
remoteip 192.168.222.100-200,192.168.222.245
$ sudo nano /etc/ppp/pptpd-options

ms-dns 192.168.222.1
ms-dns 8.8.4.4
nobsdcomp

noipx
mtu 1490
mru 1490

username/password for authen

$ sudo nano /etc/ppp/chap-secrets

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

username1	*	password1	*
username2	*	password2	*
username3	*	password3	*

Start pptpd

$ sudo /etc/init.d/pptpd restart

PPTP Client

Install & config

$ sudo aptitude install pptp-linux network-manager-pptp
$ sudo nano /etc/ppp/chap-secrets

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

username1	PPTP	password1	*

create connection profile

$ sudo nano /etc/ppp/peers/pptp-idc-01

pty "pptp vpn.nanosofttech.com --nolaunchpppd"
name username1
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam pptp-idc-01

set route

$ sudo nano /etc/ppp/ip-up.d/route-ppp0

#!/bin/bash

NET="192.168.222.0/24" # set me
IFACE="ppp0" # set me
#IFACE=$1
route add -net ${NET} dev ${IFACE}
$ sudo chmod +x /etc/ppp/ip-up.d/route-ppp0

connect

$ sudo pppd call pptp-idc-01
$ sudo tail -f /var/log/messages


Jan 16 07:35:03 nano rsyslogd: [origin software="rsyslogd" swVersion="8.4.2" x-pid="766" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Jan 16 10:09:42 nano kernel: [244207.553651] PPP generic driver version 2.4.2
Jan 16 10:09:42 nano pppd[19949]: pppd 2.4.6 started by adull, uid 0
Jan 16 10:09:42 nano pppd[19949]: Using interface ppp0
Jan 16 10:09:42 nano pppd[19949]: Connect: ppp0  /dev/pts/1
Jan 16 10:09:43 nano pppd[19949]: CHAP authentication succeeded
Jan 16 10:09:43 nano kernel: [244208.758792] PPP MPPE Compression module registered
Jan 16 10:09:43 nano pppd[19949]: MPPE 128-bit stateless compression enabled
Jan 16 10:09:43 nano pppd[19949]: local  IP address 192.168.222.100
Jan 16 10:09:43 nano pppd[19949]: remote IP address 192.168.222.1
$ ifconfig


eth0      Link encap:Ethernet  HWaddr 54:04:a6:cf:1f:67  
          inet addr:192.168.111.101  Bcast:192.168.111.255  Mask:255.255.255.0
          inet6 addr: fe80::5604:a6ff:fecf:1f67/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5797937 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9977493 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000 
          RX bytes:1849976958 (1.7 GiB)  TX bytes:1540628439 (1.4 GiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:90 errors:0 dropped:0 overruns:0 frame:0
          TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:31086 (30.3 KiB)  TX bytes:31086 (30.3 KiB)

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:192.168.222.100  P-t-P:192.168.222.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1486  Metric:1
          RX packets:43 errors:0 dropped:0 overruns:0 frame:0
          TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:5727 (5.5 KiB)  TX bytes:4005 (3.9 KiB)


$ route

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.111.1   0.0.0.0         UG    0      0        0 eth0
192.168.111.0   *               255.255.255.0   U     0      0        0 eth0
192.168.222.0   *               255.255.255.0   U     0      0        0 ppp0
192.168.222.1   *               255.255.255.255 UH    0      0        0 ppp0
Advertisements

About NanoSoftTech

NanoSoftTech
This entry was posted in Debian, Linux Mint. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s