centos 局域网时间同步设置
来源:互联网 发布:linux下的echo命令 编辑:程序博客网 时间:2024/05/16 04:39
系统环境,请查看《virtualbox5.0.8 centos6.7 mini 安装》
规划:
192.168.56.2 时间同步服务端,局域网内以此服务器为时间源
其他同网段机器作为客户端,向192.168.56.2发起同步请求
在所有机器上安装ntp
yum -y install ntp
#设置开机启动
chkconfig ntpd on
#开启服务
service ntpd start
192.168.56.2 上配置
#删除/etc/ntp.conf所有内容
echo > /etc/ntp.conf
vi /etc/ntp.conf
#修改成以下内容
driftfile /var/lib/ntp/drift
restrict default nomodify
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
#允许56.0网段同步
restrict 192.168.56.0 mask 255.255.255.0 nomodify notrap
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
#修改防火墙
vi /etc/sysconfig/iptables
在紧接着-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT 的下一行增加
#ntp
-A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT
#重启防火墙
service iptables restart
#其他客户端机器设置
vi /etc/sysconfig/ntpd
#在最后新加一行
SYNC_HWCLOCK=yes
vi /etc/ntp.conf
#删除所有内容,修改成以下内容
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
restrict 192.168.56.2 nomodify notrap noquery
server 192.168.56.2 iburst
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
#监视ntpd
ntpq -p
#正常情况出现
remote refid st t when poll reach delay offset jitter
==============================================================================
*192.168.56.2 LOCAL(0) 11 u 41 64 377 0.249 0.004 0.165
LOCAL(0) .LOCL. 10 l 1071 64 0 0.000 0.000 0.000
- centos 局域网时间同步设置
- centos 局域网时间同步(NTP)
- 关于局域网时间同步的设置方法
- Windows局域网通过NTP设置时间同步
- linux在局域网下设置时间同步
- centos下 时间同步设置
- 设置CentOS Linux系统时间自动同步
- CentOS 6.5 设置系统时间 同步
- 设置CentOS Linux系统时间自动同步
- 局域网中同步时间
- CentOS 6 时间,时区,设置修改及时间同步
- CentOS 6 时间,时区,设置修改及时间同步
- CentOS 6 时间,时区,设置修改及时间同步
- CentOS 6 时间,时区,设置修改及时间同步 .
- CentOS 6 时间,时区,设置修改及时间同步
- CentOS 6 时间,时区,设置修改及时间同步
- CentOS 6 时间,时区,设置修改及时间同步
- CentOS 6 时间,时区,设置修改及时间同步
- 设计一个二人五子棋游戏
- [汇编学习笔记][第十一章标志寄存器]
- 15. 3Sum
- Android开发在ADT中关联源码
- POJ 1681 Painter's Problem (高斯消元)
- centos 局域网时间同步设置
- c++第四次作业
- Python处理Excel(二):个性化Excel表格
- 指针数组和数组指针
- 13. Roman to Integer
- Jquery实现的Tabs标签页简洁版
- 冒泡排序法
- #leetcode#21. Merge Two Sorted Lists
- bat批处理