Re: [squid-users] CAN TCP_OUTGOING_ADDRESS BIND TO ETH1? How to make D-S-L work on a machine with static routings?

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 26 May 2011 23:51:47 +1200

On 26/05/11 23:21, Jenny Lee wrote:
>
> Hello Squid Users,
>
> I have a machine that has static connections (running apache, vsftpd, etc).
>
> Upstream bandwidth is costly, so I would like to use our D-S-L connection to save up on some traffic.
>
> On D-S-L line, IP changes at each authentication [(PPPoE authentication using a secondary IP route table). I am using a secondary route table as follows:
>
> echo '101 d-s-l'>> /etc/iproute2/rt_tables
> ip rule add from 192.168.1.64 table d-s-l
> ip route add default via 192.168.1.254 table d-s-l
> ip rule add from 192.168.1.0/24 table d-s-l
>
> squid: tcp_outgoing_address 192.168.1.64
>
> [192.168.1.64 being ppp interface IP, 192.168.1.254 being DSLAM IP from telco]
>
> This works.
>
> However, on PPPoE, end points are not known beforehand so I cannot attach squid outgoing.
>
> Machine has eth0, eth1, and ppp (over eth1). eth0 is static server IP where main routing is done. D-S-L is on eth1 via ip route table above.
>
> Is it possible to bind squid to an interface?

Squid uses the bind() API to the kernel. So no.

>
> I think this sounded absurd :) Other option probably tcp_outgoing_tos/mark?

Have you tried to get it working without Squid needing a particular
sending IP? When Squid leaves the IP selection up the the OS its should
be given the primary box IP as of the time of the connection setup. Most
software use bind()/connect() just like Squid, so will also be having
problems on your box if Squids default wont work.

As a kludge workaround you can add an OS trigger on ppp-up/down to
reconfigure Squid.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.12
   Beta testers wanted for 3.2.0.7 and 3.1.12.1
Received on Thu May 26 2011 - 11:51:54 MDT

This archive was generated by hypermail 2.2.0 : Thu May 26 2011 - 12:00:03 MDT