<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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
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;}
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;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi Venu, the objective is to have flows with VxLAN field matches hence I did not use the udp port match condition.<o:p></o:p></p>
<p class="MsoNormal">Is there any other way to configure OVS for this experiment?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Venugopal Reddy K [mailto:venugopalreddyk@huawei.com]
<br>
<b>Sent:</b> Tuesday, June 13, 2017 7:12 PM<br>
<b>To:</b> Manu S. Keshava &lt;manu@chelsio.com&gt;; discuss@openvswitch.org<br>
<b>Subject:</b> RE: VXLAN flow configuration for OVS<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Assumed you have tried with flows added for both directions. Don&#8217;t know whether you can&nbsp; use tun related matches for this case.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I guess, can match on udp port:4789 alone instead.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Venu<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,sans-serif">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,sans-serif">
<a href="mailto:ovs-discuss-bounces@openvswitch.org">ovs-discuss-bounces@openvswitch.org</a> [<a href="mailto:ovs-discuss-bounces@openvswitch.org">mailto:ovs-discuss-bounces@openvswitch.org</a>]
<b>On Behalf Of </b>Manu S. Keshava<br>
<b>Sent:</b> 13 June 2017 18:22<br>
<b>To:</b> <a href="mailto:discuss@openvswitch.org">discuss@openvswitch.org</a><br>
<b>Subject:</b> [ovs-discuss] VXLAN flow configuration for OVS<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Hi, I&#8217;m using Openvswitch-2.7.0 on RHEL7.3 with 4.9.30.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I&#8217;m using 3 machines in this config :<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">&nbsp;--------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | OVS_Switch |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">| HOST A | -------&gt;| eth2&nbsp; eth3 |&lt;------- | HOST B |<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">--------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --------<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I&#8217;m configuring VXLAN tunnel on Host A and Host B as :<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ifconfig enp7s0f4d1 10.1.1.x/24 promisc<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">modprobe vxlan<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ip li add vxlan0 type vxlan id 42 group 239.1.1.1 dev enp7s0f4d1 dstport 4789<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ifconfig vxlan0 192.168.1.x/24 up<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Now I configure the host acting as OVS_switch :<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-appctl exit<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">pkill -9 ovs<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">rm -rf /usr/local/etc/ovs-vswitchd.conf<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">rm -rf /usr/local/var/run/openvswitch/db.sock<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">rm -rf /usr/local/etc/openvswitch/conf.db<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">touch /usr/local/etc/ovs-vswitchd.conf<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovsdb-tool create /usr/local/etc/openvswitch/conf.db /root/ openvswitch-2.7.0/vswitchd/vswitch.ovsschema<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovsdb-server /usr/local/etc/openvswitch/conf.db --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert
 --pidfile --detach --log-file<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-vsctl --no-wait init<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">export DB_SOCK=/usr/local/var/run/openvswitch/db.sock<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-vswitchd --pidfile --detach<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-vsctl add-br br0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">sleep 2<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ifconfig br0 up<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-vsctl add-port br0 enp7s0f4<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">sleep 5<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-vsctl add-port br0 enp7s0f4d1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">sleep 5<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-vsctl show<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal">Now when I ping on the vxlan interfaces from HostA to HostB and vice-versa it works.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal">I deleted all default flows on the switch and created a flow to switch packets with tun_id=42 but that flow does not seem to be hit.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-ofctl del-flows br0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-ofctl add-flow br0 in_port=1,tun_src=192.168.1.66,tun_id=42,action=output:2<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">[root@warrior ~]# ovs-ofctl --version<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">ovs-ofctl (Open vSwitch) 2.7.0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">OpenFlow versions 0x1:0x4<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">[root@warrior ~]# ovs-ofctl dump-flows br0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">NXST_FLOW reply (xid=0x4):<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;,serif">cookie=0x0, duration=6.800s, table=0, n_packets=0, n_bytes=0, idle_age=6, tun_id=0x2a,tun_src=192.168.1.66,in_port=1 actions=output:2<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">How to set flows for the VXLAN tunnel now?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal">Manu<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>