Question about Squid proxy server:
I've just installed a squid cache server on a linux machine, the hierarchy is like this :
|
------------- ---------------------
| Mikrotik Box | | Cache Linux Server |
------------- ----------------------
| /
| /
----------------------
| Switch ( Cheap one ) |
----------------------
| | |
Client1 Client2 Client3 etc.
What i'm trying to do is, I want all the traffic regarding to port 80 from Client1,Client2,Client3 to be forwarded to my Cache server at port 8080.
I tried with redirect rule, but it seems it only maps ports on his own and can't redirect somewhere else.
Any idea how to do this?
Thanks
Answer:
action=redirect is used to redirect traffic to router itself.
http_port 3128 transparent
instead of
http_port 3128
Of course the command "http_port 3128" is the default squid proxy port configuration.
If you are using Webmin, you have to specify the option "transparent" on:
Servers -> Squid Proxy Server -> Ports and Networking
What happens should be the following:
1. the hotspot receives your request no the Wireless interface and nat it to the proxy server address and proxy server port (to do it you should have configured the ip firewall nat rules on the Mikrotik);
2. when the hotspot forwards the request to the proxy server, it is forwarded not with the original address, but with the address of the interface which communicates with the proxy as the source address (the WAN address??), and it happens even if you don't enable the webproxy feature on it;
3. then, if you at the moment on the proxy server have an access list which permits just the network configured on the hotspot interface, it could be not enough.
I hope this could help you.
2 chain=srcnat action=masquerade
src-address: 0.0.0.0
port: 8080
parent-proxy: 10.172.3.2
parent-proxy-port: 800
cache-administrator: ""
max-cache-size: none
cache-on-disk: no
max-client-connections: 1000
max-server-connections: 1000
max-fresh-time: 11h6m
serialize-connections: no
always-from-cache: yes
cache-hit-dscp: 4
cache-drive: system
Hope this helps.