【ntp】为什么ntp服务需要开启双向(服务器端和客户端) udp123端口?

【ntp】为什么ntp服务需要开启双向(服务器端和客户端) udp123端口?,第1张

ntpd服务作为既可以作ntpServer,又可以作ntpClient ,只是配置上稍有不同。

ntpd服务运行时需要开启双向(服务器端和客户端) udp/123端口

# yum install  iptables  iptables-services

# iptables  -A INPUT -p udp  -m udp --dport  123   -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

# iptables  -A  OUTPUT -p udp  -m udp --dport  123   -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

#  systemctl restart iptables.service

# yum  -y install firewalld

# firewall-cmd --zone=public  --add-port=123/udp --permanent

# firewall-cmd --reload

What are the iptables rules to permit ntp?

https://superuser.com/questions/141772/what-are-the-iptables-rules-to-permit-ntp

Why does NTP require bi-directional firewall access to UDP port 123?

https://superuser.com/questions/762579/why-does-ntp-require-bi-directional-firewall-access-to-udp-port-123

Troubleshooting NTP

http://support.ntp.org/bin/view/Support/TroubleshootingNTP

【chrony】CentOS7.2 上chrony的安装与配置

https://www.jianshu.com/p/a8976ed21422

【ntp】CentOS7.x ntpd作为ntpServer ntpClient 的安装配置

https://www.jianshu.com/p/8513a4bbd257

【systemd+iptables】用systemd定义一个iptables防火墙系统服务

https://www.jianshu.com/p/96d179f4e444

【firewalld】CentOS 上的 firewalld 简明指南

https://www.jianshu.com/p/2cd238f6df71

1、首先在电脑上打开linux系统。再cd和su命令进入root用户。

2、然后检查linux系统的时间。命令为date  +%F +%T。

3、启动ntp服务。命令为service ntp start。

4、进入etc/init.d/文件。再启动ntp服务。

5、可以连接服务器更新时间。命令为ntpdate ip地址。

6、设置ntpd开机启动项。再规定ntpd服务自动启动。

转自( https://www.cnblogs.com/pipci/p/14672772.html )

1.进入到服务器,依次点击:windows+R弹出运行窗口---regedit---确定

然后点击确定。

2.依次展开:HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/W32Time/TimeProviders/NtpServer

在NtpServer项的右侧键值Enablied,将默认的0

改为1,1为启用NTP服务器。

3.依次展开:HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/W32Time/Config

找到Config项右侧的AnnounceFlags。

把默认的10改为5

5的意思就是自身为可靠的时间源

4.修改完以上之后关闭注册表编辑器

再:windows+R弹出运行窗口---services.msc---确定,找到Windows Time服务,启动并设置开机启动

5、打开命令提示符或PowerShell窗口‘输入net stop w32time停止服务,再输入net start w32time启动服务

6、输入命令w32tm /stripchart /computer:127.0.0.1,有时间回显说明配置成功了。到此在win10上配置NTP时间同步服务器的方法就介绍完了。

7、添加防火墙规则

控制面板--->系统和安全--->windows防火墙--->高级设置--->入站规则(右键)--->新建规则--->端口 ---下一步----UDP----特定本地端口:123(不要换别的)

一直点下一步,直到下面这个页面填写名称:NTP,完成

7.linux系统使用命令ntpdate -u $windows机器IP同步时间就可以了,windows在时间设置上设置该机器IP然后点同步更新


欢迎分享,转载请注明来源:夏雨云

原文地址:https://www.xiayuyun.com/zonghe/560829.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-07-01
下一篇2023-07-01

发表评论

登录后才能评论

评论列表(0条)

    保存