v2ray openwrt ipset

移动宽带最大的缺陷在于UDP限制,玩游戏需要UDP不断联服务器,但这宽带,看你连得多,一般30分钟就给你断流,还只断UDP,每次都是快到决赛圈就掉线,无线重复,跳楼,加血,跑,然后又自动回到那楼上,往复7、8遍,小孩看来就是喜剧片,我就……

把xboxone加到ss里到是可以一直玩,但是延时较高。可能墙对ss+混淆的干扰比较严重。试试别的看看。

v2ray

1、整之前先看看指南   、说明  、问题

下载,都是编译好的,按需要下载就行。openwrt 下
v2ray-linux-mips64.zip,用_softfloat的,改下名就行。

2、VPS config.json

wp更新后找不到<code>去哪输了,如果是中文符号出错自己改一下。格式也是乱七八糟。

{
"inbounds": [{
"port": 端口, //自己随便定一个,必须随便啊
"listen": "ip", //IP地址,ipv6、4都行
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "随便长点", //看说明生成一段特长的乱码,相当于密码
"level": 1,
"alterId": 64,
"security": "auto"
}
]
},
"streamSettings": { //下面是所谓http伪装,个人感觉也伪装不了啥
"network": "tcp",
"tcpSettings": {
"header": {
"type": "http",
"response": {
"version": "1.1",
"status": "200",
"reason": "OK",
"headers": {
"Content-Type": ["application/octet-stream", "application/x-msdownload", "text/html", "application/x-shockwave-flash"],
"Transfer-Encoding": ["chunked"],
"Connection": ["keep-alive"],
"Pragma": "no-cache"
}
}
}
}
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
},{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}


3、openwrt config.json

{
"log": {"loglevel": "warning"
},

"inbounds": [{
"port": 随便, "listen": "0.0.0.0", "protocol": "dokodemo-door", "settings": { "network": "tcp,udp", "timeout": 300, "followRedirect": true }}],
"outbounds":
[{"protocol": "vmess", "settings": { "vnext": [ { "address": "VPS IP", "port": VPS端口, "users": [ { "id": "VPS id", "alterId": 64, "security": "auto" } ] } ] }, "streamSettings": { "network": "tcp", "tcpSettings": { "header": { "type": "http", "request": { "version": "1.1", "method": "GET", "path": ["/"], "headers": { "Host": ["www.bing.com", "ixbox.cn"], "User-Agent": [ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36", "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46" //这些都可以随便改 ], "Accept-Encoding": ["gzip, deflate"], "Connection": ["keep-alive"], "Pragma": "no-cache" } } } } }, "tag": "direct"},{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}],
"routing": {
"domainStrategy": "IPOnDemand",
"rules":[
{
"type": "field",
"ip": ["geoip:cn",
"geoip:private"],
"outboundTag": "direct"
},
{
"type": "field",
"outboundTag": "direct",
"domain": ["skype.com",
"xsts.auth.xboxlive.com",
"clubhub.xboxlive.com",
"titlestorage.xboxlive.com",
"inventory.xboxlive.com",
"profile.xboxlive.com",
"privacy.xboxlive.com",
"social.xboxlive.com",
// "userpresence.xboxlive.com",
"win10fore.ndlmix.ourdvs.com",
"v10.events.data.microsoft.com",
"forzaplayercardstorage.blob.core.windows.net",
"xboxlive.cn",
"geosite:cn"]
}
]
},
"dns":
{"hosts": { // Blacklist all Baidu domains, including all sub domains. //"domain:baidu.com": "127.0.0.1" }, "servers": [ { "address": "自己的dns", "port": 53, "domains": [ //"domain:v2ray.com" ] }, "localhost" ]},
"policy": {
"levels": { "0": { "uplinkOnly": 0, "downlinkOnly": 0 } }, "system": { "statsInboundUplink": false, "statsInboundDownlink": false }},
"other": {}
}

4、ipset #fclist 是列表,咋建看以前的文章

iptables -t nat -A zone_lan_prerouting -p tcp -m set --match-set fclist dst -j REDIRECT --to-port openwrt的v2ray端口

iptables -t nat -A zone_lan_prerouting -p udp -m set --match-set fclist dst -j REDIRECT --to-port openwrt的v2ray端口

5、xboxone 玩游戏就这样

把这些放到启动里

iptables -t nat -N V2RAY

iptables -t nat -A V2RAY -d 0.0.0.0/8 -j RETURN

iptables -t nat -A V2RAY -d 10.0.0.0/8 -j RETURN

iptables -t nat -A V2RAY -d 100.64.0.0/10 -j RETURN

iptables -t nat -A V2RAY -d 127.0.0.0/8 -j RETURN

iptables -t nat -A V2RAY -d 169.254.0.0/16 -j RETURN

iptables -t nat -A V2RAY -d 172.16.0.0/12 -j RETURN

iptables -t nat -A V2RAY -d 192.168.0.0/16 -j RETURN

iptables -t nat -A V2RAY -d 224.0.0.0/4 -j RETURN

iptables -t nat -A V2RAY -d 240.0.0.0/4 -j RETURN

iptables -t nat -A V2RAY -d 239.255.255.250 -j RETURN

建立/etc/init.d/xbox

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
# ref http://ixbox.cn

START=99

SERVICE_USE_PID=0

start() {

iptables -t mangle -N V2RAY
iptables -t mangle -N V2RAY_MARK
ip route add local 0.0.0.0/0 dev lo table 100
ip rule add fwmark 0x01/0x01 table 100

iptables -t mangle -A V2RAY -p udp -s xboxone的IP --dport 53 -j TPROXY --on-port openwrtv2ray的端口 --tproxy-mark 0x01/0x01

iptables -t mangle -A V2RAY_MARK -p udp -s xboxone的IP --dport 53 -j MARK --set-mark 1

iptables -t mangle -A PREROUTING -p udp -s xboxone的IP -j V2RAY
iptables -t mangle -A OUTPUT -p udp -s xboxone的IP -j V2RAY_MARK

iptables -t nat -A V2RAY -p tcp -s xboxone的IP -j REDIRECT --to-ports openwrtv2ray的端口
iptables -t nat -A PREROUTING -p tcp -s xboxone的IP -j V2RAY
iptables -t nat -A OUTPUT -p tcp -s xboxone的IP -j V2RAY
}

stop() {
iptables -t nat -D OUTPUT -p tcp -s xboxone的IP -j V2RAY
iptables -t nat -D PREROUTING -p tcp -s xboxone的IP -j V2RAY
iptables -t nat -D V2RAY -p tcp -s xboxone的IP -j REDIRECT --to-ports openwrtv2ray的端口

iptables -t mangle -D V2RAY -p udp -s xboxone的IP --dport 53 -j TPROXY --on-port openwrtv2ray的端口 --tproxy-mark 0x01/0x01

iptables -t mangle -D V2RAY_MARK -p udp -s xboxone的IP --dport 53 -j MARK --set-mark 1

iptables -t mangle -D PREROUTING -p udp -s xboxone的IP -j V2RAY
iptables -t mangle -D OUTPUT -p udp -s xboxone的IP -j V2RAY_MARK
ip route del local 0.0.0.0/0 dev lo table 100
ip rule del fwmark 0x01/0x01 table 100
iptables -t mangle -X V2RAY
iptables -t mangle -X V2RAY_MARK
}

玩游戏时/etc/init.d/xbox start ,玩完时/etc/init.d/xbox stop,下载时记得stop。联机速度上比ss需要快一些,也就是延迟低一点。

发表评论