yum -y install ppp iptables
cp -rpf /etc/sysconfig/iptables /etc/sysconfig/iptables.pptpsave
rpm -ivh pptpd-1.3.4-2.el6.i686.rpm
vi /etc/sysctl.conf
改net.ipv4.ip_forward = 1
以下修正虛擬網段內容複製貼上即可
sysctl -p
echo "localip 192.168.10.254" >> /etc/pptpd.conf
echo "remoteip 192.168.10.201-250" >> /etc/pptpd.conf
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd
echo "ms-dns 8.8.4.4" >> /etc/ppp/options.pptpd
iptables --flush POSTROUTING --table nat
iptables --flush FORWARD
iptables -A INPUT -p tcp -m tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth0 -j MASQUERADE
echo "localip 192.168.10.254" >> /etc/pptpd.conf
echo "remoteip 192.168.10.201-250" >> /etc/pptpd.conf
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd
echo "ms-dns 8.8.4.4" >> /etc/ppp/options.pptpd
iptables --flush POSTROUTING --table nat
iptables --flush FORWARD
iptables -A INPUT -p tcp -m tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth0 -j MASQUERADE
service iptables save
service pptpd restart
service iptables restart
chkconfig pptpd on
chkconfig iptables on
service pptpd restart
service iptables restart
chkconfig pptpd on
chkconfig iptables on
至webmin設定VPN帳號密碼
沒有留言:
張貼留言