On Mon, Jan 06, 2014 at 11:11:11PM -0500, Jason Thorpe wrote:
> > <jasonthor...@outlook.com<mailto:jasonthor...@outlook.com>> wrote: 
> > is it possible to modify specific bits of an IP address when setting 
> > flow rules for a switch? (using add-flow and 
> > actions=mod_nw_{src,dst} ). 
> > 
> > That won't work, since that action is expecting a specific IP address. 
> > 
> > basically, I am looking for setting actions on the IP address to change 
> > some source/destination. like modifying all IPs from 192.168.0.* to 
> > 192.168.1.* . or can I just use wildcards for this purpose? 
> > 
> > I hadn't really thought about it before, but I suppose you could load 
> > the IP address into a register, then modify the appropriate bits with 
> > the move action, and then use the move action to copy the contents of 
> > the register into NXM_OF_IP_DST. 
> 
> I need to do this for many IP addresses. What I am trying to do here
> is to replicate the Modelnet bitflip behaviour where the 23rd bit of
> the source and destination addresses are flipped [10.128.0.1 ->
> 10.0.0.1]. 

ovs-ofctl add-flow br0 
'ip,nw_src=0.128.0.0/0.128.0.0,actions=load:0->NXM_OF_IP_SRC[23]'
ovs-ofctl add-flow br0 
'ip,nw_src=0.0.0.0/0.128.0.0,actions=load:1->NXM_OF_IP_SRC[23]'
_______________________________________________
discuss mailing list
discuss@openvswitch.org
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to