1. 检测是否符合pptp的搭建环境的要求
modprobe ppp-compress-18 && echo ok
echo 'modprobe tun' >> /etc/rc.modules
chmod +x /etc/rc.modules
2. 查看有无安装ppp
rpm -q ppp
3. 安装ppp pptp
wget
sudo yum install -y perl ppp pptpd tcp_wrappers dkms kernel_ppp_mppe libpcap
4. 查看ppp版本,再查找pptpd的对应关系
yum list installed ppp
5. 命令行修改
mknod /dev/ppp c 108 0
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "mknod /dev/ppp c 108 0" >> /etc/rc.local
echo "echo 1 > /proc/sys/net/ipv4/ip_forward" >> /etc/rc.local
echo "localip 172.18.1.1" >> /etc/pptpd.conf
echo "remoteip 172.18.1.2-254" >> /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
6.iptables
iptables -A INPUT -i eth1 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i eth1 -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -A FORWARD -p tcp -s 172.18.1.0/24 -j TCPMSS --syn --set-mss 1356
7.配置用户名密码
vim /etc/ppp/chap-secrets
liyilin pptpd 123456 * 用户名:liyilin 密码:123456 *:充许任何ip登录
二、错误信息
619错误
rm /dev/ppp
mknod /dev/ppp c 108 0
651错误
vi /etc/pptpd.conf
#logwtmp
2250错误
vim /etc/ppp/options.pptpd
#require-mschap-v2
#require-mppe-128
pptpd-1.zip
阅读(1324) | 评论(0) | 转发(0) |