NTP 最佳配置例子


Example NTP DeploymentsWAN Time Distribution NetworkIn the diagram below, a corporate autonomous system (AS) obtainstime information from three public time servers. The corporate AS isshown as Area 0 and Area 1 time servers. In this example, the NTPhierarchy follow the Open Shortest Path First (OSPF) hierarchy.However, OSPF is not a prerequisite for NTP. It is only used as anillustrative example. NTP may be deployed along other logicalhierarchical boundaries such as an Enhanced Interior Gateway RoutingProtocol (EIGRP) hierarchy or the standard Core/Distribution/Accesshierarchy.




The following is the Cisco IOS configuration for device A0-R1 in the above diagram.
clock timezone CST -5
clock summer-time CDT recurring


!--- This router has a hardware calendar.
!--- To configure a system as an
!--- authoritative time source for a network
!--- based on its hardware clock (calendar),
!--- use the clock calendar-valid global
!--- configuration command. Notice later that
!--- NTP will be allowed to update the calendar
!--- and Cisco IOS will be configured to be an
!--- NTP master clock source.
!--- Cisco IOS will then obtain its clock from
!--- the hardware calendar.



clock calendar-valid


!--- This allows NTP to update the hardware
!--- calendar chip.



ntp update-calendar


!--- Configures the Cisco IOS software as an
!--- NTP master clock to which peers synchronize
!--- themselves when an external NTP source is
!--- not available. Cisco IOS will obtain the
!--- clock from the hardware calendar based on
!--- the previous line. This line will keep the
!--- whole network in Sync even if Router1 loses
!--- its signal from the Internet. Assume, for
!--- this example, that the Internet time servers
!--- are stratum 2.



ntp master 3


!--- When the system sends an NTP packet, the
!--- source IP address is normally set to the
!--- address of the interface through which the
!--- NTP packet is sent.
!--- Change this to use loopback0.



ntp source Loopback0


!--- Enables NTP authentication.


ntp authenticate
ntp authentication-key 1234 md5 104D000A0618 7
ntp trusted-key 1234


!--- Configures the access control groups for
!--- the public servers and peers for additional
!--- security.



access-list 5 permit <I-TS-1>
access-list 5 permit <I-TS-2>
access-list 5 permit <I-TS-3>
access-list 5 permit <A0-R2>
access-list 5 permit <A0-R3>
access-list 5 deny any


!--- Configures the access control groups for the
!--- clients to this node for additional security.



access-list 6 permit <A1-R1>
access-list 6 permit <A1-R2>
access-list 6 permit <A1-R3>
access-list 6 deny any


!--- Restricts the IP addresses for the peers
!--- and clients.



ntp access-group peer 5
ntp access-group serve-only 6


!--- Fault tolerant configuration polling for 3 NTP
!--- public servers, peering with 2 local servers.



ntp server <I-TS-1>
ntp server <I-TS-2>
ntp server <I-TS-3>
ntp peer <A0-R2>
ntp peer <A0-R3>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值