NTP

Differences between revisions 3 and 4
Revision 3 as of 2015-01-23 17:46:52
Size: 3420
Comment: Jonathan Ferguson
Revision 4 as of 2015-12-09 15:49:12
Size: 3418
Comment: Jonathan Ferguson
Deletions are marked like this. Additions are marked like this.
Line 48: Line 48:
''[[https://wiki.edubuntu.org/JonathanFerguson/NTP]]'' ''[[https://wiki.ubuntu.com/JonathanFerguson/NTP]]''


Per the following paragraph from http://doc.ntp.org/4.2.0/manyopt.html

It is possible and frequently useful to configure a host as both manycast client and manycast server. A number of hosts configured this way and sharing a common group address will automatically organize themselves in an optimum configuration based on stratum and synchronization distance. For example, consider an NTP subnet of two primary servers and a hundred or more dependent clients. With two exceptions, all servers and clients have identical configuration files including both multicastclient and multicastserver commands using, for instance, multicast group address 239.1.1.1. The only exception is that each primary server configuration file must include commands for the primary reference source such as a GPS receiver.

Per the following paragraph from http://doc.ntp.org/4.2.6/manyopt.html

It is possible and frequently useful to configure a host as both broadcast client and broadcast server. A number of hosts configured this way and sharing a common broadcast address will automatically organize themselves in an optimum configuration based on stratum and synchronization distance.

Append the mentioned configuration to /etc/ntp.conf
echo -e "\n# As a server" | sudo tee -a /etc/ntp.conf \
&& echo -e "broadcast 224.0.1.1 ttl 255\t\t#Used with multicastclient" | sudo tee -a /etc/ntp.conf \
&& echo -e "broadcast ff05::101 ttl 255\t\t#Used with multicastclient" | sudo tee -a /etc/ntp.conf \
&& echo -e "manycastserver 224.0.1.1 ttl 255\t#Used with manycastclient" | sudo tee -a /etc/ntp.conf \
&& echo -e "manycastserver ff05::101 ttl 255\t#Used with manycastclient" | sudo tee -a /etc/ntp.conf \
&& echo -e "\n# As a client" | sudo tee -a /etc/ntp.conf \
&& echo -e "server -6 2.au.pool.ntp.org burst iburst prefer" | sudo tee -a /etc/ntp.conf \
&& echo -e "#broadcastclient\t\t\t#Optionally receive from legacy devices" | sudo tee -a /etc/ntp.conf \
&& echo -e "manycastclient 224.0.1.1 ttl 255\t#Used with manycastserver" | sudo tee -a /etc/ntp.conf \
&& echo -e "manycastclient ff05::101 ttl 255\t#Used with manycastserver" | sudo tee -a /etc/ntp.conf \
&& echo -e "multicastclient 224.0.1.1\t\t#Used with broadcast" | sudo tee -a /etc/ntp.conf \
&& echo -e "multicastclient ff05::101\t\t#Used with broadcast" | sudo tee -a /etc/ntp.conf

Alternatively the desired result can be achieved by copying and pasting:
sudo nano /etc/ntp.conf

# As a server
broadcast 224.0.1.1 ttl 255             #Used with multicastclient
broadcast ff05::101 ttl 255             #Used with multicastclient
manycastserver 224.0.1.1 ttl 255        #Used with manycastclient
manycastserver ff05::101 ttl 255        #Used with manycastclient

# As a client
server -6 2.au.pool.ntp.org burst iburst prefer
#broadcastclient                        #Optionally receive from legacy devices
manycastclient 224.0.1.1 ttl 255        #Used with manycastserver
manycastclient ff05::101 ttl 255        #Used with manycastserver
multicastclient 224.0.1.1               #Used with broadcast
multicastclient ff05::101               #Used with broadcast

Restart the daemon:
sudo /etc/init.d/ntp try-restart

Prove that the configuration is correct:
ntptrace


https://wiki.ubuntu.com/JonathanFerguson/NTP


JonathanFerguson/NTP (last edited 2025-03-28 04:20:43 by jonathan-ferguson)