哈哈 正巧 云立方网刚刚出了一个教程,命令如下:
#! /bin/sh
PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
yum install epel-release -y
sed -i 's/#baseurl/baseurl/g' /etc/yum.repos.d/epel.repo
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/epel.repo
yum install pptpd -y
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd
echo "ms-dns 8.8.4.4" >> /etc/ppp/options.pptpd
cat << EOF > /etc/pptpd.conf
option /etc/ppp/options.pptpd
logwtmp
localip 10.0.8.1
remoteip 10.0.8.11-30
EOF
sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
sed -i 's/net.ipv4.tcp_syncookies/#net.ipv4.tcp_syncookies/g' /etc/sysctl.conf
modprobe bridge
lsmod|grep bridge
sysctl -p
chkconfig pptpd on
service pptpd start
service iptables stop
chkconfig iptables off
echo "iptables -t nat -A POSTROUTING -s 10.0.8.0/24 -o eth3 -j MASQUERADE" >> /etc/rc.d/rc.local
echo "iptables -t nat -A POSTROUTING -s 10.0.8.0/24 -o seth0 -j MASQUERADE" >> /etc/rc.d/rc.local
reboot
exit
#! /bin/sh
PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
service pptpd status
service iptables status
read -p "请输入ADSL帐号:" id
read -p "请输入ADSL密码:" ps
echo "'$id' pptpd '$ps' *" >> /etc/ppp/chap-secrets
exit
取消
评论