Skip to content

Conversation

@wangguoqin1001
Copy link

@wangguoqin1001 wangguoqin1001 commented Feb 18, 2025

Initial implementation: Added NAT rules for OVS-DPDK using OpenFlow

Description

For OVS-DPDK environments, you can't use iptables to modify packets since they're not in kernel space. To do NAT and offer access to the Internet for the VMs, you need to do NAT inside OpenvSwitch, with OpenFlow.

In the commit are the only OpenFlow rules that I found would make NAT work. Have to manipulate the source and destination MAC addresses for both outgoing and incoming packets manually, as well as output the packets to the desired interfaces.

Branches to which this PR applies

  • master

TODO List

  • Need to put the names of the interfaces and the internal IP range into the configuration parameters, or use existing ones, which I'm not familiar with,
  • May have some side effects in del_flows when deactivating. There shouldn't be one in theory, but I saw the rules didn't disappear after VM shutdown.

Added NAT rules for OVS-DPDK
Prevent duplicated packets from the Internet to the host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant