0

I am running a Ubuntu 18.04 server with ntp installed. I need NTP to synchronize time in ordet to let a Munge-service to work correctly.

My firewall is not enabled, however I have added rules to allow ntp. Both the server and client yields that the udp-port 123 is open. Thus running the following commands at the instances: Server:sudo nmap -sU -p123 192.168.1.1

Client:sudo nmap -sU -p123 192.168.1.1

Results in a response that the udp port 123 is "open|filtered" and used by the ntp-service.

I have the following setup:

ntp.conf @ NTP-server:

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

leapfile /usr/share/zoneinfo/leap-seconds.list

statistics loopstats peerstats clockstats

filegen loopstats file loopstats type day enable

filegen peerstats file peerstats type day enable

filegen clockstats file clockstats type day enable

restrict -4 default kod notrap nomodify nopeer noquery limited

restrict -6 default kod notrap nomodify nopeer noquery limited

restrict 127.0.0.1

restrict ::1


restrict source notrap nomodify noquery

restrict 192.168.1.0 mask 255.255.255.0 notrust
broadcast 192.168.1.1 

disable auth

ntp.conf @ clients:

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

leapfile /usr/share/zoneinfo/leap-seconds.list

statistics loopstats peerstats clockstats

filegen loopstats file loopstats type day enable

filegen peerstats file peerstats type day enable

filegen clockstats file clockstats type day enable

server 192.168.1.1 prefer

restrict default notrust nomodify nopeer

restrict 192.168.1.1 

After stopping and starting the ntp-service (at the server) the following tcpdump command is typed at the client:

sudo tcpdump -i enp5s0f1 udp port 123 -vvv

(As a sidenote, if any one struggles with the same issue, I noticed that the tcpdump command first yielded that there where a bad checksum in recived udp-package, but after setting offload (for checksumming) of both the rx and tx to off, of the connect ethernet-device, (via ethtool), the bad checksum-error where rectified).

Results in an output (recieved after quite some time) stating that the clocks are not synchronized. Running (@ the client) ntpdate -u 192.168.1.1 yields that "no servers suitable for synchronization found".

Running the ntpq -pn at the server yields that the refid is in state .BCST, but at the client it is noted as .INIT. and will not be changed (after several hours of waiting).

What am I missing out on? Any help is much appreciated. Regards, P.

4
  • For full support on >=18.04 you should use chrony instead of ntpd anyway. Maybe that switch resolves your issue at the same time? Jul 4, 2019 at 11:51
  • Thank you! Will try straight away.
    – Pälle
    Jul 4, 2019 at 12:18
  • It work straight out of the box, with small modifications to the chrony.conf-file. Thanks!
    – Pälle
    Jul 4, 2019 at 12:51
  • Great, glad this helped, let me write an answer then to be clear to others facing the same. Jul 5, 2019 at 9:16

1 Answer 1

0

For full support on >=18.04 you should use chrony instead of ntpd.

Switching this resolved the issue for the reporter, documenting as answer to be more easily found than in just the comments.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .