ddxiami

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2301|回复: 0

[文章] centos搭建vpn

[复制链接]
发表于 2019-2-28 14:50:38 | 显示全部楼层 |阅读模式
原文地址:https://yq.aliyun.com/articles/427931

#更新系统组件
yum update -y

#配置yum源
vi /etc/yum.repos.d/epel.repo
==============================================
[epel]

name=aliyun epel
baseurl=http://mirrors.aliyun.com/epel/7Server/x86_64/
gpgcheck=0

gpgkey=http://mirrors.cloud.aliyuncs.com/epel/RPM-GPG-KEY-EPEL-7
==============================================

#安装
yum install -y ppp
yum install -y pptpd

#配置pptpd.conf,注释logwtmp
vi /etc/pptpd.conf
==============================================
localip 192.168.250.1
remoteip 192.168.250.2-252,192.168.250.253
==============================================

#配置dns
vi /etc/ppp/options.pptpd
==============================================
ms-dns 8.8.8.8
ms-dns 8.8.4.4
==============================================

#设置账号密码
vi /etc/ppp/chap-secrets
==============================================
# If pppd is acting as a server for Microsoft Windows or "Samba"
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
testvpn pptpd   123456  *
==============================================

#配置防火墙
yum install iptables-services -y
service iptables stop

#设置防火墙底层
vi /etc/sysctl.conf
==============================================
net.ipv4.ip_forward = 1
==============================================
sysctl -p

#内网网卡172.18.111.0
iptables -t nat -A POSTROUTING -s 192.168.250.0/255.255.255.0 -j SNAT --to-source 172.18.111.0

#重启服务
systemctl restart pptpd
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|技术文档库 ( 闽ICP备15017263号-2 )|网站地图

GMT+8, 2025-5-19 02:05 , Processed in 0.034917 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表