Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

into my linux server (Ubuntu 8) I have top open the port 123 for ntp. I have write this into /etc/iptables.rules:

:INPUT ACCEPT [7496:9080183]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [4393:322232]
[0:0] -A INPUT -p udp -m udp --sport 8100 -j ACCEPT
[0:0] -A INPUT -p udp -m udp --dport 8100 -j ACCEPT
[0:0] -I INPUT -p udp --dport 123 -j ACCEPT
[0:0] -I OUTPUT -p udp --sport 123 -j ACCEPT
COMMIT

But if I launch this command:

nmap localhost -p123

return me:

Starting Nmap 4.53 ( http://insecure.org ) at 2013-03-28 12:05 CET
Interesting ports on localhost (127.0.0.1):
PORT    STATE  SERVICE
123/tcp closed ntp

If I lunch this

ntpdate -d it.pool.ntp.org

return me:

28 Mar 11:07:31 ntpdate[5132]: ntpdate 4.2.4p4@1.1520-o Fri Dec  4 18:18:35 UTC 2009 (1)
transmit(212.45.144.59)
transmit(212.45.144.16)
transmit(2.228.72.62)
transmit(84.38.50.20)
transmit(212.45.144.59)
transmit(212.45.144.16)
transmit(2.228.72.62)
transmit(84.38.50.20)
transmit(212.45.144.59)
transmit(212.45.144.16)
transmit(2.228.72.62)
transmit(84.38.50.20)
transmit(212.45.144.59)
transmit(212.45.144.16)
transmit(2.228.72.62)
transmit(84.38.50.20)
transmit(212.45.144.59)
transmit(212.45.144.16)
transmit(2.228.72.62)
transmit(84.38.50.20)
212.45.144.59: Server dropped: no data
212.45.144.16: Server dropped: no data
2.228.72.62: Server dropped: no data
84.38.50.20: Server dropped: no data
server 212.45.144.59, port 123
stratum 0, precision 0, leap 00, trust 000
refid [212.45.144.59], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Thu, Feb  7 2036  7:28:16.000
originate timestamp: 00000000.00000000  Thu, Feb  7 2036  7:28:16.000
transmit timestamp:  d4fe94e6.3e0589ac  Thu, Mar 28 2013 11:07:34.242
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

server 212.45.144.16, port 123
stratum 0, precision 0, leap 00, trust 000
refid [212.45.144.16], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Thu, Feb  7 2036  7:28:16.000
originate timestamp: 00000000.00000000  Thu, Feb  7 2036  7:28:16.000
transmit timestamp:  d4fe94e6.7138de6d  Thu, Mar 28 2013 11:07:34.442
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

server 2.228.72.62, port 123
stratum 0, precision 0, leap 00, trust 000
refid [2.228.72.62], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Thu, Feb  7 2036  7:28:16.000
originate timestamp: 00000000.00000000  Thu, Feb  7 2036  7:28:16.000
transmit timestamp:  d4fe94e6.a46f049a  Thu, Mar 28 2013 11:07:34.642
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

server 84.38.50.20, port 123
stratum 0, precision 0, leap 00, trust 000
refid [84.38.50.20], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Thu, Feb  7 2036  7:28:16.000
originate timestamp: 00000000.00000000  Thu, Feb  7 2036  7:28:16.000
transmit timestamp:  d4fe94e6.d7a22706  Thu, Mar 28 2013 11:07:34.842
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

28 Mar 11:07:35 ntpdate[5132]: no server suitable for synchronization found

I have to restart something or my configure is wrong?

share|improve this question
    
please update your post with the following ntpdate -d it.pool.ntp.org –  Mike Mar 28 '13 at 10:05

2 Answers 2

up vote 4 down vote accepted

ntp is udp and you are scanning for tcp which is why it says it is closed.

Try this

 nmap -sT -sU -p 123 localhost
share|improve this answer
    
return me:123/tcp closed ntp 123/udp open|filtered ntp is correct? –  Alessandro Minoccheri Mar 28 '13 at 9:39
    
because if I type: ntpdate it.pool.ntp.org return me:"no server suitable for synchronization found" but I can ping it @Mike –  Alessandro Minoccheri Mar 28 '13 at 9:53
    
if you are nmaping it.pool.ntp.org then yes that output is correct –  Mike Mar 28 '13 at 9:56
    
ok well.. I don't understand why return me: "no server suitable for synchronization found"--- :( @Mike –  Alessandro Minoccheri Mar 28 '13 at 9:57
    
please update your post with the following ntpdate -d it.pool.ntp.org –  Mike Mar 28 '13 at 9:58

NTP is working over UDP. You need to run this command:

[10:05:28] [root@dewa vol]# nmap -sU -P0 -p 123 127.0.0.1

Starting Nmap 5.51 ( http://nmap.org ) at 2013-03-28 10:05 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00030s latency).
PORT    STATE SERVICE
123/udp open  ntp

Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
share|improve this answer
1  
no offense.. but did you even read my answer first? –  Mike Mar 28 '13 at 9:58
    
I've fixed my command + add example. –  paszczak000 Mar 28 '13 at 10:06
    
ok but I get open|filter isn't correct I have to pruint only open. My iptables is wrong then? @paszczak000 –  Alessandro Minoccheri Mar 28 '13 at 10:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.