Mark routing on outgoing packets to port 80 to your squid proxy. Then use iptables to redirect traffic on the linux box to port 8080. Make sure it's setup for transparent redirect.
Where 192.168.1.2 is the squid server...
/ip firewall mangle
add action=mark-routing chain=prerouting comment="" disabled=no dst-port=80 in-interface=LAN new-routing-mark=main passthrough=no protocol=tcp src-address=192.168.1.2
add action=mark-routing chain=prerouting comment="" disabled=no dst-port=80 in-interface=LAN new-routing-mark=squid-redirect passthrough=yes protocol=tcp src-address=192.168.1.0/24
/ip route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.2 routing-mark=squid-redirect scope=30 target-scope=10
On your linux box
iptables -t nat -A PREROUTING -s 192.168.1.0/24 -d ! 192.168.1.0/24 -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
thanks netrat
is this solution to my problem? after this config my squid log will show clients ip addresses not mikrotik ip. right?
I'll test it...
P.S
when I mangle web traffic that comes to LAN and route it to squid, evrythings works fine. access log shows clients ip addresses.
BUT the problem arises when clients connect to mikrotik using pppoe or pptp. squid access log shows mikrotik ip address as src address and I cannot analyze a specific user ip log...