custom ntp server in phosphor-networkd
Ratan Gupta
ratagupt at linux.vnet.ibm.com
Tue Aug 27 15:58:36 AEST 2019
On 26/08/19 10:53 PM, Vernon Mauery wrote:
> On 26-Aug-2019 07:25 PM, Alexander A. Filippov wrote:
>> 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.
Why this is wrong, Following are the rules for adding the NTP servers
The NTP server to be used will be determined using the following rules:
* Any per-interface NTP servers obtained
from|systemd-networkd.service(8)|configuration or via DHCP take
precedence.
* The NTP servers defined in|/etc/systemd/timesyncd.conf|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.
* If no NTP server information is acquired after completing those
steps, the NTP server host names or IP addresses defined
in|FallbackNTP=|will be used
I don't see a problem in adding the NTP servers in the networkd.conf,
Spec also suggest the same.
https://wiki.archlinux.org/index.php/systemd-timesyncd
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.
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
=> Either ask the admin to make the changes in the DHCP server to supply
the NTP server.
=> We may allow the NTP server configuration even if the interface mode
is DHCP.
> 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.
I agree with vernon and that was the intention behind the
>
>> 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.
>>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20190827/eb77298e/attachment-0001.htm>
More information about the openbmc
mailing list