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

[Bug] Avoid nat when there is only a single node at endpoints in the Gateway #124

Closed
YTGhost opened this issue Jul 19, 2023 · 0 comments · Fixed by #131
Closed

[Bug] Avoid nat when there is only a single node at endpoints in the Gateway #124

YTGhost opened this issue Jul 19, 2023 · 0 comments · Fixed by #131

Comments

@YTGhost
Copy link
Member

YTGhost commented Jul 19, 2023

Why

When there is only a single node at the endpoints in the Gateway, the NAT avoidance rules are cleaned up.

// pkg/networkengine/routedriver/vxlan/vxlan.go L490~501
err = vx.iptables.NewChainIfNotExist(iptablesutil.NatTable, iptablesutil.RavenPostRoutingChain)
if err != nil {
	errList = errList.Append(fmt.Errorf("error create %s chain: %s", iptablesutil.PostRoutingChain, err))
}
err = vx.iptables.DeleteIfExists(iptablesutil.NatTable, iptablesutil.PostRoutingChain, "-m", "comment", "--comment", "raven traffic should skip NAT", "-o", "raven0", "-j", iptablesutil.RavenPostRoutingChain)
if err != nil {
	errList = errList.Append(fmt.Errorf("error deleting %s chain rule: %s", iptablesutil.PostRoutingChain, err))
}
err = vx.iptables.ClearAndDeleteChain(iptablesutil.NatTable, iptablesutil.RavenPostRoutingChain)
if err != nil {
	errList = errList.Append(fmt.Errorf("error deleting %s chain %s", iptablesutil.RavenPostRoutingChain, err))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: 🔖 Ready
Development

Successfully merging a pull request may close this issue.

1 participant