Ask Your Question
0

How to modify destination ip address

asked 2015-11-13 04:44:49 -0700

Emad gravatar image

updated 2015-11-17 00:57:24 -0700

Hi,

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.8/32</ipv4-destination>
    </match>
    <id>1</id>
    <table_id>0</table_id>
    <instructions>
        <instruction>
            <order>0</order>
            <apply-actions>
                <action>
                   <order>0</order>
                    <set-nw-dst-action>
                    <ipv4-address>10.0.0.7/32</ipv4-address>
                    </set-nw-dst-action>
                    </action>
                </apply-actions>
            </instruction>
        </instructions>
    </flow>

however sending REST GET request or even ping to 10.0.0.8 is not redirected to 10.0.0.7

sudo ovs-ofctl -O OpenFlow13 dump-flows br-int : cookie=0x0, duration=63.453s, table=0, n_packets=0, n_bytes=0, priority=33000,ip,nw_dst=10.0.0.8 actions=output:8,set_field:10.0.0.7->ip_dst

Is there any source that I can refer for adding flows, https://wiki.opendaylight.org/view/Ed...OpenDaylightOpenFlowPlugin:EndtoEndFlows:Example_Flows seems to be incomplete.

edit retag flag offensive close merge delete

Comments

How do u add this flow ? Using some northbound application or via DLUX GUI ? Which version of OVS and ODL are u using ?

sanjaykumar2891987 ( 2015-11-30 02:38:56 -0700 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-12-04 12:47:59 -0700

runamuck gravatar image

I believe you need to match on IP as well as ethertype. So simply edit your match stanza to include:

 <ip-match>
         <ip-protocol>6</ip-protocol>         
 </ip-match>

Your XML now looks like:

<?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>
         <ip-match>
            <ip-protocol>6</ip-protocol>         
        </ip-match>
       <ipv4-destination>10.0.0.8/32</ipv4-destination>
    </match>
    <id>1</id>
    <table_id>0</table_id>
    <instructions>
        <instruction>
            <order>0</order>
            <apply-actions>
                <action>
                   <order>0</order>
                    <set-nw-dst-action>
                    <ipv4-address>10.0.0.7/32</ipv4-address>
                    </set-nw-dst-action>
                    </action>
                </apply-actions>
            </instruction>
        </instructions>
    </flow>

See my answer to this question for details.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-11-13 04:44:49 -0700

Seen: 455 times

Last updated: Dec 04 '15