[tproxy] TPROXY but without bridging?

admin at abp.pl admin at abp.pl
Fri Mar 28 22:13:39 CET 2008


I'm using Squid Cache: Version 2.6.STABLE18

Is there posibility to use it as fully transprent proxy (with tproxy) but
without bridging interfaces?

My topology:

[router 0]---[Internet]
    |           |           |
[squid] [ router a ][ router b ] .....

to routers a,b... are connected clients. On that routers I have DNAT
--to-destiation squid:80

On squid machine i have 2.6.25-rc7 kernel and Squid with patches from

iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY \
                  --tproxy-mark 0x1/0x1 -on-port 3128
iptables -t mangle -N DIVERT
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
iptables -t mangle -A DIVERT -j MARK --set-mark 1
iptables -t mangle -A DIVERT -j ACCEPT
ip rule add fwmark 1 lookup 100
ip route add local dev lo table 100

http_port 3128 transparent tproxy
tcp_outgoing_address [machine ip]

When I test this configuration webservers logs connection from clients
from routers a,b... with ip of squid machine. So tproxy doesnt' work.

Can I fix it?

PS. It's urgent for me, please help;)

Tomasz Kolaj
Administrator sieci
ABP Computer

More information about the tproxy mailing list