V_P_N是个好东西,电脑手机都支持,只要有账号,就能访问国外一些禁止访问的网站,比如google,不过有一段时间,国家禁止建立和使用v/p/n,只能使用正规注册公司的V_P_N账号。
这段时间会打击和清理违规的公司和个人租用业务,从17年3月31日截止到18年3月31日。无论在哪个服务商那购买,一个v/p/n账号的价格一年得好几百,这个价位完全可以买个VPS主机自己建立v/p/n了。
有的VPS一年才两三美元,就这么便宜,而且没有使用流量和带宽限制,虽然没有s/s/r强大,但使用上要方便很多,手机和电脑登录v/p/n太方便了。首先要购买个linux的VPS主机,首选Linode,每个月只需要5美元,选择系统CentOS6.X和7.X都可以。
一键创建的v/p/n账号脚本
1、使用putty或Xshell登录SSH,粘贴下边命令,回车,编译一会提示设置VPN的账号和密码,比如设置一个名为v/p/n,密码为v/p/n的账号。输入后回车!
yum install -y wget && wget http://mirrors.linuxeye.com/scripts/vpn_centos.sh && chmod +x ./vpn_centos.sh && ./vpn_centos.sh
2、下图提示v/p/n配置完毕,就可以使用电脑或手机上网了。
手动创建的v/p/n账号脚本
你可以下载vpn,或者自己创建该文件,把上传到主机root目录,使用下边命令安装!
yum install -y wget && sh vpn_centos.sh
文件创建方法:创建个txt文本,然后粘贴下边代码,修改成vpn_centos.sh的名和后缀,
#!/bin/bash
#
# Author: yeho <lj2007331 AT gmail.com>
# Blog: https://blog.linuxeye.com
#
# Installs a PPTP VPN-only system for CentOS# Check if user is root
[ $(id -u) != "0" ] && { echo -e "\033[31mError: You must be root to run this script\033[0m"; exit 1; }export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
clear
printf "
#######################################################################
# LNMP/LAMP/LANMP for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+ #
# Installs a PPTP VPN-only system for CentOS #
# For more information please visit https://blog.linuxeye.com/31.html #
#######################################################################
"[ ! -e '/usr/bin/curl' ] && yum -y install curl
VPN_IP=`curl ipv4.icanhazip.com`
VPN_USER="linuxeye"
VPN_PASS="linuxeye"VPN_LOCAL="192.168.0.150"
VPN_REMOTE="192.168.0.151-200"while :; do echo
read -p "Please input username: " VPN_USER
[ -n "$VPN_USER" ] && break
donewhile :; do echo
read -p "Please input password: " VPN_PASS
[ -n "$VPN_PASS" ] && break
done
clearif [ -f /etc/redhat-release -a -n "`grep ' 7\.' /etc/redhat-release`" ];then
#CentOS_REL=7
if [ ! -e /etc/yum.repos.d/epel.repo ];then
cat > /etc/yum.repos.d/epel.repo << EOF
[epel]
name=Extra Packages for Enterprise Linux 7 - \$basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/\$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=\$basearch
failovermethod=priority
enabled=1
gpgcheck=0
EOF
fi
for Package in wget make openssl gcc-c++ ppp pptpd iptables iptables-services
do
yum -y install $Package
done
echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf
elif [ -f /etc/redhat-release -a -n "`grep ' 6\.' /etc/redhat-release`" ];then
#CentOS_REL=6
for Package in wget make openssl gcc-c++ iptables ppp
do
yum -y install $Package
done
sed -i 's@net.ipv4.ip_forward.*@net.ipv4.ip_forward = 1@g' /etc/sysctl.conf
rpm -Uvh http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
yum -y install pptpd
else
echo -e "\033[31mDoes not support this OS, Please contact the author! \033[0m"
exit 1
fiecho "1" > /proc/sys/net/ipv4/ip_forward
sysctl -p /etc/sysctl.conf
[ -z "`grep '^localip' /etc/pptpd.conf`" ] && echo "localip $VPN_LOCAL" >> /etc/pptpd.conf # Local IP address of your VPN server
[ -z "`grep '^remoteip' /etc/pptpd.conf`" ] && echo "remoteip $VPN_REMOTE" >> /etc/pptpd.conf # Scope for your home network
[ -z "`grep '^stimeout' /etc/pptpd.conf`" ] && echo "stimeout 172800" >> /etc/pptpd.confif [ -z "`grep '^ms-dns' /etc/ppp/options.pptpd`" ];then
cat >> /etc/ppp/options.pptpd << EOF
ms-dns 223.5.5.5 # Aliyun DNS Primary
ms-dns 114.114.114.114 # 114 DNS Primary
ms-dns 8.8.8.8 # Google DNS Primary
ms-dns 209.244.0.3 # Level3 Primary
ms-dns 208.67.222.222 # OpenDNS Primary
EOF
fiecho "$VPN_USER pptpd $VPN_PASS *" >> /etc/ppp/chap-secrets
ETH=`route | grep default | awk '{print $NF}'`
[ -z "`grep '1723 -j ACCEPT' /etc/sysconfig/iptables`" ] && iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 1723 -j ACCEPT
[ -z "`grep 'gre -j ACCEPT' /etc/sysconfig/iptables`" ] && iptables -I INPUT 5 -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -o $ETH -j MASQUERADE
iptables -I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356
service iptables save
sed -i 's@^-A INPUT -j REJECT --reject-with icmp-host-prohibited@#-A INPUT -j REJECT --reject-with icmp-host-prohibited@' /etc/sysconfig/iptables
sed -i 's@^-A FORWARD -j REJECT --reject-with icmp-host-prohibited@#-A FORWARD -j REJECT --reject-with icmp-host-prohibited@' /etc/sysconfig/iptables
service iptables restart
chkconfig iptables onservice pptpd restart
chkconfig pptpd on
clearecho -e "You can now connect to your VPN via your external IP \033[32m${VPN_IP}\033[0m"
echo -e "Username: \033[32m${VPN_USER}\033[0m"
echo -e "Password: \033[32m${VPN_PASS}\033[0m"
电脑配置v/p/n上网教程
1、打开网络和共享中心,点击创建新的连接或网络。
2、选择链接到工作区。
3、点击默认Internet连接。
4、输入IP,点击下一步。
5、输入用户名和密码,就是刚才配置的账号。
6、正在连接,等待一会。
7、提示连接成功,你的IP变成美国的,此时你就可以正常访问谷歌网站了。如果要切换成本地网络,无线热点列表里取消V_P_N就行了。
手机配置v/p/n上网教程
现在手机上网率比电脑高了,办公时一些被/墙的网站无法打开,需要手机来翻/墙访问。
1、打开手机设置,就是wifi、移动网络、飞行模式、v/p/n,有的v/p/n在其它无线连接一栏,点击v/p/n,添加。
2、每个版本不一样,但设置方法基本想同,设置一个名称,类型选择pp/tp,输入IP地址储存,勾选
3、点击储存的v/p/n名称,输入VPN用户名和密码,连接。
4、提示连接成功,然后手机左上角多了一个v/p/n的标识,你就可以访问国外网站了。
PS:
一般选择VPS主机,都是选择美国的机房,速度还快一些。如果遇到连接不上,一定是主机出了问题,只要配置成功,一般都不会产生连接失败的情况。有也是暂时的,有时网络抽风。
VPS主机选购大全:https://www.duimin.com/15.html
您可以选择一种方式赞助本站
支付宝扫一扫赞助
微信钱包扫描赞助
赏