PPTPServer
来源:互联网 发布:最好的防火墙软件 编辑:程序博客网 时间:2024/05/20 05:04
This guide has been tested with Ubuntu 12.4 Server.
Setup PPTP Server
First we need to install pptp server using apt-get
# sudo apt-get install pptpd
Then we need to configure the pptpd.
# sudo nano /etc/pptpd.conf
Add server IP and client IP at the end of the file. You can add like below:
localip 192.168.0.1remoteip 192.168.0.100-200
This sets up the PPTP server to use IP 192.168.0.1 while distributing the IP range 192.168.0.100 to 192.168.0.200 to PPTP clients. Change these as you wish as long as they are private IP addresses and do not conflict with IP addresses already used by your server.
Configure DNS servers to use when clients connect to this PPTP server
# sudo nano /etc/ppp/pptpd-options
Uncomment the ms-dns and add google like below or OpenDNS
ms-dns 8.8.8.8ms-dns 8.8.4.4
Now add a VPN user in /etc/ppp/chap-secrets file.
# sudo nano /etc/ppp/chap-secrets
The column is username. Second column is server name, you can put “pptpd” in there. Third column is password. The last column is the IP addresses, you can put * to allow all IP.
# client server secret IP addressesusername * myPassword *
Finally start your server
# /etc/init.d/pptpd restart
Setup IP Forwarding
To enable IPv4 forward. Change /etc/sysctl.conf file, add forward rule blew.
# sudo nano /etc/sysctl.conf
Uncomnent the line
net.ipv4.ip_forward=1
Then reload the configuration
sudo sysctl -p
Add forward rule in iptables
# sudo nano /etc/rc.local
adding to the bottom just before the exit 0
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADEiptables -A FORWARD -p tcp --syn -s 192.168.0.0/24 -j TCPMSS --set-mss 1356
This example is using 192.168.0 for its PPTP subnet. The second rule adjusts the MTU size :
You are done. Just reboot your server and you should be able to connect to using PPTPD and send all your traffic through this server.
转自:https://help.ubuntu.com/community/PPTPServer
- PPTPServer
- PPTPServer
- Android平台下利用zxing实现二维码开发
- OCP 1Z0 051 69
- Android内存管理试验——浅谈ImageView的Bitmap的使用
- Android Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY的解决
- Android如何监听按键
- PPTPServer
- js时间倒计时
- 收藏
- ww的笔记之数据库基本操作
- Oracle导出表(即DMP文件)的两种方法
- CCActionCamera(摄像机动作)
- BZOJ [ZJOI2009]狼和羊的故事
- MQ简单实例
- 【C语言】16-预处理指令2-条件编译