很多朋友买来国外VPS,架设V*P*N自用也是其中用途之一,如果是XEN或者KVM架构这个问题就不是问题,但是OpenVZ因为必须TUN和PPP支持,就需要主机商开启。
在这篇文章的开头,我特别说明,我用的是最笨的方法,我知道有些主机商他们开设的OpenVZ默认就开启了TUN/PPP,比较有代表性的如BuyVM.net;另外,有些主机商的SolusVM直接在后台点下TUN和PPP的开关也可以开启和架设V*P*N,不过好VPS试了下直接在SolusVM后台开启后,V*P*N还是不行,所以才有了这篇文章:除了在SolusVM开启,还需要母鸡上给他设定。虽然这个办法比较纠结,不过毕竟也解决了问题,希望对其他朋友有帮助。
这里我先开一只小鸡给自己用于测试,登陆SolusVM,创建一个VPS,然后,我们可以用户端登陆这个VPS,开启TUN和PPP,当然,也可以直接管理员打开这台VPS操作开启,如图:
solusvm-tun-ppp
完成后,我们检查下TUN和PPP。

[[email protected] ~]# cat /dev/net/tun
cat: /dev/net/tun: File descriptor in bad state
[[email protected] ~]# cat /dev/ppp
cat: /dev/ppp: Permission denied

悲催,PPP检测未通过,我们需要在母鸡上做相关的设定,首先,我们在后台查看到该VPS的ID,比如108.

1
2
3
4
5
vzctl set 108 --devnodes net/tun:rw --save
vzctl set 108 --devices c:10:200:rw --save
vzctl set 108 --capability net_admin:on --save
vzctl exec 108 mkdir -p /dev/net
vzctl exec 108 chmod 600 /dev/net/tun

完成后,重启下VPS,再次检测PPP状况。

[[email protected] ~]# cat /dev/ppp
cat: /dev/ppp: No such device or address

终于通过了,现在,这台VPS已经可以直接安装PPTP V*P*N了,有关OpenVZ上面安装的教程,大家可以参考这篇文章:点击直达

标签: TUN/PPP, SolusVM教程, OPenVZ开启PPP, OpenVZ开启TUN

window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":["mshare","kaixin001","tsina","tsohu","tqq","renren","qzone","weixin","bdysc","bdxc","tqf","tieba","douban","bdhome","sqq","thx"],"bdPic":"","bdStyle":"0","bdSize":"24"},"slide":{"type":"slide","bdImg":"2","bdPos":"left","bdTop":"100"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["tsina","tqq","tsohu","qzone","renren","weixin","mshare"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
postid
17576

发表评论