Search code examples
openflowopendaylightopenvswitch

How to modify destination ip address in OpenDaylight


How can I modify the destination address, and force the flow to go to another destination? I use this xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<flow xmlns="urn:opendaylight:flow:inventory">
    <priority>33000</priority>
    <flow-name>Foo</flow-name>
    <match>
        <ethernet-match>
            <ethernet-type>
                <type>2048</type>
            </ethernet-type>

        </ethernet-match>

        <ipv4-destination>10.0.0.6/32</ipv4-destination>
    </match>
    <id>1</id>
    <table_id>0</table_id>
    <instructions>
        <instruction>
            <order>1</order>
            <apply-actions>
                <action>
                   <order>1</order>
                   <set-nw-dst-action>
                   <ipv4-address>10.0.0.4</ipv4-address>
                  </set-nw-dst-action>
               </action>
            </apply-actions>
        </instruction>
    </instructions> 
</flow>

however instead of modifying the ip address, it drops all the packets to 10.0.0.6, and even sudo ovs-ofctl -O OpenFlow13 dump-flows br-int shows action=drop

Is there any source that I can refer for adding flows, this seems to be incomplete.


Solution

  • You need to specify the mask 10.0.0.4/32