Here is how I set VPN up on my CentOS:
1- I've installed PPTPD as follows:
yum install ppp
cd /usr/local/src
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.rhel5.x86_64.rpm
rpm -Uhv pptpd-1.3.4-2.rhel5.x86_64.rpm
2- I've edited IP setttings in /etc/pptpd.conf:
vi /etc/pptpd.conf
localip 192.168.0.1
remoteip 192.168.0.101-200
3- I've added user account in/etc/ppp/chap-secrets (assign username and password):
vi /etc/ppp/chap-secrets
usernameForuser1 * setpassword1here *
usernameForuser2 * setpassword2here *
4- I've enabled network forwarding in /etc/sysctl.conf:
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
use the following command to apply the change:
sysctl -p
5- Configured firewall
iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i eth0 -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i ppp+ -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o ppp+ -j ACCEPT
service iptables save
service iptables restart
6- Started PPTP VPN server
service pptpd restart
To start PPTP Daemon automatically when rebooting next time, use command:
chkconfig pptpd on
The log of the VPN server, by default, is combined with system log located at /var/log/messages
IPsec based VPN
. I am in trouble with this. Thanks.