Operating System - Linux
1753907 Members
9006 Online
108810 Solutions
New Discussion юеВ

Re: How to know which IPs are querying my ntp server?

 
MD Shafiullah
Occasional Advisor

How to know which IPs are querying my ntp server?

I have a linux ntp server. I want to know which servers are doing query to my ntp server. I want to know the IP address. Can anyone help how to do that?
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: How to know which IPs are querying my ntp server?

Shalom,

If logged ntp queries are logged to /var/log/messages.

There are logging options available in the ntp.conf file

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sajjad Sahir
Honored Contributor

Re: How to know which IPs are querying my ntp server?

Dear MD

u have to check the logs there is no other option.
more /var/log/messages

thanks and regards

Sajjad Sahir
MD Shafiullah
Occasional Advisor

Re: How to know which IPs are querying my ntp server?

I have checked /var/log/messeges but found no entry for ntp query. I could find which IPs are querying my ntp server by getting a tcpdump and then filtering out all except ntp request packets. Then found out how many IPs were querying the NTP server.

Is there any other way?
Armin Kunaschik
Esteemed Contributor

Re: How to know which IPs are querying my ntp server?

Start xntpd with the -d option. See man page for more detail. If you don't want to do so, you can setup a nettl monitoring for udp port 123.

My 2 cents,
Armin

PS: Please assign points if you find answers useful!
And now for something completely different...
Ivan Krastev
Honored Contributor

Re: How to know which IPs are querying my ntp server?

Use tcpdump to see the udp trafic as well:

# tcpdump udp port 123


regards,
ivan
Suraj K Sankari
Honored Contributor

Re: How to know which IPs are querying my ntp server?

Hi,

Check the /var/log/messages file
or do netstat -a | grep -i ntp

Suraj