Hi,
I have internet cafe where I have two internet connections. One connection works with proxy, so I have to store proxy in client computers to get the internet running.
The second internet connection does not require proxy. So, when I need to connect the second connection then I have to disable proxy from all my client computers.
Can you please look at the attached picture. You may understand more from it.
I’m assuming you are doing load balancing then with the two connections?
What you have there is a bit of a complex setup to get what you want, though with the PCC firewall matcher, you should be able to hammer something out.
Basically what you are going to want to do is determine what ratio of traffic you want going out one connection vs the other, and then use NAT rules to redirect connections going out of one link to the proxy.
So lets assume you are doing 2/1 for load balancing with PCC. This will set you up for load balancing across both links.
Then you have to start using the transparent proxy on the link that you want. The best way to do this is by using NAT rules to redirect people transparently to your proxy, so they aren’t even aware that they are using it. It is very important that you use the same PCC classifiers and values that you do in mangle as in NAT so that they hash to the same value.
Then set up a NAT rule that you will enable when you unplug a port, or enable the NAT rule with a script on a link failure. Just modify the NAT rule to fit into your situation.
On the first router add redirect rules for traffic you want to proxy to be rerouted to port 8080, e.g. port 80 for any destination needs to go to your routers LAN IP to port 8080
The second router you should setup as required to provide internet access without proxy.
Now you can choose the configuration by setting the default gateway on the computers to one router or the other.
Add 1 rule for each computer:
/ip firewall nat add chain=dstnat action=redirect to-ports=8080 protocol=tcp dst-port=80 src-address=192.168.1.1
/ip firewall nat add chain=dstnat action=redirect to-ports=8080 protocol=tcp dst-port=80 src-address=192.168.1.2
…and so on
Now force the local http from proxy to use wan1:
First mark the packets:
/ip firewall mangle add action=mark-routing chain=output dst-port=80 new-routing-mark=PROXIED passthrough=yes protocol=tcp
And then define a gateway for them:
/ip route add 0.0.0.0/0 gateway=wan1 routing-mark=PROXIED
Set the default gateway to wan2:
/ip route add 0.0.0.0/0 gateway=wan2
Now all that passes the proxy will go out via wan1, anything else via wan2.
You just have to enable/disable the redirect firewall routes for the needed computers which is done easy using Winbox or the web interface.
All computers with enabled redirect will go via proxy and wan1, the others directly via wan2.
You probably mean that your parent proxy needs authentication.
Transparent proxies can not use authentication (because they are… duh… transparent).
AFAIK RouterOs can not do that.