Answer the question
In order to leave comments, you need to log in
Redirecting host traffic to a local machine with a proxy, how?
Help to help configure the passage of host traffic through the gateway (linux) that is connected to the proxy server.
host > gateway > proxy
The task is very strange, but there is no other way out.
Tried to do it through iptables
iptables -t nat -A PREROUTING -s 192.168.0.0/24 -p tcp -m multiport --dports 80,8080,443 -j REDIRECT --to-ports 10808
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
2022/01/11 06:12:37 tcp:192.168.0.5:62481 rejected v2ray.com/core/proxy/socks: unknown Socks version: 22
Answer the question
In order to leave comments, you need to log in
You have redirected HTTP/HTTPS traffic to the SOCKS proxy port, which the SOCKS proxy does not expect (it expects a SOCKS client to come).
There are three possible solutions:
1. Make a redirect at the HTTP level, for this HTTPS will require a certificate substitution, traffic must be redirected to an http / https proxy, and then redirected from it further
2. For HTTP, do it at the HTTP level, for HTTPS take the destination name from SNI, redirect http to http proxy, redirect https to a separate port that SNI will do.
3. Use a proxy that supports transparent redirects
I don't know which of these supports v2ray, 3proxy supports options 1 and 3, squid supports option 2, I would recommend the third one. Further, from 3proxy, traffic can be redirected to the parent proxy, for example, to SOCKSv5 from v2ray. Discussed for example here:
https://3proxy.ru/plugins/TransparentPlugin/
https://github.com/3proxy/3proxy/issues/724
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question