IPSEC/IKEV2 VPN one in script

When My Mac upgrade to macOS Sierra, there’s no pptp to use but IPsec/IKEv2. Then I googled a script that can be install & configure automatically. The only thing you do is just press ENTER 🙂 here is author’s web site. You can learn form his post about IPSEC/IKEV2 on this page If you wanna […]

One ID One session for vpn.

一个vpn账号只能生成一个session, 一个vpn账号只允许一个连接。限制登录个数 纯傻瓜操作免去繁琐的配置,原理非常简单只要ppp用户登录即生成一个文件在/var/run/pptpd-users下面. 重复登录的话杀掉原进程生成新的。即把上一个用相同账号的人挤下去. 保存下面的文件到/etc/ppp下面再加上x权限. #!/bin/sh # get the username/ppp line number from the parameters REALDEVICE=$1 USER=$2 # create the directory to keep pid files per user mkdir -p /var/run/pptpd-users # if there is a session already for this user, terminate the old one if [ -f /var/run/pptpd-users/$USER ]; then kill -HUP `cat /var/run/pptpd-users/$USER` fi […]

How to use vpn via different route by one script automatically.

首先感谢github 上的https://github.com/jimmyxu/chnroutes 下面的脚本只是为了我这类懒人而写的纯傻瓜操作且仅限Mac用户。其他平台请自行参照项目地址中的说明文件. 备注, 此bash会在你的/etc/ppp下面生成两个文件. 也就是这两个文件会使你的访问分流. 并且最好定期更新这两个文件. 保存并执行下面的bash即可. #!/bin/bash #auth:Simon #mail:simon.xie@codewalker.me export tmpDirForVpnController=/tmp/tmp.route.vpn.dir export downloadFileAddress=’https://github.com/ranmocy/chnroutes/archive/master.zip’ function checkFiles { echo ‘checkFiles…’ if [ ! -d $tmpDirForVpnController ];then echo ‘folder no found, create it’ $tmpDirForVpnController mkdir -p $tmpDirForVpnController; fi cd $tmpDirForVpnController if [ ! -d chnroutes-master ]; then if [ ! -f master.zip ]; then downloadPackage fi […]


既然有了自己vps不架设一个vps简直是太浪费了。 写了个脚本自己安装,纯傻瓜操作一键搞定。 环境centos6 64 [root@codewalker ~]# cat ./auto.install.vpn.sh yum remove -y pptpd ppp iptables –flush POSTROUTING –table nat iptables –flush FORWARD rm -rf /etc/pptpd.conf rm -rf /etc/ppp rpm -Uvh http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm yum -y install policycoreutils make libpcap iptables gcc-c++ logrotate tar cpio perl pam tcp_wrappers kernel_ppp_mppe yum -y install ppp pptpd rm -rf /dev/ppp mknod /dev/ppp […]