- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Help! ntpq: write to localhost failed: Operati...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 11:20 PM
тАО04-11-2003 11:20 PM
But I have already opened port 123 for both ntp server and client as below,
iptables -A INPUT -p udp -j ACCEPT -s $ntpserver -d $eth0IP --dport 123
iptables -A OUTPUT -p udp -j ACCEPT -d $ntpserver -s $eth0IP --sport 123
iptables -A INPUT -p udp -j ACCEPT -s 127.0.0.1 -d $eth0IP --dport 123
iptables -A OUTPUT -p udp -j ACCEPT -d 127.0.0.1 -s $eth0IP --sport 123
iptables -A INPUT -p udp -j ACCEPT -s $ntpclient -d $eth0IP --dport 123
iptables -A OUTPUT -p udp -j ACCEPT -d $ntpclient -s $eth0IP --sport 123
Anybody can advise me on which port ntpq will use other than 123?
Thanks in advance,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2003 12:16 AM
тАО04-12-2003 12:16 AM
Re: Help! ntpq: write to localhost failed: Operation not permitted
not sure if this helps. but just give a try.
ntp seems to use port 123 only. but it has an entry in /etc/services for both tcp and udp. and your firewall rules is only for udp. try opening access for tcp as well and see if it helps.
++++++++++++
ntp 123/tcp
ntp 123/udp # Network Time Protocol
++++++++++++
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2003 12:37 AM
тАО04-12-2003 12:37 AM
Re: Help! ntpq: write to localhost failed: Operation not permitted
#netstat -a|grep ntp
udp 0 0 msmarketp2:ntp *:*
udp 0 0 localhost:ntp *:*
udp 0 0 *:ntp *:*
By the way, xtnpd seems working fine as shown in /var/log/messages after restart, but only ntpq doesn't work.
Apr 12 10:59:51 msmarketp2 xntpd[30397]: xntpd exiting on signal 15
Apr 12 10:59:51 msmarketp2 xntpd: xntpd shutdown succeeded
Apr 12 10:59:51 msmarketp2 xntpd[11511]: xntpd 3-5.93e Tue Feb 11 12:23:23 SGT 2
003 (1)
Apr 12 10:59:51 msmarketp2 xntpd[11511]: tickadj = 5, tick = 10000, tvu_maxslew
= 495, est. hz = 100
Apr 12 10:59:51 msmarketp2 xntpd[11511]: precision = 7 usec
Apr 12 10:59:51 msmarketp2 xntpd[11511]: read drift of 189.963 from /etc/driftfi
le
Apr 12 10:59:51 msmarketp2 xntpd: xntpd startup succeeded
Apr 12 11:04:08 msmarketp2 xntpd[11511]: synchronized to 203.117.180.36, stratum
=1
In fact I wrote a script to continuously run ntpq and at the same time I run lsof -p "pid of ntpq" and found out
that ntpq uses one of the following UDP ports
UDP *:51901
UDP *:51903
UDP *:65005
UDP *:65007
Is that correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2003 01:52 AM
тАО04-12-2003 01:52 AM
Re: Help! ntpq: write to localhost failed: Operation not permitted
sorry. completely forget how i was configuring ntp long back. i remember it very faintly.
first of all are u sure if it is a problem with your firewall. just try stoppping it and see if ntpq is running or is it reporting the same problem.
or is that xntpd is running and u r running ntpq which is causing the problem.
simply guessing and giving a shot.
-balaji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2003 02:14 AM
тАО04-12-2003 02:14 AM
Re: Help! ntpq: write to localhost failed: Operation not permitted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2003 07:30 PM
тАО04-12-2003 07:30 PM
SolutionYour configuration does not appear to allow connections from 127.0.0.1 to 127.0.0.1, so ntpq dies with the error you indicated. Try adding
iptables -A INPUT -p all -j ACCEPT -s 127.0.0.1 -d 127.0.0.1
This will allow processes on your machine to communicate via the loopback interface.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2003 09:50 PM
тАО04-12-2003 09:50 PM
Re: Help! ntpq: write to localhost failed: Operation not permitted
iptables -A OUTPUT -p udp -m state --state NEW -m udp -i lo --sport 123 -o lo --dport 123 -j ACCEPT
Regards,
Sergejs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2003 05:02 PM
тАО04-13-2003 05:02 PM
Re: Help! ntpq: write to localhost failed: Operation not permitted
By the way, Sergejs's commands got error "Can't use -i with OUTPUT".
I tried to add in one more line "iptables -A OUTPUT -p all -j ACCEPT -s 127.0.0.1 -d 127.0.0.1", now it WORKS!
Thank you Bill Douglass