Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] For OVS-DPDK where iptables isn't available, add NAT rules with OpenFlow #6934

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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