星期一, 4月 15, 2013

Ubuntu pptp server

1. install pptpd service
sudo apt-get install pptpd

2. iptables rules
-A INPUT -i xyz0 -p tcp -m state --state NEW --dport 1723 -j ACCEPT

-A INPUT -i xyz0 -p gre -j ACCEPT
-A OUTPUT -i xyz0 -p gre -j ACCEPT
-A INPUT -i xyz0 -p tcp --sport 1723 -s xxx.xxx.xxx.xxx -j ACCEPT
-A OUTPUT -i xyz0 -p tcp --dport 1723 -d xxx.xxx.xxx.xxx -j ACCEPT

xyz0 is the out interface.
xxx.xxx.xxx.xxx is the pptp server address

3. /etc/pptpd.conf
modify localip & remoteip

localip xxx.xxx.xxx.xxx
remoteip 192.168.x.51-59

xxx.xxx.xxx.xxx is the pptp server address

4. /etc/ppp/chap-secrets
add one entry for pptpd

# client server secret IP addresses
"user" pptpd "password" *

5. start pptpd service