我找遍了,但找不到答案。
我可以使用我的树莓派作为 NTP 服务器(独立)。
我想在 LAN 上同步 4 个设备以进行日志记录,它们将在没有 WAN 访问的 LAN 上...一个是 Cisco 交换机,一个是 Pi,另外两个是我要登录的东西的转换盒(它们将是 NTP 客户端)。
我找到的所有答案都是使用 GPS 模块设置 Pi(我不能在这里做)或将其同步到外部 NTP 服务器以级联时钟(我不能在这里做)...我可以使用 NTP 只是发送 Pi 的系统时间吗?
您可能需要编辑 NTP 服务器的代码,因为没有太多的理由这样做。
最好的主意是在 RPihttp://www.reeve.com/Documents/Articles%20Papers/Reeve_GpsNtp-Pi.pdf上使用 GPS 帽
来自未来的亲爱的人们:这是我们到目前为止所发现的……
在 Raspberry Pi 上,运行以下命令:
sudo apt update
sudo apt install ntp
sudo ufw allow ntp # if your firewall is enabled
sudo ufw allow 123
sudo sed --in-place --expression "\$aserver 127.127.1.0" /etc/ntp.conf
sudo systemctl start ntpd
在 Cisco 交换机上,运行以下命令:
注— 如果使用 Cisco IOS,请不要忘记使用clock read-calendar
强制 NTP 同步。
configure terminal
ntp server <the IPv4 address of your Raspberry Pi>
end
clock read-calendar
PS-如果您想关闭所有设备...
在 Raspberry Pi 上,运行以下命令:
sudo ufw delete allow ntp
sudo ufw delete allow 123
sudo systemctl stop ntpd
sudo sed -i "/server 127.127.1.0/d" /etc/ntp.conf
在 Cisco 交换机上,运行以下命令:
configure terminal
no ntp server <the IPv4 address of your Raspberry Pi>
end
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(12条)