How to redirect all traffic through a proxy without a loop?

FarelRA

New Member
Joined
Oct 13, 2023
Messages
1
Reaction score
0
Credits
13
I want to redirect all traffic from my apps and programs (including those that do not support proxies or VPNs) to a local HTTP/SOCKS proxy server, which will then redirect the traffic to an online proxy server.

I created the following network topology:

1.png



However, I want to avoid creating a loop, where the local proxy server redirects traffic to the redirector, which then redirects it back to the local proxy server.

2.png
 


jpnilson

Active Member
Joined
Jul 31, 2021
Messages
169
Reaction score
88
Credits
1,486
Check into using a via header. Outbound the header is added and checked for on the way back in. If it exists the packet is discarded
 
Joined
Jun 8, 2023
Messages
95
Reaction score
41
Credits
629
I think you can use iptable prerouting table for this. You must configure it on the router. Example(10.0.0.1 is the ip of the proxy server):
Code:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.0.0.1:80
iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 10.0.0.1:443
 

Members online


Latest posts

Top