<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 6, 2019 at 5:01 PM Yi Yang (杨燚)-云服务集团 &lt;<a href="mailto:yangyi01@inspur.com">yangyi01@inspur.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_2876414942582946608WordSection1"><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thanks Darrell, I didn’t receive your second reply, I saw it in <a href="http://mail.openvswitch.org" target="_blank">mail.openvswitch.org</a>.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">“<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">probably, you should give an example of what you mean by above<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">I am not sure you are meaning to say that you want to specify an L4 port in<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">your<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">snat action rule or not; you will want to use ephemeral ports by not<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">specifying a<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">specific port in most cases<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">“<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">For SNAT, we don’t specify port, just use default port range “1024-65535”), but for internal source IPs, i.e. floating IPs, they are discrete in most cases because some floating IPs needn’t access Internet, for public IPs, so are they. For public IPs, maybe they are from different telecom carriers, we prefer egress traffic can be distributed on several BGP lines.</span></p></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_2876414942582946608WordSection1"><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">table=0,ip,nw_src=172.18.0.67,…,actions=ct(commit,table=0,zone=1,nat(src=220.0.0.3,230.0.0.7,240.0.0.123))<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">table=0,ip,nw_src=172.18.0.80,…,actions=ct(commit,table=0,zone=1,nat(src=220.0.0.3,230.0.0.7,240.0.0.123))<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">table=0,ip,nw_src=172.19.0.23,…,actions=ct(commit,table=0,zone=1,nat(src=220.0.0.3,230.0.0.7,240.0.0.123))<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Ideally, we hope, for different traffic types from the same internal IP (say 172.18.0.67), some can SNAT to 220.0.0.3, some can SNAT to 230.0.0.7, some can SNAT to <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">240.0.0.123, that way, they can leverage total bandwidth of </span><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">several BGP lines.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">I know current OVS can’t support the above IP list for snat, but it is indeed required in reality, I don’t understand why OVS can’t do in this way, is it linux conntrack limitation or what else reason? I think it is similar to IP range which can be supported.</span></p></div></div></blockquote><div><br></div><div>Presently, the limitation is both at the Openflow layer and implementation details at datapath</div><div>The layer above (a controller or even a script) can do the mapping taking into account the desired distribution</div><div>A controller can/will often do this and similar types of configuration specification.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_2876414942582946608WordSection1"><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:11pt;font-family:微软雅黑,sans-serif">发件人<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11pt;font-family:微软雅黑,sans-serif"> Darrell Ball [mailto:<a href="mailto:dlu998@gmail.com" target="_blank">dlu998@gmail.com</a>] <br></span><b><span style="font-size:11pt;font-family:微软雅黑,sans-serif">发送时间<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11pt;font-family:微软雅黑,sans-serif"> 2019</span><span style="font-size:11pt;font-family:微软雅黑,sans-serif">年<span lang="EN-US">11</span>月<span lang="EN-US">6</span>日<span lang="EN-US"> 9:38<br></span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> Yi Yang (</span>杨燚<span lang="EN-US">)-</span>云服务集团<span lang="EN-US"> &lt;<a href="mailto:yangyi01@inspur.com" target="_blank">yangyi01@inspur.com</a>&gt;<br></span><b>抄送<span lang="EN-US">:</span></b><span lang="EN-US"> <a href="mailto:ovs-discuss@openvswitch.org" target="_blank">ovs-discuss@openvswitch.org</a>; <a href="mailto:ovs-dev@openvswitch.org" target="_blank">ovs-dev@openvswitch.org</a><br></span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> Re: [ovs-dev] can OVS conntrack support IP list like this: actions=ct(commit, table=0, zone=1, nat(dst=220.0.0.3, 220.0.0.7, 220.0.0.123))?<u></u><u></u></span></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><div><div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><div><div><p class="MsoNormal"><span lang="EN-US">On Tue, Nov 5, 2019 at 4:32 PM Yi Yang (</span>杨燚<span lang="EN-US">)-</span>云服务集团<span lang="EN-US"> &lt;<a href="mailto:yangyi01@inspur.com" target="_blank">yangyi01@inspur.com</a>&gt; wrote:<u></u><u></u></span></p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm"><p class="MsoNormal" style="margin-bottom:12pt"><span lang="EN-US">Hi, folks<br><br><br><br>We need to do SNAT for many internal IPs by just using several public IPs,<br>we also need to do DNAT by some other public IPs for exposing webservice,<br>openflow rules look like the below:<br><br><br><br>table=0,ip,nw_src=<a href="http://172.17.0.0/16," target="_blank">172.17.0.0/16,</a>…,actions=ct(commit,table=0,zone=1,nat(src=<br>220.0.0.3,220.0.0.7,220.0.0.123))<br><br>table=0,ip,nw_src=172.18.0.67,…,actions=ct(commit,table=0,zone=1,nat(src=22<br>0.0.0.3,220.0.0.7,220.0.0.123))<u></u><u></u></span></p></blockquote><div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span lang="EN-US">for snat, you can map some subset of private IPs to a given public IP and so on<u></u><u></u></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm"><p class="MsoNormal"><span lang="EN-US">table=0,ip,tcp,nw_dst=220.0.0.11,tp_dst=80,…,actions=ct(commit,table=0,zone<br>=2,nat(dst=<a href="http://172.16.0.100:80" target="_blank">172.16.0.100:80</a>))<br><br>table=0,ip,tcp,nw_dst=220.0.0.11,<br>tp_dst=443,…,actions=ct(commit,table=0,zone=2,nat(dst=<a href="http://172.16.0.100:443" target="_blank">172.16.0.100:443</a>))<u></u><u></u></span></p></blockquote><div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span lang="EN-US">you are mapping &#39;to&#39; private IPs, so you have control over the range<u></u><u></u></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm"><p class="MsoNormal"><span lang="EN-US"><br><br><br><br><br>From ct document, it seems it can’t support IP list for nat, anybody knows<br>how we can handle such cases in some kind feasible way?<br><br><br><br>In addition, is it ok if multiple openflow rules use the same NAT IP:PORT<br>combination? I’m not sure if it will result in some conflicts for SNAT,<br>because all of them need to do dynamic source port mapping, per my test, it<br>seems this isn’t a problem.<u></u><u></u></span></p></blockquote><div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span lang="EN-US">IIUC, as long as tuples are unique, it should be fine<u></u><u></u></span></p></div><div><p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm"><p class="MsoNormal"><span lang="EN-US"><br><br><br>Thank you all in advance and appreciate your help sincerely.<br><br>_______________________________________________<br>dev mailing list<br><a href="mailto:dev@openvswitch.org" target="_blank">dev@openvswitch.org</a><br><a href="https://mail.openvswitch.org/mailman/listinfo/ovs-dev" target="_blank">https://mail.openvswitch.org/mailman/listinfo/ovs-dev</a><u></u><u></u></span></p></blockquote></div></div></div></div></blockquote></div></div>