<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 26/08/19 10:53 PM, Vernon Mauery
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20190826172315.GB45301@mauery.jf.intel.com">
<pre class="moz-quote-pre" wrap="">On 26-Aug-2019 07:25 PM, Alexander A. Filippov wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Our customers complain that they can't set custom ntp while dhcp is enabled on
bmc network interface.
I found out that the phosphor-networkd doesn't allow it in fact and it awaits
the list of ntp-servers in response from dhcp server. When BMC is configured
with a static IP address phosphor-networkd keep a list of ntp-service in the
configuration file of the network interface. In my opinion it is wrong.</pre>
</blockquote>
</blockquote>
<tt>Why this is wrong, Following are the rules for adding the NTP
servers</tt><br>
<tt>The NTP server to be used will be determined using the following
rules:</tt>
<ul style="list-style-type: disc; margin: 0.3em 0px 0px 1.6em;
padding: 0px; list-style-image: none; color: rgb(34, 34, 34);
font-size: 14px; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: 400;
letter-spacing: normal; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-style: initial; text-decoration-color:
initial;">
<li style="margin-bottom: 0.1em;"><tt>Any per-interface NTP
servers obtained from</tt><tt><span> </span></tt><code
style="color: rgb(34, 34, 34); background-color: rgb(235, 241,
245); border: 0px solid rgb(234, 236, 240); border-radius:
0px; padding: 0px 0.3em; display: inline-block;">systemd-networkd.service(8)</code><tt><span> </span></tt><tt>configuration
or via DHCP take precedence.</tt></li>
<li style="margin-bottom: 0.1em;"><tt>The NTP servers defined in</tt><tt><span> </span></tt><code
style="color: rgb(34, 34, 34); background-color: rgb(235, 241,
245); border: 0px solid rgb(234, 236, 240); border-radius:
0px; padding: 0px 0.3em; display: inline-block;">/etc/systemd/timesyncd.conf</code><tt><span> </span></tt><tt>will
be appended to the per-interface list at runtime and the
daemon will contact the servers in turn until one is found
that responds.</tt></li>
<li style="margin-bottom: 0.1em;"><tt>If no NTP server information
is acquired after completing those steps, the NTP server host
names or IP addresses defined in</tt><tt><span> </span></tt><code
style="color: rgb(34, 34, 34); background-color: rgb(235, 241,
245); border: 0px solid rgb(234, 236, 240); border-radius:
0px; padding: 0px 0.3em; display: inline-block;">FallbackNTP=</code><tt><span> </span></tt><tt>will
be used</tt></li>
</ul>
<tt><br>
</tt><tt><br>
</tt><tt>I don't see a problem in adding the NTP servers in the
networkd.conf, Spec also suggest the same.</tt><tt><br>
</tt>
<p><tt><a
href="https://wiki.archlinux.org/index.php/systemd-timesyncd">https://wiki.archlinux.org/index.php/systemd-timesyncd</a><br>
</tt></p>
<p><tt>Administrator may/not configure the DHCP server with NTP
servers, To make it simple we put a check that if DHCP is
enabled then don't allow the NTP server configuration.</tt></p>
<p><tt>If we have a scenario where DHCP server is configured as
"Don't send the NTP Server" and we want the NTP server we have
two ways</tt></p>
<p><tt>=> Either ask the admin to make the changes in the DHCP
server to supply the NTP server.</tt></p>
<p><tt>=> We may allow the NTP server configuration even if the
interface mode is DHCP.</tt><br>
</p>
<blockquote type="cite"
cite="mid:20190826172315.GB45301@mauery.jf.intel.com">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
This is pretty common behavior for DHCP settings. The DHCP server can
respond with all sorts of settings beyond just the ip/netmask/gateway.
NTP, DNS, TFTP (for PXE), etc., are all things that might get returned
by the DHCP server. Generally, if you are using DHCP, you just accept
those responses and use them because you assume that the network
administrator did the right thing and set them up.</pre>
</blockquote>
I agree with vernon and that was the intention behind the <br>
<blockquote type="cite"
cite="mid:20190826172315.GB45301@mauery.jf.intel.com">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">I propose to change this behavior:
- the list of ntp-service should be kept in /etc/systemd/timesyncd.conf
- the customization of ntp-servers should be independent from the network
inferface configuration.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
It seems to me that if you are using static settings for your network,
then you would also have static (or user-supplied) settings for NTP and
DNS. But if you are using DHCP for the network, it would make sense to
use the NTP and DNS settings supplied by the DHCP server.
Now it might also be nice to have some reasonable defaults for NTP
servers. It is not uncommon to have IP gateways also be NTP servers, so
it might be reasonable to attempt to use the gateway as an NTP server if
none was specified in the DHCP response. I don't like the idea of
setting the default NTP server to be something that is globally
addressable because that makes the assumption that the BMC can reach
global networks, which should not be the case.
--Vernon
</pre>
</blockquote>
</body>
</html>