Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In squid I need to combine acl conditions in one line:
e.g.
acl allowed_conn src 10.40.50.5 && dstdomain intranet.loc
acl allowed_conn src 10.40.50.6 && dstdomain anothersite.net

I know that I could instead define two like so:
acl allow_src src 10.40.50.5
acl allow_domain intranet.loc

And then I could do:
http_access allow allow_src allow_domain
but in this way I will need to create new http_access lines for different acl combinations. I would like to have one http_access line like so:
http_access allow allowed_conn

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Unfortunately, the fixed AND/OR logic of Squid's ACL list means that you can only implement an AND condition on the access line, not on the ACL line:

You've probably noticed (and been frustrated by) the fact that you cannot combine access controls with terms like "and" or "or." These operations are already built in to the access control scheme in a fundamental way which you must understand.

All elements of an acl entry are OR'ed together.
All elements of an access entry are AND'ed together

Is there some real reason you can't do it this way?

share|improve this answer
    
essentially I want to have a file that has very specific per src ip rules. One file would make things easier to maintain: src 10.40.50.5 dstdomain intranet.loc \n src 10.40.50.6 dstdomain anothersite.net –  Alex Nov 9 '11 at 6:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.