-
Notifications
You must be signed in to change notification settings - Fork 881
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
Gateway network selection ignores "--internal" and "--ipv6" #1141
Comments
Thanks for reporting this. It's a bug.
|
Ah, so that's already the intended case (selecting only non-internal), perfect! Wasn't aware of this in the documentation, sorry. What about the IPv6 case, a bug as well? Or is it currently impossible to have 2 different networks selected for external connectivity, 1 for IPv4, 1 for IPv6? |
The mixed v4/v6 gw network is currently a limitation. The needed code to support that is not there. |
I've noticed that when connected to multiple (user-defined) networks, NAT and gateway are always configured for the network with the (alphabetically) first network name. This seems a bit random, but I guess it works.
However, in this selection process, internal networks (created with
--internal
) are not excluded from this list. This means if you're connecting a container to an internal network, internet connectivity for that container will be lost, if the internal network happens to come before other (non-internal) networks it's connected to.Here's an example showing the issue:
Seems to me this behaviour should not depend on what happens to be the name of the internal network in relation to the names of the other connected networks.
A possible solution would be to only consider non-internal networks for becoming "primary", i.e. select the alphabetically first non-internal network and use it for NAT/gateway. For a container only connected to an internal network, this means no gateway will be configured at all, but this makes sense because why configure a gateway if it won't work.
Similarly, IPv6 should have a separate selection, where it selects the first non-internal network that has IPv6 enabled. Currently, this breaks as well:
The text was updated successfully, but these errors were encountered: