<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Greetings Mantas,</div>

<div> </div>

<div>here is what the command you've requested shows:</div>

<div> </div>

<div><span style="font-family: monospace;"><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">● 2: enp1s0</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                  Link File: /usr/lib/systemd/network/99-default.link</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">               Network File: /etc/systemd/network/enp1s0.network</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                      State: routable (configured)</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">               Online state: online                                         </span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                       Type: ether</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                       Path: pci-0000:01:00.0</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                     Driver: virtio_net</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                     Vendor: Red Hat, Inc.</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                      Model: Virtio 1.0 network device</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">           Hardware Address: xx:xx:xx:xx:xx:xx</span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                        MTU: 1500 (min: 68, max: 65535)</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                      QDisc: fq_codel</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">IPv6 Address Generation Mode: eui64</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">   Number of Queues (Tx/Rx): 1/1</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">           Auto negotiation: no</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                    Address: </span></span>169.254.39.180<br/>
<span style="font-family: monospace;"><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                             </span></span>192.168.0<span style="font-family: monospace;"><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">.10 (DHCPv4 via </span></span>192.168.0<span style="font-family: monospace;"><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">.1)</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                             xxxx::xxxx:xx:xxxx:xxxx</span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                    Gateway: </span></span>192.168.0<span style="font-family: monospace;"><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">.1</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">                        DNS: </span></span>192.168.0<span style="font-family: monospace;"><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">.1</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">          Activation Policy: up</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">        Required For Online: yes</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">           DHCPv4 Client ID: IAID:0x56504d98/DUID</span><span style="color: rgb(0,0,0);background-color: rgb(255,255,255);"> </span><br/>
<span style="color: rgb(0,0,0);background-color: rgb(255,255,255);">         DHCPv6 Client DUID: DUID-EN/Vendor:0000ab11ea37c4793baab851</span></span></div>

<div> 
<div> 
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Sent:</b> Monday, June 02, 2025 at 4:16 PM<br/>
<b>From:</b> "Mantas Mikulėnas" <grawity@gmail.com><br/>
<b>To:</b> "daggs" <daggs@gmx.com><br/>
<b>Cc:</b> systemd-devel@lists.freedesktop.org<br/>
<b>Subject:</b> Re: [systemd-devel] accepting dhcp address only from a specific mask</div>

<div>
<div>
<div>The second address looks like it comes from link-local, not from DHCP. I suspect you have a higher-priority .network file that also enables DHCP like yours does, but *also* sets "LinkLocalAddressing=both", like some of systemd's built-in example .network files tend to do. Check `networkctl status enp1s0` to verify which .network file is in use.</div>

<div> </div>

<div>(Default is "LinkLocalAddressing=ipv6", don't set it to "no" as that would break IPv6.)</div>
</div>
 

<div class="gmail_quote gmail_quote_container">
<div class="gmail_attr">On Mon, Jun 2, 2025 at 4:07 PM daggs <<a href="mailto:daggs@gmx.com" onclick="" target="_blank">daggs@gmx.com</a>> wrote:</div>

<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">Greetings,<br/>
<br/>
I have a qemu vm which runs a systemd based buildroot image, the vm's nic is virtio, if I configure systemd to auto start the nic, I get two ips for the only nic on the system, a valid one and in invalid one.<br/>
in this case, I can only connect to local lan but not outside of the last, I once were able to get to a situation where only the valid ip is set and tested outside connection at it worked.<br/>
here is the output of ip a:<br/>
<br/>
$ ip a<br/>
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000<br/>
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br/>
    inet <a href="http://127.0.0.1/8" target="_blank">127.0.0.1/8</a> scope host lo<br/>
       valid_lft forever preferred_lft forever<br/>
    inet6 ::1/128 scope host noprefixroute<br/>
       valid_lft forever preferred_lft forever<br/>
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP8000> mtu 1500 qdisc fq_codel qlen 1000<br/>
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff<br/>
    inet <a href="http://192.168.0.10/24" target="_blank">192.168.0.10/24</a> brd 192.168.0.255 scope global dynamic enp1s0<br/>
       valid_lft 40422sec preferred_lft 40422sec<br/>
    inet <a href="http://169.254.39.180/16" target="_blank">169.254.39.180/16</a> brd 169.254.255.255 scope global enp1s0<br/>
       valid_lft forever preferred_lft forever<br/>
    inet6 xxxx::xxxx:xx:xxxx:xxxx/64 scope link<br/>
       valid_lft forever preferred_lft forever<br/>
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1000<br/>
    link/sit 0.0.0.0 brd 0.0.0.0<br/>
<br/>
$ cat /etc/systemd/network/enp1s0.network<br/>
[Match]<br/>
Name=enp1s0<br/>
[Network]<br/>
DHCP=ipv4<br/>
<br/>
I'm no sure this is a systemd bug as I saw it when I tried a non systemd based env, so I'd like to try and prevent such allocation so the system will work until I can properly solve it.<br/>
is it possible?<br/>
<br/>
Thanks<br/>
<br/>
Dagg</blockquote>
</div>
</div>
</div>
</div>
</div></div></body></html>