yum -y install ppp

wget -c http://code-jinchengjiang.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.x86_64.rpm
rpm -ivh pptpd-1.3.4-1.rhel5.1.x86_64.rpm

wget -c http://code-jinchengjiang.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.i386.rpm
rpm -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm

sed -i 's/#ms-dns 10.0.0.1/ms-dns 10.242.197.247/' /etc/ppp/options.pptpd
sed -i 's/#ms-dns 10.0.0.2/ms-dns 10.242.197.248/' /etc/ppp/options.pptpd

sed -i 's/#localip 192.168.0.1/localip 192.168.0.1/' /etc/pptpd.conf
sed -i 's/#remoteip 192.168.0.234-238,192.168.0.245/remoteip 192.168.0.234-238,192.168.0.245/' /etc/pptpd.conf

sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/' /etc/sysctl.conf
sysctl -p

echo -e "用户 pptpd 密码 *" /etc/ppp/chap-secrets

service iptables start
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT

#xen
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth1 -j MASQUERADE

#Openvz
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to-source 你的VPS的IP

service iptables save
service iptables restart
service pptpd start
chkconfig pptpd on

标签: none

添加新评论