<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 5, 2019 at 4:32 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">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," rel="noreferrer" 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))<br>
<br></blockquote><div><br></div><div>for snat, you can map some subset of private IPs to a given public IP and so on</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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" rel="noreferrer" 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" rel="noreferrer" target="_blank">172.16.0.100:443</a>))<br></blockquote><div><br></div><div>you are mapping &#39;to&#39; private IPs, so you have control over the range</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">
<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.<br></blockquote><div><br></div><div>IIUC, as long as tuples are unique, it should be fine</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">
<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" rel="noreferrer" target="_blank">https://mail.openvswitch.org/mailman/listinfo/ovs-dev</a><br>
</blockquote></div></div>