ntp内网时间同步(基于centos6.5)
2015-08-12 13:09
651 查看
ntp内网时间同步(基于centos6.5)
服务器端:
安装ntp
yum install ntp
编辑配置文件
vi /etc/ntp.conf
添加
restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap
server time-b.nist.gov
其他server都注释掉
vi /etc/sysconf/iptables
添加iptables规则
-A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT
重启iptables
sudo service iptables restart
重启ntp
sudo service ntpd restart
客户端:
安装ntp
yum install ntp
编辑配置文件
vi /etc/ntp.conf
添加
server 192.168.10.111
其他server都注释掉
同步时间
sudo ntpdate 192.168.10.111
把同步命令添加到任务计划
查看时间
date
所有客户端机器都跟ntp服务器时间同步!
本文出自 “linux&云计算” 博客,请务必保留此出处http://czbinghe.blog.51cto.com/9824423/1683958
服务器端:
安装ntp
yum install ntp
编辑配置文件
vi /etc/ntp.conf
添加
restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap
server time-b.nist.gov
其他server都注释掉
vi /etc/sysconf/iptables
添加iptables规则
-A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT
重启iptables
sudo service iptables restart
重启ntp
sudo service ntpd restart
客户端:
安装ntp
yum install ntp
编辑配置文件
vi /etc/ntp.conf
添加
server 192.168.10.111
其他server都注释掉
同步时间
sudo ntpdate 192.168.10.111
把同步命令添加到任务计划
查看时间
date
所有客户端机器都跟ntp服务器时间同步!
本文出自 “linux&云计算” 博客,请务必保留此出处http://czbinghe.blog.51cto.com/9824423/1683958
相关文章推荐
- Linux Command Line 详细解析
- ubuntu 14.04系统 安装搜狗输入法
- Centos 6.5 启动DHCP报错 Can't chown new lease file: Operation not permitted
- linux下提示一些基本的命令找不到
- centos 软件下载链接
- linux中inittab文件详解
- centos双系统恢复windows启动项
- CentOS 6.3下配置multipah
- win10装centos双系统之后,win10的启动项消失的解决方法
- windows中间vmware的Linux系统安装jdk步骤
- arm linux 分区
- Linux下find命令用法小结
- linux(debian/ubuntu)下连接安卓手机--小米4为例
- Linux下各种性能监控的命令(整理)
- linux sfdisk partition
- 每次安装linux系统后,原来的win8就没有了
- Linux学习记录(1)安装VirtualBox虚拟机
- linux命令大全
- linux 2.6内核的驱动系列教程
- Linux Socket