个人工具
登录
查看“UbuntuHelp:PPTPServer”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:PPTPServer”的源代码
来自Ubuntu中文
←
UbuntuHelp:PPTPServer
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/PPTPServer}} {{Languages|UbuntuHelp:PPTPServer}} #title PPTP VPN Server Setup Guide This guide has been tested with Ubuntu 12.4 Server. === Setup PPTP Server === First we need to install pptp server using apt-get <pre><nowiki> # sudo apt-get install pptpd </nowiki></pre> Then we need to configure the pptpd. <pre><nowiki> # sudo nano /etc/pptpd.conf </nowiki></pre> Add server IP and client IP at the end of the file. You can add like below: <pre><nowiki> localip 192.168.0.1 remoteip 192.168.0.100-200 </nowiki></pre> 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 <pre><nowiki> # sudo nano /etc/ppp/pptpd-options </nowiki></pre> Uncomment the ms-dns and add google like below or OpenDNS <pre><nowiki> ms-dns 8.8.8.8 ms-dns 8.8.4.4 </nowiki></pre> Now add a VPN user in /etc/ppp/chap-secrets file. <pre><nowiki> # sudo nano /etc/ppp/chap-secrets </nowiki></pre> 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. <pre><nowiki> # client server secret IP addresses username * myPassword * </nowiki></pre> Finally start your server <pre><nowiki> # /etc/init.d/pptpd restart </nowiki></pre> === Setup IP Forwarding === To enable IPv4 forward. Change /etc/sysctl.conf file, add forward rule blew. <pre><nowiki> # sudo nano /etc/sysctl.conf </nowiki></pre> Uncomnent the line <pre><nowiki> net.ipv4.ip_forward=1 </nowiki></pre> Then reload the configuration <pre><nowiki> sudo sysctl -p </nowiki></pre> Add forward rule in iptables <pre><nowiki> # sudo nano /etc/rc.local </nowiki></pre> adding to the bottom just before the exit 0 <pre><nowiki> iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE iptables -A FORWARD -p tcp --syn -s 192.168.0.0/24 -j TCPMSS --set-mss 1356 </nowiki></pre> 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. ---- [[category:CategoryVPN]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:PPTPServer
。