Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I am unable to configure what is wrong with my NTP server. I am using RHEL5. # vi /etc/ntp.conf restrict default kod nomodify notrap nopeer noquery restrict -6 default ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Posts
    49

    ntp server is not working on RHEL5 - any help?


    Hi,

    I am unable to configure what is wrong with my NTP server. I am using RHEL5.

    # vi /etc/ntp.conf
    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.182.0 mask 255.255.255.0 nomodify notrap

    server 0.rhel.pool.ntp.org
    server 1.rhel.pool.ntp.org
    server 2.rhel.pool.ntp.org

    server 127.127.1.0 # local clock
    fudge 127.127.1.0 stratum 10

    driftfile /var/lib/ntp/drift

    keys /etc/ntp/keys

    ========

    # cat /etc/sysconfig/ntpd
    # Drop root to id 'ntp:ntp' by default.
    OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"

    # Set to 'yes' to sync hw clock after successful ntpdate
    SYNC_HWCLOCK=no

    ========

    [root@station1 ~]# /etc/init.d/ntpd restart
    Shutting down ntpd: [ OK ]
    Starting ntpd: [ OK ]

    # tail -f /var/log/messages

    Apr 13 09:03:48 station1 ntpd[15334]: ntpd exiting on signal 15
    Apr 13 09:03:48 station1 ntpd[15473]: ntpd 4.2.2p1@1.1570-o Wed Nov 29 15:19:23 UTC 2006 (1)
    Apr 13 09:03:48 station1 ntpd[15474]: precision = 2.000 usec
    Apr 13 09:03:49 station1 ntpd[15474]: Listening on interface wildcard, 0.0.0.0#123 Disabled
    Apr 13 09:03:49 station1 ntpd[15474]: Listening on interface wildcard, ::#123 Disabled
    Apr 13 09:03:49 station1 ntpd[15474]: Listening on interface lo, ::1#123 Enabled
    Apr 13 09:03:49 station1 ntpd[15474]: Listening on interface eth0, fe80::20c:29ff:fe50:5d6#123 Enabled
    Apr 13 09:03:49 station1 ntpd[15474]: Listening on interface lo, 127.0.0.1#123 Enabled
    Apr 13 09:03:49 station1 ntpd[15474]: Listening on interface eth0, 192.168.182.10#123 Enabled
    Apr 13 09:03:49 station1 ntpd[15474]: kernel time sync status 0040
    Apr 13 09:03:49 station1 ntpd[15474]: frequency initialized -156.124 PPM from /var/lib/ntp/drift

    ########

    [root@station1 ~]# telnet 192.168.182.10 123
    Trying 192.168.182.10...
    telnet: connect to address 192.168.182.10: Connection refused
    telnet: Unable to connect to remote host: Connection refused

    [root@station1 ~]# /etc/init.d/iptables stop
    Flushing firewall rules: [ OK ]
    Setting chains to policy ACCEPT: filter [ OK ]
    Unloading iptables modules: [ OK ]

    [root@station1 ~]# telnet 192.168.182.10 123
    Trying 192.168.182.10...
    telnet: connect to address 192.168.182.10: Connection refused
    telnet: Unable to connect to remote host: Connection refused

    #####

    # pgrep ntpd
    15474
    # ll /var/run/ntpd.pid
    -rw-r--r-- 1 root root 5 Apr 13 09:03 /var/run/ntpd.pid

    #####

    # ntpq -p
    remote refid st t when poll reach delay offset jitter
    ================================================== ============================
    193.41.86.177 9.200.78.141 3 u 56 64 5 110.158 1080306 19.590
    mirror-01.mainl 192.36.143.152 2 u 53 64 7 48.015 1080306 26.405
    ntp2.cines.fr 195.83.180.3 2 u 52 64 7 45.342 1080306 54.446
    LOCAL(0) .LOCL. 10 l 53 64 7 0.000 0.000 0.002


    but I am unable to connect to port 123 even the following output shows its listening

    # netstat -an | grep 123
    udp 0 0 192.168.182.10:123 0.0.0.0:*
    udp 0 0 127.0.0.1:123 0.0.0.0:*
    udp 0 0 0.0.0.0:123 0.0.0.0:*
    udp 0 0 fe80::20c:29ff:fe50:5d6:123 :::*
    udp 0 0 ::1:123 :::*
    udp 0 0 :::123 :::*

    Can any body help me to sort this out?

    Many thanks.

  2. #2
    Linux Newbie
    Join Date
    Sep 2004
    Location
    UK
    Posts
    161
    Don't think you can use telnet to connect to a UDP port.

    The other stuff/printouts look normal.

    To test use another workstation (eg. workstation2) and set the NTP config on that machine to use workstation 1 as it's ntp server. It should work.

    OR on another workstation try:

    ntpdate -q 192.168.182.10
    In a world without walls and fences, who needs Windows and Gates?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •