Difference between revisions of "PPTP server"

From ArchWiki
Jump to: navigation, search
(/etc/rc.local is not the place to put iptables rules, see discussion)
Line 64: Line 64:
 
</pre>
 
</pre>
  
If you want to have iptables in erver boot you must add them in "/etc/rc.local"
+
Now save the new iptables rules with:
  
 
<pre>
 
<pre>
iptables -A INPUT -i ppp+ -j ACCEPT
+
/etc/rc.d/iptables save
iptables -A OUTPUT -o ppp+ -j ACCEPT
+
</pre>
  
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
+
Read [[Iptables]] for more information.
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
+
 
+
echo 1 > /proc/sys/net/ipv4/ip_forward
+
 
+
</pre>
+
  
 
Now you can start your PPTP Server by this command and enjoy
 
Now you can start your PPTP Server by this command and enjoy
Line 90: Line 78:
 
</pre>
 
</pre>
  
'''You cat use [http://dl.dropbox.com/u/17412056/pptpd.sh this script] to auto install pptpd server '''
+
'''You can use [http://dl.dropbox.com/u/17412056/pptpd.sh this script] to auto install pptpd server '''

Revision as of 20:51, 16 April 2011

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

We installed pptpd with :

pacman  -S pptpd 

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

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:

/etc/rc.d/iptables save

Read Iptables for more information.

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

/etc/rc.d/pptpd start

You can use this script to auto install pptpd server