<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EstiloDeEmail17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=PT-BR link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi everyone ;)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>I have a little bit complex task at hand.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>What I must do:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>1-Allow an user to access squid only through specific port. This same user can access 1 port or several ports, depending on how many routes he have.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>2- Authenticated users can access only their own ports.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>3- Every access is via IP:Port that brings the user to a different tcp_outgoing_address<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Example<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>An user must have 2 routes:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>192.168.0.2:3001 this route brings this user to tcp_outgoing_address 200.2.2.11<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>192.168.0.2:3002 this route brings this user to tcp_outgoing_address 200.2.2.12<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Yes, every port have to route to a different tcp outgoing address.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>The closest I could get to a solution was using this:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>http_port 192.168.0.2:3001 name=5<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>acl ip5 myportname 5<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>tcp_outgoing_address 200.2.2.11 ip5<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>This way, an user that enters via 192.168.0.2:3001 goes out via 200.2.2.11.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>And its fine, but this way, every authenticated user can access all routes.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I have tried several ways to bind an username in this solution, but it is not working.<br>Authentication was via basic_db_auth, but I “downgraded it” to basic_ncsa_auth to simplify tests. Authentication is working fine.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>My last try was using the setup below, but It made squid a little dizzy:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>acl ip3 proxy_auth test myportname 3<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>http_access allow ip3<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>http_port 192.168.0.2:2000 name=3<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>tcp_outgoing_address 200.2.2.11 ip3<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>http_access deny ip3<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>acl ip4 proxy_auth test1 myportname 4<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>http_access allow ip4<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>http_port 192.168.0.2:2000 name=4<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>tcp_outgoing_address 200.2.2.12 ip4<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>http_access deny ip4<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>The problem is to bind specific incoming via ip:port to specific outgoing ip:port using user authentication so users cant access each other routes.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thanks for help.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:PT-BR'>Marcelo<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>