机上多ip,监听于0.0.0.0,但是出口ip (即outbound中的sendThrough)不能简单设置成入口ip而导致配置文件复杂且臃肿 #2418
whatbugsyou
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
在服务端进行配置的时候遇到了此问题。
具体情况是:
机器中有多个ip都需要开启监听服务,所以我使用0.0.0.0作为inbound配置中的listen。
我希望从具体的入口ip比如1.1.1.1 进来的流量,通过v2ray服务之后,也能从1.1.1.1出去。同理2.2.2.2进2.2.2.2出。
所以我在outbound中的sendThrough也配置0.0.0.0。
但是事与愿违。数据只会从同一个ip出去,具体会根据机器上的默认路由来决定(我想是因为程序中建立socket没有指定localAdress)。
为了达到我希望的目的。我修改了配置,且成功了。
单独配置多个inbound,监听1.1.1.1 、监听2.2.2.2 等。配置多个outbound,sendThrough 1.1.1.1 、sendThrough 2.2.2.2等。然后通过路由配置,inboundTag 对应 outboundTag,约束入口ip=出口ip。
但是看上去,这并不是非常的方便,当ip比较多的时候,配置文件将会复杂且臃肿。并且可能会增加程序中路由匹配的压力,导致代理速度变慢。
所以我建议,outbound的sendThrough参数,可以设置为theSameAsListen。
Beta Was this translation helpful? Give feedback.
All reactions