[squid-users] Outgoing traffic through certain device instead of IP?

Amos Jeffries squid3 at treenet.co.nz
Sat Aug 12 09:52:53 UTC 2023


On 12/08/23 05:23, Robert 'Bobby' Zenz wrote:
> I'd like to send all the outgoing traffic from Squid through a certain
> network device instead of an IP. There's `tcp_outgoing_address` and
> `udp_outgoing_address` which only accepts an IP as parameter, but
> there's no way to use a certain device?

Squid is limited to selecting certain details of the TCP packets.
Device routing details are up to the operating system.

> 
> I just wanted to verify that there is currently no way to have a
> certain network device specified because I couldn't find anything about
> it in the documentation. 

You can have Squid can set dst-IP or TOS/QoS marking on packets. The OS 
routing services should be able to use those to do its selection.



My use-case here is that I have multiple
> OpenVPN tunnels open and use Squid to funnel traffic through them
> (including DNS queries which works great!). These OpenVPN tunnels all
> have their own network device, but the IP address might or might not
> change at some point, and when that happens Squid won't be able to
> forward traffic anymore. Of course I can work around that (OpenVPN
> `--ipchange` to fire a script when the IP changes), but I just wanted
> to check whether I've missed something here.

In this case, leaving the outgoing IP to the OS is best.
http://www.squid-cache.org/Doc/config/tcp_outgoing_mark/> is available 
to mark (aka classify in QoS terms) Squid traffic for the OS routing.

HTH
Amos


More information about the squid-users mailing list