CentOS 8安装PPTP VPN

广告位招租!
知识无价,人有情,无偿分享知识,希望本条信息对你有用!

How to set up and install a PPTP VPN on CentOS 8

Step 1: Install PPP

Installing PPTP completely depends on PPP and PPTPD packages. To do so, first, install the related package and then configure it to initiate configuration. Use the following commands one by one:

yum install ppp iptables nano
cd /usr/local/src

For 64-bit OS:

wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.x86_64.rpm

rpm -Uhv pptpd-1.4.0-1.el6.x86_64.rpm

yum remove  ppp-2.4.9-5.el9.x86_64

wget https://poptop.sourceforge.net/yum/stable/packages/ppp-2.4.5-33.0.fc12.x86_64.rpm

rpm -Uhv ppp-2.4.5-33.0.fc12.x86_64.rpm

wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/t/tcp_wrappers-libs-7.6-97.el9.x86_64.rpm

rpm -Uhv tcp_wrappers-libs-7.6-97.el9.x86_64.rpm

For 32-bit OS:

wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.i686.rpm

rpm -Uhv pptpd-1.4.0-1.el6.i686.rpm

Step 2: Configure and Setup your PPTPD

Edit IP settings in: /etc/pptpd.conf as shown in the following:

nano /etc/pptpd.conf

Edit the following settings to /etc/ppp/options.pptpd:

vi /etc/ppp/options.pptpd

ms-dns 8.8.8.8

ms-dns 4.4.4.4

As you can see, this code will add a DNS server to your VPN server. You can add the DNS servers provided by your internet provider or use Google DNSserver and insert them in the file.

Step 3: Create a user to access the VPN server

Add user account in/etc/ppp/chap-secrets (assign username and password) like the following:

nano /etc/ppp/chap-secrets

Step 4: Enable IP/network forwarding

We need IP forwarding to help VPN route packets between the VPN clients and the outside world. Therefore, the VPN server will become a router:

sudo vi /etc/sysctl.conf

Now, add the following line:

vi /etc/sysctl.conf

net.ipv4.ip_forward = 1

To make the changes to sysctl.conf take effect, use the following command:

sysctl -p

After running this code, you must save and close the file. Then apply the changes with the following command:

sudo sysctl -p

this command will reserve our setting between system reboots.

重启服务器。

Step 5: Setup ”iptables”

Now, you need to add the following IP-tables rules in order to open the correct ports and properly forward the data packets:

iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i eth0 -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Step 6:Start VPN server

service pptpd restart

可能会用到的命令:

yum remove  ppp-2.4.9-5.el9.x86_64
wget https://poptop.sourceforge.net/yum/stable/packages/ppp-2.4.5-33.0.fc12.x86_64.rpm
rpm -Uhv ppp-2.4.5-33.0.fc12.x86_64.rpm
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/t/tcp_wrappers-libs-7.6-97.el9.x86_64.rpm
rpm -Uhv tcp_wrappers-libs-7.6-97.el9.x86_64.rpm
rpm -Uhv pptpd-1.4.0-1.el6.x86_64.rpm

 最后,恭祝各位使用愉快!

  • 20
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

OptimizationMaster

有钱捧个钱场,没钱捧个人场

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值