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

Optimize network forwards #11983

Merged
merged 4 commits into from
Jul 12, 2023

Conversation

markylaing
Copy link
Contributor

@markylaing markylaing commented Jul 10, 2023

Reuses the logic from #9633 to optimise firewall rule generation when applying network forwards.

Additionally adds some revert logic to the NetworkApplyForwards method in xtables to clean up any forwarding rules that may be partially applied (this is not required for nftables as the rules are collated and applied together in a template).

Closes #11911

@markylaing
Copy link
Contributor Author

@tomponline FYI this is passing the network_forward test suite but I haven't run the full suite, nor have I run the corresponding tests from https://github.com/lxc/lxc-ci/blob/master/bin/test-lxd-network-bridge-firewall

@tomponline
Copy link
Member

@tomponline FYI this is passing the network_forward test suite but I haven't run the full suite, nor have I run the corresponding tests from https://github.com/lxc/lxc-ci/blob/master/bin/test-lxd-network-bridge-firewall

Please can you run the ones from https://github.com/lxc/lxc-ci/blob/master/bin/test-lxd-network-bridge-firewall with it.

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

Just waiting on confirmation that the daily tests run with this.

@markylaing
Copy link
Contributor Author

@tomponline This is passing the LXD network bridge firewall daily test (after much effort).

The actual test script I am running is https://github.com/markylaing/lxc-ci/blob/fad37d48ab1254dcbf06e1a53c7cd252fdbef0aa/bin/test-lxd-network-bridge-firewall. I've made a few changes to account for side loading the LXD binary. Additionally, the test was run in an images:ubuntu/22.04 VM because there was an issue with ebtables in the official ubuntu:jammy image.

You can view the changes here lxc/lxc-ci@master...markylaing:lxc-ci:local-firewall-test

@tomponline
Copy link
Member

Thanks!

@tomponline tomponline merged commit 296670b into canonical:main Jul 12, 2023
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.

LXD Network Forward firewall rule generation is inefficient.
2 participants