搭建 基于防火墙(PFsense)之后的 -- CentOS PPTP Server

搭建 基于防火墙(PFsense)之后的 -- CentOS PPTP Server


image.png



image.png 

 image.png


1. 在入口(PFSENSE-2.4.4防火墙)上设置 GRE与PPTP转发
image.png



2. WAN(PFSENSE-2.4.4防火墙)上的放行规则

image.png


3.在192.168.20.187(CentOS-6.4)上安装(ppp 与 pptpd)

yum  -y  install  ppp

# yum localinstall  pptpd-1.4.0-3.el6.i686.rpm


4.修改配置文件(/etc/pptpd.conf)

其中192.168.22.60将做为CentOS PPTP V*P*N Server的本地地址

而192.168.22.61-192.168.22.63 将做为远程拨入的客户机的地址

image.png


5.修改DNS(/etc/ppp/options.pptpd)

image.png


5.设置客户端拨入时的用户名和密码(/etc/ppp/chap-secrets)

image.png


6. 设置MTU值( /etc/ppp/ip-up)

image.png


7.修改内核参数,开启路由转发功能( /etc/sysctl.conf)


将 net.ipv4.ip_forward=0 改成net.ipv4.ip_forward=1

# sysctl –p


8.关闭iptables 和 Selinux

# service  iptables  stop

# setenforce  0


9.启动并查看pptpd运行状态

# /etc/rc.d/init.d/pptpd  restart

# /etc/rc.d/init.d/pptpd  status



10.在windows上建立PPTP连接

image.png


image.png


image.png


image.png




因为条件所限本案例中:

a.  只测试了同一帐号/2个终端同时登陆的情况(正常)

b.  3个或3个以上及多帐号同时登陆的情况没有进行验证

c.  多用户环境下连接速度没有验证。

d.  服务器端网络提供商(中国联通),测试端(中国电信4G--手机热点+笔记本)

    服务器端网速:

    image.png


踩过的坑:

1. 在/etc/pptpd.conf 配置文件中把IP 192.168.22.60 写成 192.168.22.60/22导致 pptpd服务不能正常启动。

    #  cat /var/log/messages | grep pptpd

    Jan 12 12:20:07 LVS-GW pptpd[10269]: MGR: connections limit (100) reached, extra IP addresses ignored

    Jan 12 12:20:08 LVS-GW pptpd[10269]: MGR: Bad IP address (192.168.22.60/22) in config file!

    Jan 12 12:20:40 LVS-GW pptpd[10228]: CTRL: Client 120.229.63.27 control connection finished

    Jan 12 12:20:45 LVS-GW pptpd[10298]: MGR: connections limit (100) reached, extra IP addresses ignored

    Jan 12 12:20:45 LVS-GW pptpd[10298]: MGR: Bad IP address (192.168.22.60/22) in config file!

    Jan 12 12:20:48 LVS-GW pptpd[10318]: MGR: connections limit (100) reached, extra IP addresses ignored

    Jan 12 12:20:48 LVS-GW pptpd[10318]: MGR: Bad IP address (192.168.22.60/22) in config file!

    Jan 12 12:23:09 LVS-GW pptpd[10344]: MGR: connections limit (100) reached, extra IP addresses ignored

    Jan 12 12:23:09 LVS-GW pptpd[10344]: MGR: Bad IP address (192.168.22.60/22) in config file!

    Jan 12 12:26:28 LVS-GW pptpd[1932]: MGR: connections limit (100) reached, extra IP addresses ignored

    Jan 12 12:26:28 LVS-GW pptpd[1932]: MGR: Bad IP address (192.168.22.60/22) in config file!


    解决方法:去掉IP前缀


2. 启动pptpd报错:pptpd dead but subsys locked

    删除掉 /var/lock/subsys/pptpd


如何把访问公司内网的流量与访问公司以外的流量进行隔离?

a.没有隔离时访问百度

image.png

b.隔离之后访问百度

image.png


如何在客户端设置流量隔离?

a.

image.png

b.

image.png

c.

image.png

























猜你喜欢

转载自blog.51cto.com/204324/2398223