:: What is PPTP
The Point-to-Point Tunneling Protocol (PPTP) is a method for implementing virtual private networks. PPTP uses a control channel over TCP and a GRE tunnel operating to encapsulate PPP packets. – WikiPedia
:: Verifying PPTPd is working
|
0 1 |
cat /dev/ppp cat: /dev/ppp: No such device or address |
:: How to setup pptpd vpn in Debian Linux
+ Installing pptpd
|
0 |
aptitude install pptpd |
+ Configure pptpd
|
0 |
vi /etc/pptpd.conf |
setup or change on these line:
|
0 1 |
localip 1.2.3.4 remoteip 10.0.0.1-200 |
* 1.2.3.4 = your server ip
** 10.0.0.1-200 = ip address for clients
+ Setup DNS Server for clients (Google public DNS)
|
0 |
vi /etc/ppp/pptpd-options |
uncomment or setup in these line, like:
|
0 1 |
ms-dns 8.8.8.8 ms-dns 8.8.4.4 |
+ Create user login info for PPTP VPN
|
0 |
vi /etc/ppp/chap-secrets |
add username anda password for the clients, example:
|
0 |
userjono * passwd123 * |
+ Setup MTU
|
0 |
vi /etc/ppp/ip-up |
add this line :
|
0 |
ifconfig $1 mtu 1400 |
+ Restarting pptpd
|
0 |
/etc/init.d/pptpd restart |
:: Setup Firewall
+ Enable NAT connection
|
0 |
iptables -t nat -A POSTROUTING -j SNAT --to-source 1.2.3.4 |
* 1.2.3.4 = your server ip
+ Save configuration
|
0 1 2 3 4 5 6 |
iptables-save iptables-save > /etc/iptables.conf cat > /etc/network/if-pre-up.d/iptables <<END #!/bin/sh iptables-restore < /etc/iptables.conf END chmod +x /etc/network/if-pre-up.d/iptables |
:: Enable ip forwarding
|
0 |
vi /etc/sysctl.conf |
add this line:
|
0 |
net.ipv4.ip_forward = 1 |
then apply the configuration
|
0 |
sysctl -p |
:: Links
+ Google
+ PutDispenserHere
