/srv/irclogs.ubuntu.com/2024/08/19/#netplan.txt

KitsuWhooaHi slyon! Regarding https://github.com/canonical/netplan/pull/480#pullrequestreview-2182292260 ; I finally got the integration tests running and I'm writing ones for stable-privacy and eui64. With `ipv6-address-generation: eui64`, NetworkManager seems to use an address that's not EUI-64. Any idea what might be up with that?08:58
KitsuWhooaMore specifically, with a mac address of 52:96:85:e2:98:e7, under NM I get inet6 2600::40f8:98ce:9bd8:901b/6408:58
KitsuWhooawhen it should be 2600::5096:85ff:fee2:98e7/64'08:58
slyonKitsuWhooa: that's great news, thanks for continuing with this work!09:01
KitsuWhooahappy to help :)09:01
KitsuWhooaWorth noting that if I remove `ipv6-address-generation` entirely, the interface gets the expected address09:02
slyonregarding the unexpected NM behavior... I'm not sure. Let me look into the code briefly.09:03
KitsuWhooaThanks, appreciated!09:03
slyonKitsuWhooa: interestingly, we're using "g_key_file_set_string(kf, "ipv6", "addr-gen-mode", addr_gen_mode_str(def->ip6_addr_gen_mode));" (i.e. a STRING)09:10
slyonwhereas we're using "g_key_file_set_integer(kf, "ipv6", "addr-gen-mode", 0);" (an int32) in other places. In the NM docs it's described as an int32 (https://www.networkmanager.dev/docs/api/1.32.8/settings-ipv6.html)09:10
slyonNot sure if that might be related?... Or if the string get auto-translated to an int. It would be worth a try.09:11
KitsuWhooaAh!09:11
KitsuWhooaI'll play with it09:11
KitsuWhooathanks09:11
slyonKitsuWhooa: Does it work correctly (i.e. use the token as IP suffix) when you set "ipv6-address-token" ? Because this sets EUI-64 addr-gen-mode properly (as int) plus the "token"09:12
slyonsee src/nm.c lines 894++09:13
KitsuWhooaone moment09:17
KitsuWhooaslyon: I'm even more confused now. I set the prefix to ::45. NM decided on `inet6 2600::5096:85ff:fee2:98e7/64 scope global tentative dynamic mngtmpaddr` (which is the EUI64 address, but no prefix in sight). Networkd on `inet6 2600::45/64 scope global mngtmpaddr noprefixroute` which I think is what would be expected.09:42
KitsuWhooas/prefix/suffix/09:42
KitsuWhooa`ipv6-address-token: "::45"` is what I added to the config basically09:43
KitsuWhooaI'll whip up a quick patch to use set_integer for eui64 and see if it changes anything in the original issue09:44
slyonright. sounds like setting "ipv6-address-token" sets eui64 correctly. But there might be a stacked issue with the "ipv6.token setting".09:51
slyonKudos, your integration tests are already turining out to be useful! :)09:51
KitsuWhooaheh, thanks10:22
KitsuWhooaI printed the strings that get added to the config file, and it looks like it's literally adding the integers as strings10:22
KitsuWhooaso "0" and "1"10:22
KitsuWhooawhich NM most likely does not like10:23
KitsuWhooaI guess the next question is, do I make them integers or proper strings like "eui64"10:23
KitsuWhooaI think the reason stable-privacy works is by accident, since according to the manual page it probably will default to it10:24
KitsuWhooaAh, nothing else uses addr_gen_mode_str(). I'll just change that quickly10:29
KitsuWhooaNope. Setting it to "eui64" still doesn't return the correct address.10:35
slyonKitsuWhooa: according to https://www.networkmanager.dev/docs/api/1.32.8/settings-ipv6.html I'd assume it needs to be set to (int32)0 and as you found, you can modify addr_gen_mode_str() accordingly.10:45
KitsuWhooaYeah, I set it to an integer 0 and it's doing the exact same thing10:46
KitsuWhooaI wonder if the ipv6 privacy extensions are messing with it10:48
KitsuWhooaHm, no, it can't be: "Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941. If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one from MAC address via modified EUI-64."10:49
slyon"I wonder if the ipv6 privacy extensions are messing with it" – that was my first thought, too. But it should only add an additional address.10:52
slyonKitsuWhooa: are you able to make NM configure EUI-64 addresses when driven natively, without Netplan?10:52
KitsuWhooaI vaguely recall my 22.04 desktop being set to that via the GUI and then realising it and changing it to stable privacy10:53
KitsuWhooawhich then led me wanting to enable stable privacy on my 24.04 server too which uses netplan and networkd, thus going down this entire path of implementing it10:53
KitsuWhooabut I can't verify right now10:54
KitsuWhooaI'll be able to check in a few hours10:54
KitsuWhooaPerhaps I can fire up a 24.04 VM remotely and test it10:56
yatotyow11:02
yatotwhats up for you?11:02
slyonKitsuWhooa: I just tested it on my 24.04 desktop. Modified through NM-GUI. This is the Netplan config I end up with, which produces a proper EUI64 IP6: https://dpaste.org/CDRF911:05
slyonso it seems to be working.11:05
KitsuWhooaAh, thanks. Was waiting for the ISO to download11:05
slyon(This is using current Netplan from git)11:06
KitsuWhooaI'm very confused why it's not working in my test11:06
slyonyou're excuting the test as autopkgtest, right?11:06
KitsuWhooaYup11:06
KitsuWhooa~/netplan$ autopkgtest . --test-name ethernets -U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 -- lxd autopkgtest/ubuntu/noble/amd6411:07
slyonCan you try running it with "--shell" to get an interactive environment and introspect + play around with the NM & Netplan config in there?11:07
KitsuWhooaOoooh, I had no idea that option existed11:07
KitsuWhooavery useful11:07
KitsuWhooaI don't have 'dhcp6: true' set11:08
KitsuWhooajust accept-ra and ra-only for dnsmasq11:08
KitsuWhooaThis is SLAAC though so dhcpv6 shouldn't be relevant11:09
slyonthere's some confusion around dhcp6: true. I think in the past it was needed to activate the DHCP client even for SLAAC. But these days it shouldn't. But maybe it's worth a try.11:10
slyonanother thought... you're executing the test in a LXD container, which IIRC does not provide permanent MAC address. Maybe NM has some issue getting the proper MAC address for EUI64 in this environment. You might try running it in a VM, using "autopkgtest-buildvm-ubuntu-cloud -r noble", then execute the test with "autopkgtest [...] -- qemu /path/to/the/new-VM-image"11:11
KitsuWhooaThe address is only changed when the image is generated though11:12
KitsuWhooaI'll leave that for later because it's already running in a VM11:12
KitsuWhooaAs in, the LXD host is a VM11:12
KitsuWhooaif you feel like giving it a try, this is what I use https://tasossah.com/netplan_eui64.yaml11:13
KitsuWhooaAlso, if the mac address was the issue, it wouldn't work when I don't specify addr-gen-mode at all11:14
KitsuWhooaif I comment that line in the config file above, it gets the expected EUI64 address 11:15
slyon"it wouldn't work when I don't specify addr-gen-mode at all" – very true!11:25
slyonKitsuWhooa: oh.. I think I see what might be wrong here.11:29
slyonoh no. nvm :(11:29
KitsuWhooaAwh11:29
KitsuWhooaI had a thought that it might not be waiting long enough11:29
KitsuWhooabut that seems really far fetched11:29
slyonthat's certainly possible! there are races like that in the Netplan test suite. And we implemented the "state_*()" methods to accomodate for that. You might consider adding a custom "self.state(...)" in "generate__and_settle()" to wait fot the expected token/MAC to appear.11:32
* slyon afk for a bit11:32
KitsuWhooaI have already added the ipv6 one when I noticed that sometimes I wouldn't get a v6 address at all11:33
KitsuWhooabut all that seems to do is just wait for any v611:33
KitsuWhooaThe reason I said far fetched is because it'd mean NM would get a random address, then manually switch it to the EUI64 one11:33
KitsuWhooas/manually/automatically/11:33
KitsuWhooaI ran the test and interrupted it while it was running. nmcli says > ipv6.addr-gen-mode:                     default11:34
KitsuWhooaAnd if I manually set it to 0, it switches to the right address11:36
KitsuWhooaI think I figured it out11:41
KitsuWhooathere is a conflict11:41
KitsuWhooaThere is '/run/NetworkManager/system-connections/Wired connection 1.nmconnection' which contains addr-gen-mode=default11:42
KitsuWhooaand there is '/run/NetworkManager/system-connections/netplan-eth42.nmconnection' which contains addr-gen-mode=011:42
KitsuWhooaboth have interface-name=eth4211:42
KitsuWhooanmcli con doesn't show netplan-eth42 at all, despite it having id=netplan-eth42 in it11:43
KitsuWhooaProbably it sees 'W' first, then ignores the "duplicate" one11:45
KitsuWhooaOr maybe I'm wrong11:46
KitsuWhooaSomething is definitely up with the autogenerated NM profile though as the netplan one doesn't show up11:46
KitsuWhooa14:45:37 <KitsuWhooa> Probably it sees 'W' first, then ignores the "duplicate" one <-- it was after this that I remembered that NM can have multiple profiles11:48
KitsuWhooaI hate to say it, but dhcp6: true fixed it11:59
KitsuWhooaAnd more specifically, it's because it sets ipv6.method=auto12:02
KitsuWhooawithout dhcp6: true, ipv6.method is set to manual, which makes the profile completely vanish from NetworkManager12:02
slyonipv6.method=manual is a totally valid setting, so that's really strange.. But using "dhcp6: true" fixes your current case, at least (good job figuring it out!) – Investigation why the profile disappears when method=manual (and NM therefore autogenerating an ephemeral connection profile) is worth another investigation.12:19
slyon(feel free to create a bug report about that: https://launchpad.net/netplan12:19
KitsuWhooaI suspect it's because it's not actually specifying an address12:22
KitsuWhooaI'll dig into it and if I can't figure that out I'll open a bug so that it's not forgotten12:22
KitsuWhooathe dhcp6 property is very confusing as a name though12:23
KitsuWhooaI also was thinking of adding a safeguard to make sure before the tests are ran that it's not using an autogenerated profile12:23
rrahl0is it intentionally, that when testing is enabled, that it still tests unit_tests (while disabled by the buildflag)14:44
rrahl0trying to package netplan for opensuse, but run into the issue that unit_testing fails (afaiu because there is no network interface)14:45
slyonrrahl0: that's great news (netplan for opensuse)! The -Dtesting build flag is pretty recent, so there might be some cases that we didn't think about, see https://github.com/canonical/netplan/pull/49314:59
slyonYou're talking about a scenario where "-Dtesting=true" but "-Dunit_testing=false" right?15:00
slyonOverall the unit-test should not rely on any network-interface on the system, but should be able to run in isolation15:00
slyonIf -Dunit_testing=false meson should not include anything in tests/ctests, so shouldn't run those tests15:01
rrahl0slyon: yes, I have a unit_testing which fails, (only lo is available)15:10
slyonwhich one is it? I would consider this a bug in upstream Netplan15:11
slyonFeel free to skip it in your local packaging and file a bug report (or PR fixing it).15:11
rrahl0give me a sec, I can rebuild the package, where the test fails15:11
rrahl0tbf, as opensuse uses NM as the default network manager, I have already seen some other tests fail, when switching the fallback backend15:12
rrahl0but for now I have left it at default15:12
rrahl0oh, just realized, when testing=false and unit_testing=true, it doesn't test anything :)15:15
rrahl0slyon: https://build.opensuse.org/package/live_build_log/home:rrahl0/netplan/openSUSE_Tumbleweed/x86_6415:17
slyonoh, the meson "unit-tests" are unrelated to the "-Dunit_testing" build flag (that's confusing, sorry!)15:18
slyonthe "unit-tests" can only be enabled/disabled using the new "-Dtesting" flag15:19
rrahl0ahh. makes now a little bit more sense then. :)15:20
slyonrrahl0: I'm afraid the "last 100 lines" of the log file that are shown here do not contain the actual failure. Do you have access to the full log file?15:20
rrahl0I should be able to build it locally, and hopefully I can find the log file then :)15:21
slyonside-note: the -Dunit_test controls the execution of the "test_netplan_*" tests, which seem to be passing for you15:21
rrahl0on tumbleweed yes, still need to fix up leap though. (tbf way older codebase :D)15:22
=== slyon changed the topic of #netplan to: Netplan v1.1 | Declarative network configuration for various backends | https://netplan.io | https://github.com/canonical/netplan | https://bugs.launchpad.net/netplan
rrahl0slyon: found out that the build VM doesn't get booted with systemd oO. so I have a couple tests failing https://paste.opensuse.org/pastes/f553555881ba15:27
rrahl0well seems like it's a opensuse issue15:27
slyonoh, interesting! Yeah, you probably need a systemd (build-)dependency15:28
rrahl0well i do have systemd as builddependecy, but i still don't understand why the VMs are not using systemd anyway. as systemd is the only pid1 opensuse offers15:30
rrahl0slyon: another question then. afaiu you can use netplan without netplan_cli? trying to figure out if I want to package dbus seperatly (to the cli tool)15:32
slyonthat's true. You can run the netplan-generator independently of netplan_cli (avoiding the Python runtime dependency). The D-Bus daemon still (currently) has a dependency on netplan_cli, though. As it's executing some commands on the Netplan CLI in some cases. We're trying to get rid of that in the future.15:35
slyonhere you can see the split of binary packages that I implemented for Debian: https://salsa.debian.org/debian/netplan.io/-/blob/debian/unstable/debian/control?ref_type=heads15:35
slyonlook into netplan-generator.install especially to see learn about the minimal Netplan tooling, which can be used to bring up networking at boot time: https://salsa.debian.org/debian/netplan.io/-/blob/debian/unstable/debian/netplan-generator.install?ref_type=heads15:36
rrahl0yeah, I already spied on the debian packaging :). ahh so I leave the packages seperately then, just adding a requires. hopefully the dependency is gone then. now I still have to do a PR (as the names for the python dependencies on rpm based distros is wrong)15:36
slyonlooking forward to your PR! :)15:37
rrahl0luckily we don't have that issue, as netplan was never in the repos, and as I am the first one doing the push for it, no legacy I have to care about :315:38
rrahl0the only problem is rather that leap has a 5y old codebase, which means a lot of stuff work different than nowadays15:39
KitsuWhooaslyon: Sorry, one more thing; Should I have the eui64 and stable-privacy tests separate, or combine them into one with two interfaces?16:08
slyonKitsuWhooa: both is fine for me, I guess. But maybe having it separate is cleaner as we could see from the test_name which case is failing16:10
KitsuWhooasounds good to me16:12
fanatic26Hi is this an active channel? I am getting desperate trying to figure out netplan and ive been failing at it for 3 days now21:16

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!