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

imcomHi netplan team, I am having trouble with netplan on ubuntu2204, I need to configure link-lock addresses to interfaces that managed by netplan, but I constantly fail to do so, netplan quietly does NOT add the IP address like 169.254.111.101 to the interface I specify. What issues might that be? Thanks in advance10:44
imcomAlso, it seems a bit strange to be that netplan is generating the Address attribute under [Network] section instead of [Address] section, can anyone shed some lights on this behavior ?10:45
slyonimcom: can you share some relevant bits of your Netplan configuration? I assume you're using the "link-local: [ ipv4, ipv6 ]" setting, right? Also, from your 2nd comment I assume you're using the systemd-networkd backend, right?10:47
danilogondolfonote that "An IPv4 link-local address is configured when ... DHCPv4 autoconfiguration has been unsuccessful for some time". From systemd.network(5)10:49
imcomhi slyon, yes, we are running ubuntu-server so systemd-networkd is the backend. Let me share the netplan yml here, give me a sec. We tried to use link-local: [ipv4] , but it did not solve the issue, but instead, it gets an auto-assigned ipv4 address on the same interface ....10:50
imcomwe do not use DHCP, all interfaces and IP addresses are statically configured. There was no issue with the same netplan config when we use 1804 and 200410:52
imcomim getting a demo config from my coworker, give me several minutes to post the config :D10:52
imcomthe issue is that we want to use link-local address deliberately to some of the interfaces by specifying them in netplan config11:09
imcomalso, there is the situation that if we add the addr via `ip addr add` and then run netplan apply again, the address will be removed from the interface11:09
imcomnetwork:11:10
imcom  version: 211:10
imcom  renderer: networkd11:10
slyonso you're using "addresses: [ 169.254.111.101/24 ]" ?11:10
imcomcorrect11:10
slyonimcom: maybe use something like https://dpaste.org/ to share the config11:10
imcomwe want to avoid network conflict with customer's network, so we would like to exploit the link-local addrs11:11
imcomsure11:11
slyonIt seems to be working for me locally, manually assigning a link-local address. I'm on Ubuntu 24.04, though. Using a different version of Netplan (and systemd-networkd).11:11
imcomhttps://dpaste.org/R6yvy11:12
slyonIt doesn't seem to be working in combination with DHCP4 or probably "link-local: [ipv4]", as noted by danilogondolfo above11:12
imcom>It seems to be working for me locally, manually assigning a link-local address. I'm on Ubuntu 24.04, though. Using a different version of Netplan (and systemd-networkd).11:12
imcomif we manually assign the address, it applied, but after restart networkd or run netplan apply, the address will be removed11:12
imcom>It doesn't seem to be working in combination with DHCP4 or probably "link-local: [ipv4]", as noted by danilogondolfo above11:13
imcomyes, but it is not our case11:13
slyonwell, yes. Manually assigning via "ip addr" is expected to be temporary. With "Manually" I meant Netplan "addresses: [...]"11:14
imcomoh ok ok, but in 2204, we cannot do this Netplan "addresses: [...]" as well ..11:16
imcomno link-local address is added to the interface ..11:16
slyonimcom, you mentioned above "but instead, it gets an auto-assigned ipv4 address on the same interface", what kind of auto-configuration is that, where does it come from?11:18
slyonimcom: Hmm.. I cannot seem to reporduce in a 22.04 container. (But also the container's network setup is much less complex than yours). But manually assigning a link-local address seems work and is persistent. Can you confirm this minimal example works on your end? https://dpaste.org/Gd7M111:23
imcom>you mentioned above "but instead, it gets an auto-assigned ipv4 address on the same interface", what kind of auto-configuration is that, where does it come from?11:30
imcomif we enable link-lock: [ipv4] there is an additional link-local addr to be assigned by the system11:30
slyonoh right, that's the expected behavior. It will auto-config a link-local address in case of "link-local: [ipv4]". But that's not what you want (and not part of the configu you shared).11:40
danilogondolfoso, there is an important observation about the IPv4 link-local address in the RFC https://datatracker.ietf.org/doc/html/rfc3927#section-1.612:34
danilogondolfoyou basically should not do that :)12:34
danilogondolfosomething (networkd?) might be getting rid of it because they simply can. I'm just guessing here though12:35

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