$^' /etc/ntp.conf
样例输出为:
tos minclock 3 maxclock 6
pool 0.freebsd.pool.ntp.org iburst
restrictdefault limited kod nomodify notrap noquery nopeer
restrict -6 default limited kod nomodify notrap noquery nopeer
restrictsource limited kod nomodify notrap noquery
restrict 127.0.0.1
restrict -6 ::1
leapfile"/var/db/ntpd.leap-seconds.list"
interface ignore wildcard
interface listen 172.16.3.1
interface listen 10.105.28.1
重启 ntpd
在 FreeBSD Unix 之上重新加载/重启 ntpd:
$ sudo /etc/rc.d/ntpd restart
或者 在 Debian 和 Ubuntu Linux 之上使用下面的命令:
$ sudo systemctl restart ntp
或者 在 CentOS/RHEL 7/Fedora Linux 之上使用下面的命令:
$ sudo systemctl restart ntpd
校验
使用 netstat 和 ss 命令来检查 ntpd 只绑定到了特定的 IP 地址:
$ netstat -tulpn
关键词:怎样在Linux/Unix之上绑定ntpd到特定的IP地址