da7533aad4
Why I did it Currently, there is a bug in the ntp.conf jinja2 template where it will ignore the src_intf directive in CONFIG_DB if there are multiple IP addresses associated with an interface. This code change fixes that bug and allows the template to select the correct source interface for NTP. How I did it I did this by modifying the macro in ntp.conf.j2 which determines if there is an ip address associated with an interface to set a state variable when it detects a valid interface entry in CONFIG_DB instead of outputting "true" directly (which could result in multiple "trues" outputted for interfaces with multiple valid IP addresses). How to verify it Add two ipv4 addresses to an interface in SONiC Add the following configuration to config_db.json { "NTP": { "global": { "src_intf": "Ethernet1" } } } Replace Ethernet1 with the interface name of the one you assigned the IP addresses to. Run sudo config reload -y Open /etc/ntp.conf and verify that the following line exists ... interface listen Ethernet1 ... The interface specified should be the one set in the previous steps. Description for the changelog [ntp] Fix ntp.conf template to allow setting of source port in CONFIG_DB |
||
---|---|---|
.. | ||
ntp | ||
ntp-apparmor | ||
ntp-config.service | ||
ntp-config.sh | ||
ntp-systemd-wrapper | ||
ntp.conf.j2 | ||
ntp.service |