We've already known that ovs-ofctl provides many actions to modify packets like set_field, load, move...

but I can't find a suitable action or action combination to modify a bit in the IP packet destinations field.

In other words, when we received packets the destination ipv6 field is 2020::1 or 2020::2, we make the destinations field become 2010::1 or 2010::2 by OpenFlow rules.

I try to assemble set_field, load, move and others to do this, but it seems that it doesn't work.

Can we achieve this simply by ovs-ofctl or not?

  • 7
    That is called NAT (Network Address Translation), and it is often used for IPv4. IPv6 does not have NAT standards the way IPv4 does. There is an Experimental RFC for IPv6 NAT, but it only allows 1:1 NAT, not NAPT the way that is normally used with IPv4. In fact, it expressly forbids NAPT. Also, besides modifying the IPv6 address, you would then need to recalculate the transport protocol checksum for things like TCP and UDP. IPv6 doesn't have a header checksum like IPv4, so it requires the upper-layer protocols to do that. – Ron Maupin Jan 4 '20 at 8:15
  • 1
    I can't support, highlight and upvote Ron's comment enough. If the network design requires IPv6 NAT, it might be a bad design. It is strongly preferrable to find another solution to the problem. – Marc 'netztier' Luethi Jan 4 '20 at 19:10

I used NXM_NX_IPV6_DST field and load action to resolve this problem on openvswitch bridge by adding a flow as follows

ovs-ofctl -O openflow13 add-flow br0 "priority=60000,ipv6,ipv6_dst=2020::/16,actions=load:0x2010->NXM_NX_IPV6_DST[112..127]"

Not the answer you're looking for? Browse other questions tagged or ask your own question.