jecopeng的个人博客分享 http://blog.sciencenet.cn/u/jecopeng

博文

ubuntu 16.04 配置自己的PPTP服务器

已有 3606 次阅读 2017-11-8 12:12 |系统分类:科研笔记

I Enviroments

Ubuntu 14.04 LTS/16.04 LTS

PPTP

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



https://blog.sciencenet.cn/blog-427115-1084294.html

上一篇:ubuntu系统中Apache2配置虚拟主机和反向解析
收藏 IP: 123.138.79.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-25 08:08

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部