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

balenaEngine and NetworkManager forward chain racing issues #3180

Open
majorz opened this issue Jul 5, 2023 · 0 comments
Open

balenaEngine and NetworkManager forward chain racing issues #3180

majorz opened this issue Jul 5, 2023 · 0 comments

Comments

@majorz
Copy link
Contributor

majorz commented Jul 5, 2023

A NetworkManager profile that has Internet sharing enabled adds a number of iptables rules. Depending on when balenaEngine adds its iptables rules it may add them before or after NetworkManager.

If NetworkManagers iptables rules are added first in the FORWARD chain, that will make containers not be able to reach other devices on the network that has Internet sharing provided to. If balenaEngine adds its rules first, containers will be able to reach the other devices on that network.

Depending on whether NM or balenaEngine adds its rules first, the default policy for the FORWARD chain could be set differently as well.

The quick workaround for this is to add a rule from inside a container like: iptables -I FORWARD 1 -d <NETWORK> -o <IFACE> -j ACCEPT.

Preferably this can be also solved inside the host OS - for example balenaEngine could be started after NetworkManager finishes interface initialization. That will also give the ability for containers to bind to interfaces which with the current setup may or may not be initialized.

Another approach could be Prevent Docker from manipulating iptables. This means that another service (e.g. supervisor) has to add those rules instead.

Something else that could be investigated is what the behavior would be when using nftables as it is more flexible and supports priorities.

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

No branches or pull requests

1 participant