[squid-users] variable/macro, setting outgoing address

Matus UHLAR - fantomas uhlar at fantomas.sk
Thu Nov 26 16:24:25 UTC 2026


>On 26 November 2026 11:28:52 am UTC, Matus UHLAR - fantomas <uhlar at fantomas.sk> wrote:
>>This seems to be possible, although confusing in case of multiple ACLs to match.

On 26.11.26 16:04, Nishant Sharma wrote:
>For each ACL you can have separate outgoing address lines in the file.
>
>For AND match, you can have those ACLs on the same line.
>
>I hope I am able to understand your concern.

Aha... yes, I understand how ACLs work.

But keeping the same list of ACLs in separate file is a complication.
Your proposed "/special/host/file" and separate file containing:

tcp_outgoing_address x.x.x.x special_hosts

would be easy in case of routing requests from single list of source hosts 
via extra address.
If those acls were more complicated, the separate file would look like:

tcp_outgoing_address x.x.x.x src1 dst1
tcp_outgoing_address x.x.x.x src2 dst1
tcp_outgoing_address x.x.x.x src2 dst2

...and I'd have to maintain two these files on two extra hosts.
This is where macros/variables would make it easy for me.


For now I'm speculating about using:

tcp_outgoing_mark 0x10 [...]
[...]

iptables -t nat -A POSTROUTING -m mark --mark 0x10 -j SNAT --to-source $altsource


where I can include file containing $altsource to firewall config file.


-- 
Matus UHLAR - fantomas, uhlar at fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Silvester Stallone: Father of the RISC concept.


More information about the squid-users mailing list