Netplan is a tool used for network configuration management on Ubuntu. You can use Netplan to control the use of NTP over DHCP.
1.1. Opening the Netplan Configuration File:
The Netplan configuration file is usually found under the /etc/netplan/ directory. To edit this file, use:
sudo nano /etc/netplan/00-installer-config.yaml
1.2. Adding NTP Settings:
In the opened file, you can prevent NTP from being used over DHCP by adding the following configuration:
network: ethernets: ens18: # This should be changed according to your network adapter's name. renderer: networkd dhcp4: true dhcp4-overrides: use-ntp: false version: 2
Save your changes and exit the file.
To apply the configuration, run the following command:
sudo netplan apply
This command will activate the changes you made.
By default, Ubuntu has DHCP set to use NTP. However, in certain situations, you may want to disable this feature.
3.1. Default Usage of NTP over DHCP:
By default in Netplan, DHCP is set to use NTP with the use-ntp: true setting. However, if you want to disable this feature, you need to set the use-ntp: false value under dhcp4-overrides. This has been shown in the configuration mentioned above.