<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 15, 2017 at 11:21 AM, Lennart Poettering <span dir="ltr"><<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, 13.06.17 21:44, Amish (<a href="mailto:anon.amish@gmail.com">anon.amish@gmail.com</a>) wrote:<br>
<br>
> Hello,<br>
><br>
> I have the following in /etc/systemd/network/25-eth0.<wbr>network<br>
><br>
> [Match]<br>
> MACAddress=00:11:22:33:44:55<br>
><br>
> [Network]<br>
> Address=<a href="http://192.168.1.32/24" rel="noreferrer" target="_blank">192.168.1.32/24</a><br>
> Gateway=192.168.1.1<br>
><br>
> Now I have few "dynamic" routes where destination IP keeps changing.<br>
><br>
> Example:<br>
> /usr/bin/ip route add to 1.2.3.4 via 192.168.1.2 (Different gateway)<br>
><br>
> Many more routes are added by one script which keeps adding / deleting<br>
> routes based on certain algorithms.<br>
><br>
> Since destination IP keeps changing, I can not put it in [Route] section.<br>
><br>
> Now my problem is, if for any reason the interface loses carrier (cable<br>
> fault / switch / router reboot), the IP associated with it is removed and<br>
> hence all the routes added by script gets lost.<br>
><br>
> My question is how to stop this?<br>
><br>
> How do I tell systemd to not to delete IP address on "Lost carrier"?<br>
><br>
> I tried with:<br>
><br>
> BindCarrier=lo<br>
> OR<br>
> BindCarrier=eth0<br>
> OR<br>
> BindCarrier=lo eth0<br>
><br>
> But none worked.<br>
><br>
> Any idea / suggestions? Something similar to - CriticalConnection for DHCP?<br>
><br>
> Or may be we can have Persistent=true in "[Network]" OR "[Address]" section?<br>
<br>
</div></div>This is really not how networkd is supposed to be used. Either it<br>
manages an interface in its entirety or not at all. It's not designed<br>
to manage an interface only "half-way", i.e. manage addresses but not<br>
the routes.<br></blockquote><div><br></div><div>Hmm, that wasn't the actual question though, was it? The point was just to make networkd ignore carrier status (i.e. often there's no need to remove addresses just because the interface is down for a moment), not to stop managing halfway.</div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div></div>
</div></div>