openwrt安装v2瑞的手动配置教程openwrt安装v2瑞及设置教程

2019-09-01
0评论
/
38272阅读
爱搜啊

v2瑞是个非常好用的上网工具,但是其安装和配置却比较复杂,客户端也不太完善,因此相对来说不太流行,这里就介绍一个较为简单的OpenWRT安装v2瑞使用方法,供大家参考。

openwrt安装v2瑞的手动配置教程

openwrt安装v2瑞

安装必要的组件

opkg update

opkg remove dnsmasq

rm -rf /etc/config/dhcp

opkg install dnsmasq-full

opkg install ipset iptables-mod-nat-extra

修改/etc/firewall.user,添加如下

ipset -N gfw iphash

iptables -t nat -A PREROUTING -p tcp -m set --match-set gfw dst -j REDIRECT --to-port 1080

修改/etc/dnsmasq.conf,添加如下

conf-dir=/etc/dnsmasq.d

创建/etc/dnsmasq.d/gfw.conf文件

vi /etc/dnsmasq.d/gfw.conf

内容如下(可自行添加或者找网上分享的gfwlist列表,注意一下格式)

server=/google.com/127.0.0.1#5353

ipset=/google.com/gfw

server=/youtube.com/127.0.0.1#5353

ipset=/youtube.com/gfw

server=/twitter.com/127.0.0.1#5353

ipset=/twitter.com/gfw

下载附件里面包含gfwlist列表

下载路由器对应架构的v2瑞执行文件

https://github.com/v2瑞/v2瑞-core/releases

或者

https://github.com/felix-fly/v2瑞-openwrt/releases

解压后把v2ctl、v2瑞上传到/usr/bin目录,记得把v2ctl、v2瑞权限修改为0755

创建/etc/init.d/v2瑞文件

vi /etc/init.d/v2瑞

内容如下

#!/bin/sh /etc/rc.common

# "new(er)" style init script

# Look at /lib/functions/service.sh on a running system for explanations of what other SERVICE_

# options you can use, and when you might want them.

START=99

SERVICE_USE_PID=1

SERVICE_WRITE_PID=1

SERVICE_DAEMONIZE=1

start() {

        service_start /usr/bin/v2瑞 -config=/etc/v2瑞/config.json

}

stop() {

        service_stop /usr/bin/v2瑞

}

修改/etc/init.d/v2瑞文件权限

chmod 755 /etc/init.d/v2瑞

设置开机启动

/etc/init.d/v2瑞 enable

创建/etc/v2瑞文件夹

mkdir /etc/v2瑞

创建/etc/v2瑞/config.json文件

vi /etc/v2瑞/config.json

大概内容如下(仅限在4.+以上版本使用)

{

        "inbounds":[

                {  //任意门,用于透明代理

                "protocol": "dokodemo-door", 

                "port": 1080, 

                "listen": "0.0.0.0", 

                "settings": {

                        "network": "tcp, udp", 

                        "timeout": 0, 

                        "followRedirect": true

                        }

                },

                { //任意门,备用dns解析

                "protocol": "dokodemo-door", 

                "port": 5353, 

                "settings": {

                        "address": "8.8.8.8", 

                        "port": 53, 

                        "network": "udp", 

                        "timeout": 0

                        }

                }

                        ],

        "outbounds":[

                {

                "protocol":"vmess",

                "settings":{

                        "vnext":[

                                {

                                "address":"1.1.1.1",

                                "port":3333,

                                "users":[

                                        {

                                        "id":"7e8bb2bc-958f-4ecd-ba03-8f1cdc4b3930",

                                        "alterId":32

                                        }

                                                ]

                                }

                                        ]

                                },

                "streamSettings":{

                        "network":"kcp",

                        "security":"none",

                        "kcpSettings":{}

                        }

                }

                        ]

}

避免配置文件有错误,用命令检查一下是否正确不报错。

v2瑞 -test -config=/etc/v2瑞/config.json

到此配置完成,重启路由

reboot

附件包含gfwlist列表文件和v2瑞的配置文件

ipset模式v2瑞的配置文件,解压后按照对应目录上传

gfwlist列表ipset模式v2瑞的配置文件


本站附件分享,如果附件失效,可以去找找看

诚通网盘附件百度网盘附件


标签: OpenWRT v2瑞
于2019-09-01发布