Configure V2ray load balancing in OpenWrt

V2Ray load balancing

Some friends are right There is a bit of a wrong understanding of load balancing,Rather than choosing which line is faster, V2Ray's load balancing uses a polling method to balance the load. That is to say, when there is traffic that needs to pass throughWhen, first go to the first vnext configuration, then when there is a second connection, go to the second server, then the third, the fourth and so on. After polling once, start polling again.

It should be noted that inDuring load balancing, configuration items such as ports and IDs in the vnext array can be different, but their transport layer configurations (streamSettings) must be consistent, that is, the same transport protocol must be used.


{ "inbound": { ... }, "outbound": { "protocol": "vmess", "settings": { "vnext": [ { "address": "AAA", "port": 3721, " users": [ { "id": "d5d013f9-7ee2-4298-93bf-ad3fe7088296", "alterId": 64 } ] }, { "address": "BBB", "port": 4399, "users": [ { "id": "68f0d692-b1cf-439d-9979-eecccef741e9", "alterId": 64 } ] } // If there are more nodes, you can continue to add! ] }, "streamSettings": { ... } }, ... }

The above is the sample code for V2ray load balancing.

Configuration in OpenWrt V2ray load balancing

exist, configure load balancing in the V2ray service, if you have multiple v2ray services, you can use load balancing on OpenWrt.

First set the identification TAG for each outbound connection

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

For example, there are currently three outbound connections, and the identification tags are set to A/B/C respectively.

Then enter the routing settings page and check Balancers.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

After checking Balancers, add a rule in the routing rules""

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Fill in the load balancing identification name, save and apply it after filling in. In the routing options, check the newly added "proxy" and add it, then save the application.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Fill in balancer as the bottom mark, paying attention to capitalization. After filling in, click Save.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Then return to the global settings and check all outbound servers.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

After the configuration is complete, you canwebsite:https://ip.skk.moe/multi , check the IP addresses used when visiting places around the world.

score

Leave a Reply

Your email address will not be published. Required fields are marked *