Difference between revisions of "PPTP server"

From ArchWiki
Jump to: navigation, search
(sections)
m (<pre> -> bc)
Line 1: Line 1:
 
[[Category:Virtual Private Network (English)]]
 
[[Category:Virtual Private Network (English)]]
 
{{i18n|PPTP Server}}
 
{{i18n|PPTP Server}}
 +
 
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.
 
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.
  
Line 13: Line 14:
 
Now, edit the file '''/etc/pptpd.conf'''
 
Now, edit the file '''/etc/pptpd.conf'''
  
<pre>
+
{{bc|
 
option /etc/ppp/pptpd-options
 
option /etc/ppp/pptpd-options
 
localip 172.16.36.1
 
localip 172.16.36.1
 
remoteip 172.16.36.2-254
 
remoteip 172.16.36.2-254
</pre>
+
}}
  
 
Now, edit the file '''/etc/ppp/pptpd-options'''
 
Now, edit the file '''/etc/ppp/pptpd-options'''
  
<pre>
+
{{bc|
  
 
name pptpd
 
name pptpd
Line 37: Line 38:
 
ms-dns 8.8.8.8
 
ms-dns 8.8.8.8
 
ms-dns 8.8.4.4
 
ms-dns 8.8.4.4
</pre>
+
}}
  
 
Now we must add my users & passwords in "/etc/ppp/chap-secrets"
 
Now we must add my users & passwords in "/etc/ppp/chap-secrets"
<pre>
+
{{bc|
 
<username>    pptpd    <password>  *
 
<username>    pptpd    <password>  *
</pre>
+
}}
  
 
Now, enable IP Forwarding by editing "/etc/sysctl.conf"
 
Now, enable IP Forwarding by editing "/etc/sysctl.conf"
  
<pre>
+
{{bc|1=
 
net.ipv4.ip_forward=1
 
net.ipv4.ip_forward=1
</pre>
+
}}
  
 
Now apply the changes made to sysctl.conf
 
Now apply the changes made to sysctl.conf
Line 56: Line 57:
 
Configure your iptables settings to enable access for PPTP Clients
 
Configure your iptables settings to enable access for PPTP Clients
  
<pre>
+
{{bc|
 
iptables -A INPUT -i ppp+ -j ACCEPT
 
iptables -A INPUT -i ppp+ -j ACCEPT
 
iptables -A OUTPUT -o ppp+ -j ACCEPT
 
iptables -A OUTPUT -o ppp+ -j ACCEPT
Line 69: Line 70:
 
iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
 
iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
 
iptables -A POSTROUTING -t nat -o ppp+ -j MASQUERADE
 
iptables -A POSTROUTING -t nat -o ppp+ -j MASQUERADE
</pre>
+
}}
  
 
Now save the new iptables rules with:
 
Now save the new iptables rules with:

Revision as of 10:07, 24 March 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

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.

This entry will show you on how to create a PPTP server in Arch.

Installation

Install pptpd, available in the Official Repositories.

Configuration

Now, edit the file /etc/pptpd.conf

option /etc/ppp/pptpd-options
localip 172.16.36.1
remoteip 172.16.36.2-254

Now, edit the file /etc/ppp/pptpd-options


name pptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
ms-dns 8.8.8.8
ms-dns 8.8.4.4

Now we must add my users & passwords in "/etc/ppp/chap-secrets"

<username>     pptpd     <password>   *

Now, enable IP Forwarding by editing "/etc/sysctl.conf"

net.ipv4.ip_forward=1

Now apply the changes made to sysctl.conf

# sysctl -p

Configure your iptables settings to enable access for PPTP Clients

iptables -A INPUT -i ppp+ -j ACCEPT
iptables -A OUTPUT -o ppp+ -j ACCEPT

iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p 47 -j ACCEPT
iptables -A OUTPUT -p 47 -j ACCEPT

iptables -F FORWARD
iptables -A FORWARD -j ACCEPT

iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
iptables -A POSTROUTING -t nat -o ppp+ -j MASQUERADE

Now save the new iptables rules with:

# rc.d save iptables

Read Iptables for more information.

Now you can start your PPTP Server by this command and enjoy

# rc.d start pptpd

You can use this script to auto install pptpd server