IP routing & Squid

Hello, I have a Squid Proxy Web content filtering three subnets, the matter is that each subnet has a separate gateway and with the implementation of the proxy, all traffic is routed to a single link. Any idea how to fix it?

thanks

Because squid's a proxy, all squid retrievals originate on the host machine. With no way to differentiate between them, the same gateway is always used.

squid allows you to set the TOS of outgoing packets depending on the originating address of the request, though:

# example from squid.conf
acl normal_service_net src 10.0.0.0/255.255.255.0
acl good_service_net src 10.0.1.0/255.255.255.0
tcp_outgoing_tos 0x10 normal_service_net
tcp_outgoing_tos 0x20 good_service_net

Then you'd add routing policies to direct different TOSes into different gateways.

ip rule add tos 0x10 table conna
ip rule add tos 0x20 table connb

ip route add default via 192.168.1.1 table conna
ip route add default via 192.168.2.1 table connb

Modified from policy routing example

1 Like

I am having one HP ML350 server with 4 nic's and Fedora Linux 9.0 with squid 3.0 stable 2.6. we got two internet leased line connectivity. Both they have given gateways and thier own dns. So there are 2 gateway IP's, and 4 DNS IP's. I want to configure the squid server can access the internet through both ISP's simultaneously. and also , if one get failed, all the traffic send to other ISP. Normally the traffic should be shared on both ISP's. How can i Configure?