<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=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
        {font-family:"Arial Rounded MT Bold";
        panose-1:2 15 7 4 3 5 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Just to make sure things are understood.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>There is one big difference between windows and Linux handling connections and traffic.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Linux can accept traffic on a specific interface but route the outgoing packet via another interface.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>It’s a feature of the Linux Routing and Networking Kernel stack.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Sometimes it can bite the admin/user and while on windows the connection(TCP) will always be routed or<br>put into the right cable in Linux you need a little be connection marking, mangling and routing marking to make sure that<br>the traffic will be passed to the right gateway.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>It’s a bit hard to understand what happens currently on your system.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>All The Bests,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Eliezer<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Rounded MT Bold",sans-serif;color:#1F497D'>----<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Rounded MT Bold",sans-serif;color:#1F497D'><a href="http://ngtech.co.il/lmgtfy/"><span style='color:#0563C1'>Eliezer Croitoru</span></a><br>Linux System Administrator<br>Mobile: +972-5-28704261<br>Email: eliezer@ngtech.co.il<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><img border=0 width=183 height=69 id="Picture_x0020_1" src="cid:image002.png@01D417E6.3F468490"><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> squid-users [mailto:squid-users-bounces@lists.squid-cache.org] <b>On Behalf Of </b>davidjesse091@aol.com<br><b>Sent:</b> Saturday, June 16, 2018 7:16 AM<br><b>To:</b> rousskov@measurement-factory.com; squid-users@lists.squid-cache.org<br><b>Subject:</b> Re: [squid-users] iptables setup for tcp_outgoing_address<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:black'>I tried </span><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:black;background:white'>curl --interface 172.16.11.107 </span><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:black'><a href="http://www.example.com/" target="_blank"><span style='font-size:9.0pt;background:white'>http://www.example.com</span></a> yesterday and it worked fine, but now it looks like it does not work. Just hangs forever. So there is an issue there for sure. I will try to find out why it's not working.<br><br><o:p></o:p></span></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:black'>-----Original Message-----<br>From: Alex Rousskov <<a href="mailto:rousskov@measurement-factory.com">rousskov@measurement-factory.com</a>><br>To: davidjesse091 <<a href="mailto:davidjesse091@aol.com">davidjesse091@aol.com</a>>; squid-users <<a href="mailto:squid-users@lists.squid-cache.org">squid-users@lists.squid-cache.org</a>><br>Sent: Fri, Jun 15, 2018 11:43 pm<br>Subject: Re: [squid-users] iptables setup for tcp_outgoing_address<br><br>On 06/15/2018 05:12 PM, <a href="mailto:davidjesse091@aol.com">davidjesse091@aol.com</a> wrote:<br><br>> if I use another interface's IP address<br>> for tcp_outgoing_address on my Linux machine then web pages don't load.<br><br>Does using "another interface" IP address work with curl or wget<br>executed on the Squid Linux box?<br><br>curl --interface 172.16.11.107 <a href="http://www.example.com" target="_blank">http://www.example.com</a><br>wget --bind-address=172.16.11.107 <a href="http://www.example.com" target="_blank">http://www.example.com</a><br><br><br>Alex.<br><br><br>> -----Original Message-----<br>> From: Alex Rousskov <<a href="mailto:rousskov@measurement-factory.com">rousskov@measurement-factory.com</a>><br>> To: davidjesse091 <<a href="mailto:davidjesse091@aol.com">davidjesse091@aol.com</a>>; squid-users<br>> <squid-<a href="mailto:users@lists.squid">users@lists.squid</a>-cache.org><br>> Sent: Fri, Jun 15, 2018 7:01 pm<br>> Subject: Re: [squid-users] iptables setup for tcp_outgoing_address<br>> <br>> On 06/15/2018 04:42 PM, <a href="mailto:davidjesse091@aol.com">davidjesse091@aol.com</a><br>> <<a href="mailto:davidjesse091@aol.com?">mailto:davidjesse091@aol.com</a>> wrote:<br>> <br>>> I want to connect to Squid proxy using 192.168.1.212 and if I am<br>>> connecting using port 11000,<br>> <br>> I assume you meant "connecting to port 11000" (there is also the client<br>> source port, but it should not matter here).<br>> <br>> <br>>> I want squid to have the traffic go out of the 172.16.11.107 IP<br>> <br>> <br>>> http_port 11000 name=port_11000<br>>> acl port_11000_acl myportname port_11000<br>>> tcp_outgoing_address 172.16.11.107 port_11000_acl<br>> <br>> Looks good to me, provided all your outgoing traffic goes to IPv4<br>> addresses (no IPv6).<br>> <br>> <br>>> What would I need to do with iptables to make this work?<br>> <br>> Why do you think you need iptables? What does not work if you do not use<br>> IP tables?<br>> <br>> <br>> Alex.<o:p></o:p></span></p></div></div></body></html>