Mikrotik with external proxy

Dear,

I have the following structure:

DSL modem → MK RouterOS 3.30 → Hosts → Squid Proxy

I want every request that comes in the port 80 is
redirected to port 3128 which is an external proxy.
Which rule should I use for this? Dstnat already tried but failed.

Then you set up the rule wrong.

Post a network diagram and the configuration you tried.

Ok!

My structure:

DSL Modem
|
|
Mikrotik RouterOS 3.30
|
|
Switch -------------------------Proxy (Debian + Squid + Sarg)
|
|
Clients

I need to make daily reports to the SARG and occurs parent proxy with the following situation: When I create reports appears only IP Mikrotik as it is who consults the proxy.
I want to make the hosts to query the proxy and not theMikrotik well as IP hosts appear in SARG reports. I tried to make the following rule

/ Ip firewall nat add chain = src-dstnat address = 192.168.0.0/24 protocol = tcp dst-port = 80 action =dst-nat to-addresss = 192.168.0.254 to-ports = 3128

But it did not work, do not know how to do this work.

You need to adjust your layout. Move your Squid machine to another IP subnet such as 192.168.1.254. The redirect through the MikroTik should work after that.

/ip firewall nat
add chain=dstnat action=dst-nat protocol=tcp src-address=192.168.0.0/24 dst-port=80 to-addresss=192.168.1.254 to-ports=3128

Make sure you define the http_port parameter in Squid.conf with the ‘transparent’ option.

http_port 3128 transparent

Thanks Blake!

I moved the network proxy rule dstnat did and it worked. I did test creating reports in SARG is working. Solved :smiley:.

Hi eroberti, I’m new mikotik and Linux. Thanks to the mikrotik forum I managed to redirect http traffic to squid box. My scenario is as follows:

In reviewing the records of Sarg only see the MikroTik IP (192.168.0.1). As I can implement the solution provided by blake.

I could focus on how to make this implementation?

thank you very much