Community discussions

MikroTik App
 
User avatar
BigSky
newbie
Topic Author
Posts: 26
Joined: Tue Aug 24, 2010 11:45 pm
Location: Montana, US

SNTP not working

Wed Feb 08, 2017 12:49 am

I have 20+ Mikrotik routers in the field at client locations. These are mostly RB750s, but there are also some CCRs. At some point in 2016 the SNTP stop adjusting the clocks on all of these routers. I've tried firmwares from 6.12 to 6.38, with the same results. I see the NTP request go out, but nothing is coming back. None of these router are behind firewalls; they are all connect either to fiber ONTs or bridged modems directly from the ISP.

I do have one CCR1016 behind a SonicWall that is working. It's the only one I have that the SNTP is working.

Looking for ideas where to look? Or what to try?

Thanks.
You do not have the required permissions to view the files attached to this post.
 
Van9018
Long time Member
Long time Member
Posts: 558
Joined: Mon Jun 16, 2014 6:26 pm
Location: Canada - Abbotsford

Re: SNTP not working

Wed Feb 08, 2017 1:02 am

Are the IPs valid? I don't get a response from those IPs either.

For the hostname to work, DNS on the device has to be working.
 
User avatar
k6ccc
Forum Guru
Forum Guru
Posts: 1497
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: SNTP not working

Wed Feb 08, 2017 2:45 am

For what it's worth, I do not get a ping response from us.pool.ntp.org, but I do get a ping response from both IPs you listed. I'm trying this from a PC in southern California, USA.
I looked at both of my RB750s and I have 50.22.155.163 and 131.107.13.100, and no DNS name. Both show the active server to be the 50.22.155.163 address. I sort of recall that the DNS did not work for me either, which is why I just grabbed a couple of IPs that did. I don't remember if these are from ntp.org or NIST, or something else.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3300
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: SNTP not working

Wed Feb 08, 2017 8:44 am

Do you have the NTP package, or just using SNTP that is default on the 750G?
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 2880
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: SNTP not working

Wed Feb 08, 2017 8:50 am

Can you ping from router to us.pool.ntp.org ?
If not, then check if you have DNS configured properly.
 
User avatar
BigSky
newbie
Topic Author
Posts: 26
Joined: Tue Aug 24, 2010 11:45 pm
Location: Montana, US

Re: SNTP not working

Wed Feb 08, 2017 7:37 pm

Thank you everyone for the responses!

To answer a few questions:
-I'm using the default SNTP that comes with the routers
-From the router I can ping us.pool.ntp.org. It resolves to different addresses each time (Which is how I understand that address to work)
-with that and other testing, I believe DNS is functioning properly.
-I just tried using 50.22.155.163 & 131.107.13.100 without a DNS name, as suggested, with the same results.
-Using the program NetTime, I can use us.pool.ntp.org or any of the addresses listed and get NetTime to work

The kicker is that it used to work. It worked fine for years, but something has changed in the past year. I've contact my ISP and they claim they don't block anything, but I'm not fully convinced of that yet either.

Please keep the suggestions coming!
 
pe1chl
Forum Guru
Forum Guru
Posts: 10240
Joined: Mon Jun 08, 2015 12:09 pm

Re: SNTP not working

Wed Feb 08, 2017 7:46 pm

The issue usually is that the ISP starts blocking outbound traffic with a source port number 123.

When you take a SNTP client that sends requests from a random port number to the server (destination port 123)
you get replies, but when you use both source and destination port 123 as an NTP server does, it fails.

Providers sometimes do this to prevent clients from running NTP servers, as they have experienced
that badly maintained NTP servers can cause DDoS and router/firewall overload issues.
 
User avatar
BigSky
newbie
Topic Author
Posts: 26
Joined: Tue Aug 24, 2010 11:45 pm
Location: Montana, US

Re: SNTP not working

Wed Feb 08, 2017 7:55 pm

The issue usually is that the ISP starts blocking outbound traffic with a source port number 123.

When you take a SNTP client that sends requests from a random port number to the server (destination port 123)
you get replies, but when you use both source and destination port 123 as an NTP server does, it fails.

Providers sometimes do this to prevent clients from running NTP servers, as they have experienced
that badly maintained NTP servers can cause DDoS and router/firewall overload issues.
Yes, I read something about that. That's why I'm questioning my ISP. Thank you for the explanation.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3300
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: SNTP not working

Wed Feb 08, 2017 10:11 pm

I did have a problem with NTP that my ISP sends me a NTP server with ip 1.2.3.4
This is not a valid IP and a bug in RouterOS makes SNTP and NTP stops working if the server it get from DHCP does not work.
Even if I add server manually it does not work.
So to get it to work I needed to got to IP->DHCP Client->Select client->remove check mark from Use Peer NTP.

If you like to try full NTP server.
Download Extra package here: https://mikrotik.com/download
 
User avatar
BigSky
newbie
Topic Author
Posts: 26
Joined: Tue Aug 24, 2010 11:45 pm
Location: Montana, US

Re: SNTP not working

Thu Feb 09, 2017 1:58 am

