question about proxy

Hi

I have this:

2 wan connection 10.10.10.5/29 gateway=10.10.10.1 (ether 1) and 10.10.10.10/29 gateway=10.10.10.9 (ether2)
2 lan network 192.168.1.1/24 (ether3) and 192.168.2.1/24 (ether4)

src address 192.168.1.0/24 = masquerade
src address 192.168.2.0/24 = masquerade

mangle: src addres 192.168.2.0/24 action= mark routing = to ether 2

routes= 0.0.0.0/0 gateway 10.10.10.1
0.0.0.0/0 gateway 10.10.10.9 routing mark=to router 2
until here all its fine

but when i active the proxy : NAT= chain dstnat src addres 192.168.2.0/24 protocol tcp dst port 8080 action=redirect to port 8080
and web proxy settings enable yes port 8080 all the web access work fine but network 192.168.2.0/24 goes by wan1

Once you use the proxy the src-address for the web traffic is no longer the client’s IP, but the router’s IP address since the router proxy goes out on behalf of the client and fetches the content.

yes but when redirect to por 8080 is active the network 192.168.2.0/24 goes by wan1 and I need to still by wan2

Right, so you need to use mangle to set routing marks for traffic in the ‘output’ chain to mark the traffic caused by the proxy to go out wan2.

Got it. But I add a new mangle: chain ‘output’ action routing mark= to ether2 and I lost internet, so i change this rule (dst-port 8080 action routing mark= to ether2 and i get internet but i check in whatismyip.com and I see the wan1. Or change in interface= network 2 and a lot of stuff that I think can need but still going wan2) any suggestion? :frowning:



Thanks!!!

Can you please post your actual rules instead of describing them?

One approach is to add a bridge as a loopback device, add an IP address to it, and set the src-address of the proxy to that loopback IP. That gives an easy way to track proxy connections. Something like this:

/interface bridge
add name=loopback
/ip address
add address=10.255.255.255/32 interface=loopback
/ip proxy
set src-address=10.255.255.255
/ip firewall mangle
add chain=output src-address=10.255.255.255 action=mark-routing new-routing-mark=to_ether2

I did the config that you give me but still going by wan1.

this is mi config, all what you see is all i get thanks.
Dibujo3.JPG
Dibujo2.JPG
Dibujo.JPG

this is the rest :smiley:
Dibujo6.JPG
Dibujo5.JPG
Dibujo4.JPG