<div dir="ltr"><div>Ok, I think I found a way forward that's not too hacky and is only a few lines of code change.</div><div><br></div><div>Part 1 is to tell systemd-networkd to always configure the IP address on the interface even if it doesn't have link. Is there a reason we're not already doing this? Right now, from what I can tell we lose an IP address on any interface if its link is not up and the IP address for another interface gets set or changed and then persisted by phosphor-networkd.</div><div><br></div><div></div><div>systemd-networkd can be reconfigured by adding the following to the "[Network]" section of the USB virtual NIC on the BMC:</div>ConfigureWithoutCarrier=true<br>IgnoreCarrierLoss=true<div><br></div><div>This looks as following then:</div><div><font face="monospace">root@bmc:~# cat /etc/systemd/network/00-bmc-usb0.network<br>[Match]<br>Name=usb0<br>[Link]<br>MACAddress=bc:46:a:4a:8a:d8<br>[Network]<br>LinkLocalAddressing=no<br>IPv6AcceptRA=false<br>DHCP=false<br>Address=<a href="http://169.254.254.254/24">169.254.254.254/24</a><br><b>ConfigureWithoutCarrier=true<br>IgnoreCarrierLoss=true<br></b>[DHCP]<br>ClientIdentifier=mac<br>UseDNS=true<br>UseNTP=true<br>UseHostname=true<br>SendHostname=true<br></font><div><br></div></div><div><br></div><div>However, this alone is not sufficient, since phosphor-networkd still clobbers the configuration file but without these parameters.</div><div><br></div><div>Part 2 is to tell phosphor-networkd to include "ConfigureWithoutCarrier=true" and "IgnoreCarrierLoss=true" in the generated configuration files. I'm proposing to make this behavior change via a configure parameter, similar to what we've done with --disable-link-local-autoconfiguration.</div><div><br></div><div>I'll make the necessary changes and will send a commit for review.</div><div><br></div><div>Oskar.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 10, 2019 at 1:00 PM Oskar Senft <<a href="mailto:osk@google.com">osk@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi everyone<div><br></div><div>I couldn't find any other mention of this and hope this hasn't been asked / answered / solved before.</div><div><br></div><div>We're using both an NC-SI based NIC and the USB virtual NIC on a AST2500 BMC (on the TYAN S7106 mainboard). I found that phosphor-networkd clobbers the networking configuration (IP address) for the USB virtual NIC (usb0) in the following scenario:</div><div><ol><li>The USB virtual NIC (usb0) has it default IP address hard coded in /etc/systemd/network/00-bmc-usb0.network.</li><li>The host has not yet loaded the USB NIC driver (cdc_ether). In this case the USB NIC on the BMC does not have an IP address assigned (I haven't investigated why that is, but it seems ok).</li><li>A process actively assigns / changes the IP address for the BMC's other NIC (i.e. eth0) via phosphor-networkd, e.g. via IPMI from the host.</li></ol><div>At step #3 phosphor-networkd overwrites all files in /etc/systemd/network (EthernetInterface::writeConfigurationFile() called from Manager::writeToConfigurationFile()). Specifically, it rewrites all files with information captured from the running system. Since the USB NIC (usb0) doesn't have an IP address at that time, the rewritten file is missing the IP address, too.<br></div></div><div><br></div><div></div><div>I can think of various ways to fix this:<br></div><div><ul><li>Make the host explicitly configure usb0 via IPMI before trying to talk with the BMC via the USB NIC. This won't work since we'd like to stop using IPMI from the host completely.</li><li>Enhance phosphor-networkd to always explicitly exclude "usb0" as a managed device. I wonder if this could be done by adding a new key/value pair to /etc/systemd/network/00-bmc-usb0.network, e.g. "[PhosphorNetworkD] managed=false". This seems pretty straightforward.<br></li><li>Come up with some "automatic" way to not clobber the configuration file if the running configuration does not match. It feels that this goes against the fundamental design of phosphor-networkd.</li></ul><div>Thoughts? Ideas? Opinions?</div></div><div><br></div><div>Thanks</div><div>Oskar.</div></div>
</blockquote></div>