|
好像是这个月初,电报圈里面的童鞋都发现自己的mtp代理都不好使了!大家经过了一番讨论后,怀疑是一种神秘的东方力量让普通的mtp连不上了。
挺久之前,我在x-air的频道上面看到了他们写的v2ray转换mtp的配置文件,但是用的人不多。现在封锁变得越来越严,是时候普及一下墙内中转mtp了。
要搭建墙内中转mtp,首先要一台墙内的服务器,当然如果你家里的网路有公网ip,你甚至可以在家里搭建!墙内的服务器价格普遍较高,不过电报只是一个聊天软件,几M的网速就可以满足正常的使用的啦!如果你是学生,去买一个阿里云学生机吧,一个月9.5就可以买得到!( https://promotion.aliyun.com/ntms/act/campus2018.html https://promotion.aliyun.com/ntms/act/campus2018.html )
https://telegra.ph/file/6f14cda026978b94587c5.png阿里云学生机只需要9.5/月除了墙内的服务器,你还需要一个v2ray账号。要获得v2ray账号,首先就要去搭建一个v2ray服务器,搭建方法可以去看官网 http://www.v2ray.com]www.v2ray.com 。因为搭建v2ray还要再买一个服务器,比较贵,我建议大家去机场买v2ray账号。比如我现在正在用的 X-Air ( https://www.x-air.org/register?aff=3558https://www.x-air.org/register?aff=3558 ,这个链接可以免费领取13g的流量还有3天试用),这家的节点速度都不错,不过用在电报代理上最好用新加坡阿里云的节点,听群里大佬说这节点对电报有奇效,延迟很低,比hkt、azure香港还要低。
https://telegra.ph/file/2e4a69d0f0dd252c5c88c.pngX-Air月费19.8,年付可以优惠到15/月,还算良心了有了服务器还有v2ray,现在就一起搭建更稳定的墙内中转mtp吧。
如果你用的是阿里云,就必须要把内置的安骑士给干掉,否则几天后你会看到这样一封邮件:
您好 ,接主管部门通知,您的主机存在通过技术手段使其成为境内获取境外非法信息的途径等行为,根据《互联网信息服务管理办法》第十五条规定九不准内容及阿里云服务条款3.1.3.11.请您在二十四小时内停止上述行为,并做好自查。如逾期未处理或再次收到通知,阿里云将按要求及规定停止对您提供服务。 [color=rgba(0, 0, 0, 0.8)]使用XShell登陆上你的服务器,然后输入下面的代码: wget http://update.aegis.aliyun.com/download/uninstall.shchmod +x uninstall.sh./uninstall.shwget http://update.aegis.aliyun.com/download/quartz_uninstall.shchmod +x quartz_uninstall.sh./quartz_uninstall.shpkill aliyun-servicerm -fr /etc/init.d/agentwatch /usr/sbin/aliyun-servicerm -rf /usr/local/aegis*[color=rgba(0, 0, 0, 0.8)]上面的代码是用来删除云服务器里面的安骑士软件,防止被封号。 [color=rgba(0, 0, 0, 0.8)]把偷窥狂魔剔除出服务器之后就可以去安装v2ray了。 [color=rgba(0, 0, 0, 0.8)]v2ray的安装很简单,下载 [color=inherithttps://github.com/v2ray/v2ray-core/releases/download/v4.18.0/v2ray-linux-64.ziphttps://github.com/v2ray/v2ray-core/releases/download/v4.18.0/v2ray-linux-64.zip 然后解压,把里面的v2ray v2ctl两个文件上传到服务器里面,或者在服务器里面执行代码: mkdir mtpcd mtpwget https://github.com/v2ray/v2ray-core/releases/download/v4.18.0/v2ray-linux-64.zipunzip v2ray-linux-64.zip[color=rgba(0, 0, 0, 0.8)]ps: 如果下载太慢,可以试一下x-air的镜像: [color=rgba(0, 0, 0, 0.8)][color=inherithttps://xairforge.cloudns.asia/v2client/lix/v2ray-linux-64.ziphttps://xairforge.cloudns.asia/v2client/lix/v2ray-linux-64.zip [color=rgba(0, 0, 0, 0.8)]之后输入 ls 命令,你就可以看到文件夹里面已经有v2ray 和 v2ctl 两个文件了。 出现 -bash: unzip: command not found , 这该怎么办呢?百度了一下发现需要先安装unzip。执行代码:apt-get install unzip (ubuntu等系统)yum install unzip (centos等系统)[color=rgba(0, 0, 0, 0.8)]为了安全,我们把v2ray文件重命名一下: mv v2ray aliyun[color=rgba(0, 0, 0, 0.8)]这样我们把v2ray文件重命名为了aliyun,希望阿里云不要把它当成是翻墙软件吧呵呵呵... [color=rgba(0, 0, 0, 0.8)]接下来我们需要替换掉原来的配置文件config.json。先把下面的配置文件复制到文本编辑器里面。 { "policy": { "levels": { "0": { "uplinkOnly": 0 } } }, "dns": { "servers": [ "1.1.1.1" ] }, "outboundDetour": [ { "tag": "tg-out", "protocol": "mtproto", "settings": {}, "proxySettings": { "tag": "v2-out" } } ], "inbound": { "tag": "tg-in", "port": 2333,//这个是MTP代理的端口 "protocol": "mtproto", "settings": { "users": [ { "secret": "23333333333333333333333333333333"//这个是mtp代理的密码,格式是32位的使用阿拉伯数字和字母abcdef组成的密码 } ] } }, "log": { "loglevel": "debug" }, "routing": { "strategy": "rules", "settings": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "inboundTag": [ "tg-in" ], "outboundTag": "tg-out" } ] } }, "outbound": { "tag":"v2-out", "sendThrough": "0.0.0.0", "mux": { "enabled": false, "concurrency": 8 }, "protocol": "vmess", "settings": { "vnext": [ { "address": "www.baidu.com",//v2ray服务器的地址 "port": 23333,//v2ray服务器的端口 "users": [ { "id": "00000000-0000-0000-0000-000000000000",//你的uuid "alterId": 2, "security": "auto", "level": 2 } ], "remark": "NodeName" } ] }, "streamSettings": { "network": "tcp",//这个是传输协议,tcp或者ws "security": "" } }}[color=rgba(0, 0, 0, 0.8)]在文本编辑器里面替换掉上面的配置信息(mtp代理的端口密码,你的v2ray账号信息等),然后保存为config.json [color=rgba(0, 0, 0, 0.8)]接下来使用winscp吧config.json上传到刚刚的mtp文件夹里面,替换掉原来的。当然高手也可以用命令行的vim编辑器,不过操作比较麻烦。 [color=rgba(0, 0, 0, 0.8)]现在已经配置好了,可以运行了,请执行 chmod +x aliyunchmod +x v2ctl./aliyun[color=rgba(0, 0, 0, 0.8)]r如果没有发现什么报错,配置就是成功的了。为了让他在后台执行,我们可以先按ctrl+c,退出当前程序,执行下面的代码: nohup ./aliyun >> /dev/null 2>&1 &[color=rgba(0, 0, 0, 0.8)]这样就可以让他在后台运行了。如果你是高手,你可以自己写一个脚本来快速启动。 [color=rgba(0, 0, 0, 0.8)]z在电报客户端里面,新建一个mtp代理: z在电报客户端里面,新建一个mtp代理:
https://telegra.ph/file/5e2d3fa474a8b8436aae8.png按照上面的图来填,填完点done发现连不上?原来忘记关掉防火墙或者安全组了!关掉之后就可以正常用啦!
关闭防火墙代码:systemctl disable firewalldsystemctl stop firewalld
|