当前位置:网站首页>Debian 10 NTP Service Configuration
Debian 10 NTP Service Configuration
2022-08-02 03:34:00 【live and dream】
目录
三、Test screenshots and scoring requirements
一、题目要求
NTP
安装 ntp(使用其他 ntp 软件,None of the following features will be scored);
在 AppSrv 和 StorageSrv 上创建 CRON 计划任务;
使用 ntpdate 指令,每隔五分钟进行一次时间同步;
二、配置过程
IspSrv
1.下载ntp服务
[email protected]:~# apt -y install ntp
2.进入ntp配置文件
[email protected]:~# vim /etc/ntp.conf
3.修改ntp配置文件
23 #pool 0.debian.pool.ntp.org iburst #注释,Turn off sync from the web
24 #pool 1.debian.pool.ntp.org iburst
25 #pool 2.debian.pool.ntp.org iburst
26 #pool 3.debian.pool.ntp.org iburst
27 server 127.127.1.0 #server指定ntp服务器的地址 将当前主机作为时间服务器
28 fudge 127.127.1.0 stratum 5 #fudge设置时间服务器的层级 stratum 0~15 ,0:表示顶级 , 10:通常用于给局域网主机提供时间服务
#注意:fudge必须和server一块用, 而且是在server的下一行
41 #restrict -4 default kod notrap nomodify nopeer no query limited #注释
42 #restrict -6 default kod notrap nomodify nopeer no query limited
46 restrict 81.6.63.0 mask 255.255.255.0 #Which network segments are allowed to sync time here
4.重启ntp服务
[email protected]:~# systemctl restart ntp.service
5.放开防火墙端口
[email protected]:~# iptables -A INPUT -p udp --dport 123 -j ACCEPT
[email protected]:~# iptables -A OUTPUT -p udp --sport 123 -j ACCEPT
6.保存规则
[email protected]:~# netfilter-persistent save
RouterSrv
1.放开iptableson the corresponding port
[email protected]:~# iptables -A FORWARD -p udp --dport 123 -j ACCEPT
2.保存规则
[email protected]:~# netfilter-persistent save
AppSrv
1.安装ntpdate指令
[email protected]:~# apt -y install ntpdate
2.进入CRON服务配置文件
[email protected]:~# vim /etc/crontab
3.创建 CRON 计划任务,每5Minutes to sync automatically4.
*/5 * * * * root /usr/sbin/ntpdate 81.6.63.100 #每5分钟到81.6.63.100自动同步时间
4.重新启动下CRON计划任务
[email protected]:~# systemctl restart cron.service
5.Open the port corresponding to the firewall
[email protected]:~# iptables -A INPUT -p udp --sport 123 -j ACCEPT
[email protected]:~# netfilter-persistent save
StorageSrv
1.安装ntpdate指令
[email protected]:~# apt -y install ntpdate
2.进入CRON服务配置文件
[email protected]:~# vim /etc/crontab
3.创建 CRON 计划任务,每5Minutes to sync automatically4.
*/5 * * * * root /usr/sbin/ntpdate 81.6.63.100 #每5分钟到81.6.63.100自动同步时间
4.重新启动下CRON计划任务
[email protected]:~# systemctl restart cron.service
5.Open the port corresponding to the firewall
[email protected]:~# iptables -A INPUT -p udp --sport 123 -j ACCEPT
[email protected]:~# netfilter-persistent save
三、Test screenshots and scoring requirements
测试:IspSrv
评分细则:
测试:AppSrv与StorageSrv
评分细则:
边栏推荐
猜你喜欢
随机推荐
2022年比若依更香的开源项目
Day34 LeetCode
化学试剂磷脂-聚乙二醇-羟基,DSPE-PEG-OH,DSPE-PEG-Hydroxyl,MW:5000
MySQL分页查询的5种方法
小程序组件总结
【深度学习】从LeNet-5识别手写数字入门深度学习
线性代数学习笔记2-2:向量空间、子空间、最大无关组、基、秩与空间维数
支付通道对接常见的问题有哪些?
知识问答与知识会话的区别
debian 10 nat 与路由转发
分布式领域最重要的一篇论文,到底讲了什么?
mysql卸载详细教程
TRICK第二弹
About cross-domain issues
MySQL分组后排序
Redis笔记基础篇:6分钟看完Redis的八种数据类型
基于libmodbus库实现modbus TCP/RTU通信
Redis simple study notes
源码构建LAMP环境-1
RHCSA第三天