Solved! It was my ISP. They got back to me that they were blocking NTP:
We were blocking incoming NTP, thinking that it would still allow NTP to work from our network to the outside world, but not allow random NTP requests back in. This was due to problems with NTP related DDOS attacks we had received.
I had them allow NTP incoming NTP and all my routers starting pulling NTP adjustments. Thanks for all the replies.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10240
Joined: Mon Jun 08, 2015 12:09 pm

Re: SNTP not working

Thu Feb 09, 2017 11:00 am

A case could be made that the SNTP service should not use 123 as source port number, only the NTP service should do so.
That way, when you do not run an NTP server yourself and only want to sync to outside servers, you have less risk the requests or replies are blocked.
SNTP can use a random high source port number, and many clients do so.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: SNTP not working

Thu Feb 09, 2017 3:42 pm

if you are using pool.ntp.org NTP servers you __HAVE__ to use the domain name, or you have to frequently resolve the domain name. Ntp.org is doing automatic adjustment of the clients and you can be allocated to a different server with a different address and they will just stop answering to your queries.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10240
Joined: Mon Jun 08, 2015 12:09 pm

Re: SNTP not working

Thu Feb 09, 2017 7:05 pm

if you are using pool.ntp.org NTP servers you __HAVE__ to use the domain name, or you have to frequently resolve the domain name. Ntp.org is doing automatic adjustment of the clients and you can be allocated to a different server with a different address and they will just stop answering to your queries.
Not really. There is a pool of servers, and the DNS gives you a few of them that it recently has validated.
Such a server can disappear at any time (e.g. because the ISP implements the above filtering rule or the user who runs it discovers that it can lead to nasty problems in routers doing connection tracking), and then there will no longer be answers. When you would resolve DNS again, you get another server which still works at that time.
But there is no allocation of clients to servers and automatic stop serving clients that do not resolve the DNS often enough.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: SNTP not working

Fri Feb 10, 2017 11:17 am

at least with local Latvian pool NTP servers that is the case as same servers are here for years. When I try to get the address - the pool responds with some address, and i specifically know what server is that. After 4 to 8 weeks same domain will give me a different address. No other of the active servers will respond to the NTP requests just the one returned when resolving domain name. After some time my device can be slotted back and that happens as NTP pool load balances the requests over available servers.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10240
Joined: Mon Jun 08, 2015 12:09 pm

Re: SNTP not working

Fri Feb 10, 2017 5:24 pm

It must be perception only. There is nothing the NTP pool do or can do to track its users in relation to its servers!
The NTP pool is "just" a table of available servers and a clever DNS server to hand out the suggested servers to
use at that time. There is no bookkeeping what servers were given to whom, and it would not be possible to do so
because there may be provider DNS resolvers inbetween that send the same answer to several clients.
And this info certainly is not shared with the servers, I know that because I operate one of those servers.
The server operator can check the pool.ntp.org website to see what the pool's opinion of his server is (if it is
considered a valid server and thus is in the list that the DNS server hands out), but there is no way to retrieve a
list of clients that have been given the server's address.
 
User avatar
vipe
Member Candidate
Member Candidate
Posts: 166
Joined: Thu Sep 14, 2006 10:05 pm

Re: SNTP not working

Sat Feb 11, 2017 5:09 pm

i have same problem 6.37.4
You do not have the required permissions to view the files attached to this post.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10240
Joined: Mon Jun 08, 2015 12:09 pm

Re: SNTP not working

Sat Feb 11, 2017 6:05 pm

i have same problem 6.37.4
Then talk to your ISP as well!
 
User avatar
vipe
Member Candidate
Member Candidate
Posts: 166
Joined: Thu Sep 14, 2006 10:05 pm

Re: SNTP not working

Sun Feb 12, 2017 5:34 pm

sntp not working.JPG
rb751u is ok
You do not have the required permissions to view the files attached to this post.
 
EvgeniyV
just joined
Posts: 6
Joined: Sun Oct 28, 2018 5:49 pm

Re: SNTP not working

Sun Sep 29, 2019 12:15 am

My ISP blocked inbound port 123, this rule helped me:
add action=masquerade chain=srcnat comment="NTP masq when ISP block 123" protocol=udp src-port=123 to-ports=12123-12153

In my test case, I have hAP ac2 as the main router and in the LAN connected the second hAP ac2 as the VPN server. I cannot understand why, when the hAP(from LAN) sends a request to the NTP server on the Internet and the NAT of the main router not change the source port (123) to any??? That's why I had to use masquerading...
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11627
Joined: Thu Mar 03, 2016 10:23 pm

Re: SNTP not working

Thu Oct 03, 2019 3:10 pm

Strictly speaking, if some port on router's WAN interface is not already used for existing connection to the same remote address, then NAT process does not have to change src-port (connection tracking engine only needs to track the tuple protocol/src-address/src-port/NAT-address/NAT-port/dst-address/dst-port and keep its last 4 parts a unique combination for each connection).
If your main router was running NTP service on default port (UDP/123), then NAT would probably change src-port for every out-going connection to make sure that it is not interfering with NTP server running on main router. When main router doesn't run NTP server (or at least it's not listening on WAN interface), then changing src-port for the first LAN host contacting same public NTP Server is not needed for this reason (but if there's another reason for doing it, you have to do it manually) - if another LAN host would contact the same public NTP server, NAT would have to change src-port.

Who is online

Users browsing this forum: Fi011, iDaemon and 231 guests