pptp虚拟服务器,科学网—ubuntu 16.04 配置自己的PPTP服务器 - 彭延国的博文

I Enviroments

Ubuntu 14.04 LTS/16.04 LTS

iptables

II Prerequisites

1. PPTP

$ sudo apt-get install pptpd

# install pptpd

$ sudo vi /etc/pptpd.conf

# Uncommnet the following contents

#localip 192.168.0.1

#remoteip 192.168.0.234-238,192.168.0.245

$ sudo vi /etc/ppp/pptpd-options

# Uncommnet and change the following contents

#ms-dns 8.8.8.8

#ms-dns 114.114.114.114

$ sudo vi /etc/ppp/chap-secrets

# Insert user and password.

username pptpd userpassword *

$ sudo vi /etc/sysctl.conf

# Uncommnet the following contents

#net.ipv4.ip_forward=1

$ sudo sysctl -p

# Display "net.ipv4.ip_forward = 1".

2. iptables

$ sudo apt-get install iptables

# Install iptables.

$ sudo iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

# Insert the forwarding rules.

$ sudo touch /etc/iptables.rules

# Create forwarding rules file.

$ sudo chmod a+w /etc/iptables.rules

# Change the permission.

$ sudo iptables-save > /etc/iptables.rules

# write permissions into file.

$ sudo vi /etc/network/interfaces

# Add the following content into the end of file.

pre-up iptables-restore < /etc/iptables.rules

$ sudo /etc/init.d/pptpd restart

# Restart the service.

$ sudo vi /etc/rc.local

# Add the following content into the end for self-starting.

/etc/init.d/pptpd restart

转载本文请联系原作者获取授权,同时请注明本文来自彭延国科学网博客。

链接地址:http://blog.sciencenet.cn/blog-427115-1084294.html

上一篇:ubuntu系统中Apache2配置虚拟主机和反向解析

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值