(一)修改/etc/ntp.conf 配置文件,注意红色部分,其他部分不需要改 

####################################################################

# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
#restrict default nomodify notrap nopeer noquery
restrict default ignore

# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
#restrict 127.0.0.1
#restrict ::1

# Hosts on local network are less restricted.
restrict 192.168.2.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 127.127.1.0
fudge 127.127.1.0 stratum 10

#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

# Disable the monitoring facility to prevent amplification attacks using ntpdc
# monlist command when default restrict does not include the noquery flag. See
# CVE-2013-5211 for more details.
# Note: Monitoring will not be disabled with the limited restriction flag.
disable monitor
#server time.windows.com
#server s2m.time.edu.cn
#server 0.asia.pool.ntp.org
#server 1.asia.pool.ntp.org
#server 2.asia.pool.ntp.org
#server 3.asia.pool.ntp.org
#server 127.127.1.0 iburst local clock
#restrict 192.168.2.1 mask 255.255.255.0 nomodify

###############################################################################

(二)启动service ntpd restart

chkconfig --level 345 ntpd on --添加启动

 测试

ntpdate 192.168.2.130 -地址为 ntp服务器地址

(三)客户端配置同步

crontab -e

00 */1 * * *  /usr/sbin/ntpdate 192.168.2.130;/sbin/hwclock -w

centos7.2 配置内网ntp服务器进行时间同步的更多相关文章

  1. CentOS搭建内网NTP服务器

      在企业内部网络,不是所有的服务器都可以连接外网,需要搭建一台可以连接外网的服务器用于NTP服务器 安装环境查看 安装ntp yum -y install ntp 修改配置文件 driftfile ...

  2. 1.内网ntp服务器的搭建

    1.拓扑图

  3. 部署NTP服务器进行时间同步

    NTP服务端:linl_S    IP:10.0.0.15 NTP客户端:lin_C    IP:10.0.0.16 NTP服务概述 1.原理 NTP(Network TimeProtocol,网络时 ...

  4. Apache James搭建内网邮件服务器

    Apache James搭建内网邮件服务器 极客521 | 极客521 2014-08-21 148 阅读 java 大概之前两个礼拜的日子,讨论会介绍了关于了.net内网邮件服务器的搭建.所以自己也 ...

  5. VMware虚拟机配置内网电脑能访问

    关键字:内网访问虚拟机.内网访问Linux虚拟机.虚拟机访问外部网络 1.vmware虚拟机网络设置为桥接模式 2.虚拟机配置iP地址,以linux系统为示例. 勾选自动连接,选择手动配置ip,然后配 ...

  6. 外网zabbix-server使用主动模式监控公司内网windows服务器

    外网zabbix-server使用主动模式监控公司内网windows服务器 1.Zabbix Agent active批量调整客户端为主动模式监控将Template OS Windows模板调整为主动 ...

  7. 配置内网DNS实现内部域名解析

    服务器 实战目的: ü 配置内网的DNS服务器实现内网服务器的域名解析. ü 配置内网的DNS服务器减少到Internet的域名解析流量. ü 配置内网的DNS服务器实现Internet上服务器的域名 ...

  8. 云计算之路-试用Azure:搭建自己的内网DNS服务器

    之前我们写过一篇博文谈到Azure内置的内网DNS服务器不能跨Cloud Service,而我们的虚拟机部署场景恰恰需要跨多个Cloud Service,所以目前只能选择用Azure虚拟机搭建自己的内 ...

  9. 内网客户 通过 公网域名/ip 访问内网web服务器 出错

    在一内部局域网中, client  内网地址为 10.0.0.2     web  服务器内网地址为 10.0.0.1    外网地址为  211.6.15.1    域名为  xx.love.com ...

随机推荐

  1. appium+Python 启动app(三)登录

    我们根据前面的知识点,用uiautomatorviewer工具来获取我们当前的元素 (注:uiautomatorviewer 是 android sdk 自带的) 知识点:appium的webdriv ...

  2. [翻译]编写高性能 .NET 代码 第二章:垃圾回收 基本操作

    返回目录 基本操作 垃圾回收的算法细节还在不断完善中,性能还会有进一步的提升.下文介绍的内容在不同的.NET版本里会略有不同,但大方向是不会有变动的. 在.net进程里会管理2个类型的内存堆:托管和非 ...

  3. 分布式缓存一致性hash算法理解

    今天阅读了一下大型网络技术架构这本苏中的分布式缓存一致性hash算法这一节,针对大型分布式系统来说,缓存在该系统中必不可少,分布式集群环境中,会出现添加缓存节点的需求,这样需要保障缓存服务器中对缓存的 ...

  4. Eclipse搭建Maven项目之准备工作

    Maven是优秀的Java项目对象模型解决方案,意为知识的积累(意地绪文),Maven可以方便的解决Java项目包依赖问题,通过配置pom.xml引入依赖,并自动引入其他依赖. 操作系统版本:wind ...

  5. 买帽子 (hash)

    思路:表示数字i出现的次数,在输入的同时记录每个数字出现的次数.最后从0枚举到1000判断第三个是否存在,存在则记录该数字. #include <stdio.h> #include < ...

  6. hdu 2048 递推&&错排

    直接贴出递推公式: cnt[n]=(i-1)*(cnt[n-1]+cnt[n-2]); 数组保存的是失败的种数 AC代码: #include<cstdio> const int maxn= ...

  7. HDU - 2187 贪心

    思路:  按照单价升序排序,依次买就行. AC代码 #include <cstdio> #include <cmath> #include <algorithm> ...

  8. Java线程和守护进程

    ava的线程机制,有两类线程:User Thread(用户线程).Daemon Thread(守护线程) . 操作系统里面是没有守护线程的概念,只有守护进程,但是Java语言机制是构建在JVM的基础之 ...

  9. redis 突然大量逐出导致读写请求block

    现象 redis作为缓存场景使用,内存耗尽时,突然出现大量的逐出,在这个逐出的过程中阻塞正常的读写请求,导致 redis 短时间不可用: 背景 redis 中的LRU是如何实现的? 当mem_used ...

  10. 网络请求的Cookie组成

    Cookie是由变量名和值对组成(key,value).其属性里既有标准的Cookie变量,也有用户自己创建的变量,属性中变量是用"变量=值"形式来保存.根据Netscape公司的 ...