Replies: 8 comments 3 replies
-
Actually |
Beta Was this translation helpful? Give feedback.
-
To prevent looping, consider implementing policy-based routing. For instance, you can designate a separate routing table for "proxy" connections that have different source addresses compared to "direct" connections. |
Beta Was this translation helpful? Give feedback.
-
Yes. With the above configuration, there will be two routers in your local network. Router B will act as a secondary or 'side' router, while the outbound traffic from Router B itself will still be handled by the primary router. |
Beta Was this translation helpful? Give feedback.
-
If your primary router supports Docker, you could even consider deploying Router B within a container. Inside the container, you can create the tun0 interface and set up the routing tables. |
Beta Was this translation helpful? Give feedback.
-
Truth be told, I have a raspberry Pi as my primary router which I intend to use this config on. So there won't be two routers and I should not need to manually set each client's gateway. But I do see the merit in having a gateway separate from the main router. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Finally got a chance to try your suggestions. |
Beta Was this translation helpful? Give feedback.
-
tun config only available in the still incomplete v5 config? V2Ray 5.16.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.22.2 linux/amd64)
A unified platform for anti-censorship.
Using confdir from env: /etc/v2ray
Test failed: main/commands: failed to load config: [/etc/v2ray/config.json /etc/v2ray/config.json] > infra/conf/v4: Cannot load service > infra/conf/v4: |
Beta Was this translation helpful? Give feedback.
-
@hann-wang Hello routing master! I've a quirky question for you: When using a single machine, tun2socks works fine. Here's my routing setup on Mac: (
I really appreciate your thoughts on this. 🙏 |
Beta Was this translation helpful? Give feedback.
-
Would a gentleman please give me the simplest config to use the Tun service with sniffing capabilities to route some domains directly and some others to a Socks proxy?
Moreover, how would you setup linux routing to avoid "direct" connections looping back into V2 indefinitely?!
I tried binding freedom to another interface but my default route was still feeding "direct" connections into V2, using tun2socks, not the new Tun service, however.
Providing a guide for this case could serve other devs as well, since they could use the new V2 format just for the Tun setup with sniffing, and passing on the rest to an older V2 version without having to rewrite their config files.
Here's the config file that I thought would work but kept giving me
panic: runtime error: invalid memory address or nil pointer dereference
as soon as it received any packets.Worth mentioning that it wouldn't parse the config with
"destOverride": ["http", "tls"]
, even though the new docs mention it to be valid.And here is my simple routing for when no direct connections are required:
Beta Was this translation helpful? Give feedback.
All reactions