码迷,mamicode.com
首页 > 其他好文 > 详细

多ip pptp

时间:2016-09-17 13:36:45      阅读:240      评论:0      收藏:0      [点我收藏+]

标签:多ip pptp

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

安装 ppp 和pptpd 两个包

yum -y install ppp ppp-devel pptpd


service pptpd restart

kill  pptpd

cp  /etc/pptpd.conf   /etc/pptpd1.conf
cp  /etc/pptpd.conf   /etc/pptpd2.conf

pptpd1.conf
localip  172.16.36.1
remoteip 172.16.36.2-10
listen 103.233.251.74

pptpd2.conf
localip  172.16.36.1
remoteip 172.16.36.2-10
listen 103.233.251.74


增加dns
vim /etc/ppp/options.pptpd
ms-dns 8.8.8.8
ms-dns 8.8.4.4


开启nat
vim /etc/sysctl.conf


打开转发
net.ipv4.ip_forward = 1                               #这里的0 改为1
sysctl -p


配置账号密码

# Secrets for authentication using CHAP
# client server secret   IP addresses
admin   pptpd   1qaz@WSX   172.16.36.2
admin   pptpd   1qaz@WSX   172.16.37.2

 

启动pptpd

pptpd -c /etc/pptpd/pptpd1.conf
pptpd -c /etc/pptpd/pptpd2.conf

 


pptp按来源进去nat

/etc/sysconfig/iptables

# Generated by iptables-save v1.4.7 on Mon Sep 12 00:24:05 2016
*nat
:PREROUTING ACCEPT [16858:1077746]
:POSTROUTING ACCEPT [2493:168701]
:OUTPUT ACCEPT [1950:141032]
-A POSTROUTING -s 172.16.36.0/24 -j SNAT --to-source 103.233.251.74
-A POSTROUTING -s 172.16.37.0/24 -j SNAT --to-source 103.233.251.75
COMMIT
# Completed on Mon Sep 12 00:24:05 2016
# Generated by iptables-save v1.4.7 on Mon Sep 12 00:24:05 2016
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [52131:6533886]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -p gre -j ACCEPT
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 172.16.36.0/24 -d 103.233.251.0/24 -j ACCEPT
-A FORWARD -s 172.16.37.0/24 -d 103.233.251.0/24 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 1723 -j ACCEPT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p esp -j ACCEPT
-A RH-Firewall-1-INPUT -p ah -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 53 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 47 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Mon Sep 12 00:24:05 2016

 

多ip pptp

标签:多ip pptp

原文地址:http://setup.blog.51cto.com/36721/1853325

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!