Page 1 of 1

Problems with squid proxy and mikrotik firewall

Posted: Wed Sep 30, 2009 12:47 am
by andrescamino
Hi,

I have a problem to redirect the mikrotik router to the port 3128 of the squid in another machine, I would like to know what do I have to change in my configuration:

Initially I have a proxy server in CentOS with squid and Firestarter (which makes NAT), the port that squid is listening is 3128
I have also a mikrotik router with NAT to pass the internet to my computer but in order to actually have internet in my computer i have to configure the proxy settings in my browser.

Then I tried to configure those settings inside of the router to make it transparent to the computers and not change the browser configurations in every computer. I tried this

/ip firewall nat add chain=dstnat dst-address=192.168.2.1/32 port=6(tcp) dst-port=80 in-interfaces=ether1 action=redirect to-port=3128

where 192.168.2.1 is the gateway to reach the squid in my centos proxy

When I take out the proxy settings in my web browser I donĀ“t have internet, I still need the browser configuration.
Can you give me any suggestion to make it transparent from the router and not from the squid itself?

Thanks for your advices in advance

Re: Problems with squid proxy and mikrotik firewall

Posted: Wed Sep 30, 2009 3:29 am
by kthameen
Hi,

You need to make your squid ready to interecpt packets sent from mk so u just need to edit your squid.conf file which should be in this dir on centos /usr/local/squid/etc and add the word "transparent" after "http_port 3128" then reconfigure squid or restart it, best regards

Re: Problems with squid proxy and mikrotik firewall

Posted: Wed Sep 30, 2009 4:56 pm
by andrescamino
Hi kthameen,

I actually did it, i added the "transparent" after the port and saved it then restarted the squid but still is not working.
Do you know what would be the problem?, thanks for your help
best regards

Re: Problems with squid proxy and mikrotik firewall

Posted: Thu Oct 01, 2009 5:02 pm
by andrescamino
Hi,

Is really any way to avoid making transparent the proxy and set the configuration to redirect to the port 3128 from the mikrotik router?

thanks

Re: Problems with squid proxy and mikrotik firewall

Posted: Sat Oct 03, 2009 2:19 pm
by kthameen
which squid version are you using ?

Re: Problems with squid proxy and mikrotik firewall

Posted: Wed Oct 14, 2009 4:51 pm
by maroon
did you solve your problem? please check the firewall rules.... on what port the squid is listening?

Re: Problems with squid proxy and mikrotik firewall

Posted: Tue Nov 10, 2009 4:53 am
by jfilippo
Maybe, if not misunderstood, IMHO, you have a conceptual error. You have to redirect to your Squid every request with dst-port 80, by means of a dst-nat, not a redirect, because de redirection direction must be the Squid expernal IP. If you did the "transparent" thing in squid.conf, try this rule in your Mikrotik:

/ip firewall nat
add action=dst-nat chain=dstnat comment="JFilippo - Prueba Proxy" disabled=no \
dst-port=80 protocol=tcp src-address=!10.1.0.192 to-addresses=10.1.0.192 \
to-ports=3128

In this export, my Squid server has the 10.1.0.192.

Good luck!

Re: Problems with squid proxy and mikrotik firewall

Posted: Wed Nov 11, 2009 7:27 pm
by andrescamino
Thanks you all guys....it worked