Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
lxd: disable ipv6 when creating a new-style bridge #6430
Conversation
voidspace
commented
Oct 12, 2016
|
LGTM - other than lacking a test which can come in a follow-up. It would be better if Andy or Dimiter, who know more about lxd network configuration, took a look at it too. |
|
Taking a look - also wanting to understand why this happens since we landed #6338. |
voidspace
commented
Oct 12, 2016
|
Tested with LXD 2.0 on xenial and everything seems to work fine. I can't repro the bug, but at least this fix doesn't break the default case. |
voidspace
commented
Oct 12, 2016
|
Note that #6338 will fix the case where we have both public IPv4 and IPv6 addresses (we will prefer IPv4). It won't handle where we have a public IPv6 address and only a cloud local IPv4 one (requesting public address will return the IPv6 one as it is the better scope match). We could change address selection to prefer a cloud local IPv4 over a public IPv6 if that's what we want. |
voidspace
commented
Oct 12, 2016
|
frobware is seeing if he can repro the bug, and I'm preparing a PR with the change described above (to "always" prefer IPv4 even if there is a better match with an IPv6 one). |
voidspace
commented
Oct 12, 2016
voidspace
referenced this pull request
Oct 12, 2016
Closed
Change address selection to always prefer IPv4 #6437
dooferlad
suggested changes
Oct 12, 2016
Please fix that comment. The default/custom network config detection code will have to stay as it is for now. Please file a bug about that so we can track the need to improve it later.
| @@ -271,7 +271,7 @@ func verifyDefaultProfileBridgeConfig(client *lxd.Client, networkAPISupported bo | ||
| return "", errors.Trace(err) | ||
| } | ||
| - // If the default profile doesn't have eth0 in it, then the user has messed | ||
| + // If the default profile has eth0 in it, then the user has messed |
dooferlad
Oct 12, 2016
Contributor
This comment contradicts the error message on line 289, which is returning an error because eth0 wasn't found.
dooferlad
Oct 12, 2016
Contributor
Checking for eth0 is also a poor way of checking to see if the network config has been changed. We need a better way of communicating default/custom.
tych0
Oct 12, 2016
Contributor
Yeah, I'll just delete it all together. It was wrong before, and it's wrong now :)
|
I explicitly QA'd this change and it worked as advertised. LGTM.
|
| + } | ||
| + | ||
| + if n.Config["ipv6.address"] != "none" { | ||
| + return errors.Errorf(`juju doesn't support ipv6. Please disable LXD's IPV6: |
dimitern
Oct 12, 2016
Contributor
"Juju does not fully support IPv6-only LXD network config.
Please, disable the IPv6 network address by running:
$ lxc network set %s ipv6.address none
and re-bootstrap." ?
tych0
Oct 12, 2016
Contributor
I guess I'm slightly confused. This isn't about ipv6 only: the default LXD network has ipv4 connectivity. I thought the whole point was to disable ipv6 entirely in all cases, because it wasn't supported. The error message you've suggested makes me think that it should work in this case, since the LXD bridge has ipv4 connectivity too.
and others
added some commits
Oct 12, 2016
frobware
approved these changes
Oct 12, 2016
I tried the changes with LXD 2.0 and LXD 2.4.1. In both cases the error messages were presented when IPv6 was enabled. I removed IPv6 support as advertised by the message and was then able to bootstrap.
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
tych0 commentedOct 11, 2016
Also add a check in case the default bridge for eth0 has ipv6, which looks
something like:
$ juju bootstrap lxd lxd
ERROR creating LXD client: juju doesn't support ipv6. Please disable LXD's IPV6:
and rebootstrap
Signed-off-by: Tycho Andersen tycho.andersen@canonical.com