Ntp server-Linux general technology-Linux technology and application information. For details, refer to the following section. 1. There are two operating systems: Red Hat 1 and Red Hat 2.
The address of Red Hat 2 is eth0: 192.168.1.3.
The address of Red Hat 1 is eth0: 192.168.1.2.
Setting Method: I set the Red Hat 1 machine to the NTP server and the others to the ntp client. That is to say, the system time of Red Hat 1 and Red Hat 2 is synchronized.
Edit/etc/ntp. conf to add the following content:
Restrict default ignore
Restrict 127.0.0.1
Restrict 192.168.1.2
Restrict 192.168.1.3 mask 255.255.255.0 nomodify
Driftfile/etc/ntp/drift
After writing, Press Esc and save and exit.
Start the ntp service
Service ntpd start
Netstat? Unl | grep 123
Ntptrace 192.168.1.2
Firewall
Iptables-t filter-a input-p udp -- sport 123-j ACCEPT
Iptables-t filter-a output-p udp -- dport 123-j ACCEPT
Time settings
Date DDDDMMMMYYYY
View bios time
Clock? R
Save bios time
Clock? W
Client:
Service ntpd stop
Ntpdate 192.168.1.2
How to prompt
[Root @ localhost ~] # Ntpdate 192.168.1.2
14 Jun 13:58:10 ntpdate [14770]: no server suitable for synchronization found
[Root @ localhost ~] # Ntpdate-d 192.168.1.2
14 Jun 13:40:54 ntpdate [14271]: ntpdate 4.2.2p1@1.1570-o Thu May 14 13:00:58 UTC 2009 (1)
Looking for host 192.168.1.2 and service ntp
Host found: 192.168.1.2
Transmit (192.168.1.2)
Transmit (192.168.1.2)
Transmit (192.168.1.2)
Transmit (192.168.1.2)
Transmit (192.168.1.2)
192.168.1.2: Server dropped: no data
Server 192.168.1.2, port 123
Stratum 0, precision 0, leap 00, trust 000
Refid [192.168.1.2], delay0.00000, dispersion 64.00000
Transmitted 4, in filter 4
Reference time: 00000000.00000000 Thu, Feb 7 2036 14:28:16. 000
Originate timestamp: 00000000.00000000 Thu, Feb 7 2036 14:28:16. 000
Transmit timestamp: d1a172e9.9f771865 Tue, Jun 14 2011 13:40:57. 622
Filter delay: 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
Filter offset: 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000
Delay 0.00000, dispersion 64.00000
Offset 0.000000
14 Jun 13:40:58 ntpdate [14271]: no server suitable for synchronization found
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.