Redirect to Proxy server through mikrotik router/firewall

I have router with three interfaces, like ibelow


Users 10.51.0.0/24 eth0 | MIkrotik Box | eth3 Internet

eth2
Proxy Server(Squid) IP-10.200.0.19:3218

Can anyone help me how to redirect all http (port 80) request from my users (10.51.0.0:80) to my Proxy Server port 3128 (10.200.0.19:3218)

I tried below but dosent work.?

3 src-address=10.51.0.0/24:0-65535 in-interface=eth0 dst-address=0.0.0.0/0:80 protocol=tcp icmp-options=any:any
flow=“” connection=“” content=“” src-mac-address=00:00:00:00:00:00 limit-count=0 limit-burst=0 limit-time=0s
action=redirect to-dst-address=10.200.0.19 to-dst-port=3218

action=redirect to-dst-address=10.200.0.19 to-dst-port=3218

tipo or the dst port isn’t what it should be ? 3218 instead of 3128 ?

and no need to specify DST-IP in a redirect rule as it concerns the router.
if it’s an other host then it’s NAT



from http://www.mikrotik.com/docs/ros/2.8/ip/nat.content :

Redirect and Masquerade
REDIRECT is similar to regular destination NAT in the same way as MASQUERADING is similar to source NAT - masquerading is source NAT, except you do not have to specify to-src-address - outgoing interface address is used automatically. The same is for REDIRECT - it is destination NAT where to-dst-address is not used - incoming interface address is used instead. So there is no use of specifying to-src-address for src-nat rules with action=masquerade, as well as no use of specifying to-dst-address for dst-nat rules with action=redirect. Note that to-dst-port is meaningful for REDIRECT rules - this is the port on which the service on router that will handle these requests is sitting (e.g. web proxy).

Patrick

its not possible that easy. see:

http://forum.mikrotik.com/phpbb2/viewtopic.php?t=62

Thanks for help pbailly but maybe mag is right.
I’v tried what you suggesed me but it still dosn’t work.?!!!

Fiu

  1. Action redirect only sends the traffic to the router itself - it ignores the to-dst-address field. Action nat is required to send the traffic to another machine.

  2. Search google for why was the transparent feature invented. You see, when you dst-nat packets to another proxy, the original dst-addresses are lost and the proxy have no idea where to sent them… That is why you must redirect the HTTP traffic to the local router’s HTTP proxy and set it up to use a patent proxy you want traffic to be proxied with. The local proxy has special kernel calls that enables it to find out the original destination of that packets.

i am planning a very similar scenario, one or a few mikrotiks running transparent web-proxy and asking a parent squid/apache web-proxy with large memory- and diskspace.

will this increase performance for slow links eg. 1 mbit/s to the customer and fast ethernet between mt and proxy, or will it only save traffic volume?