[ntp:questions] Re: ntpd as broadcast client not working

Danny Mayer mayer at gis.net
Tue Oct 26 05:04:41 UTC 2004


tinac at intellambda.com (Tina) wrote in message news:<648f806b.0410241912.47862fee at posting.google.com>...
> Hi, 
> 
> I have download the latest production NTP code from the following web
> page
>        http://ntp.isc.org/bin/view/Main/SoftwareDownloads
> (Version 4.2.0).
> 
> I have setup a server (192.168.0.190) which is synchronized to
> external stratum (1 or 2) NTP servers.  And I want to use this
> server(192.168.0.190) as a broadcast server, to synchronize other
> machines on a subnet.
> 
> The server is running fine and indicates that it is synchronized to
> the external server and the broadcast address 192.168.0.255 is
> indicated as a broadcast (^):
> 
> ntpdc> peer
>      remote           local      st poll reach  delay   offset    disp
> =======================================================================
> =LOCAL(0)        127.0.0.1       10   64  377 0.00000  0.000000
> 0.00095
> *207.126.98.204. 192.168.0.190    1  512  377 0.00948  0.000283
> 0.00363
> ^192.168.0.255   5.0.0.0         16   64    0 0.00000  0.000000
> 0.00000
> 

You have a broken version. That refid of 5.0.0.0 is something that was
fixed a long time ago. I no longer remember when or where it was fixed.
Please get the latest tarball version from the ntp-dev tree.

> But I am having problem getting the ntpd running as a broadcast client
> on the other machines.  It seems that the initial volley of eight
> client/server cycle is somehow missing.  Below is the output of the
> NTPD running as a broadcast client.  It seemed the first receive is
> from the wrong interface:
> 
> (NOTE: I tried a previous version (NTP 4.1.1). It is parts of the
> RedHat distribution, which running fine. I use the same configure
> file.)
> 
> [root at pc28 ntpd]# ntpd -d -n
> ntpd 4.2.0 at 1.1161-r Thu Oct  7 20:41:43 PDT 2004 (8)
> addto_syslog: ntpd 4.2.0 at 1.1161-r Thu Oct  7 20:41:43 PDT 2004 (8)
> addto_syslog: signal_no_reset: signal 13 had flags 4000000
> addto_syslog: precision = 1.000 usec
> create_sockets(123)
> addto_syslog: no IPv6 interfaces found
> bind() fd 4, family 2, port 123, addr 0.0.0.0, flags=8
> bind() fd 5, family 2, port 123, addr 127.0.0.1, flags=0
> bind() fd 6, family 2, port 123, addr 192.168.0.193, flags=8
> bind() fd 7, family 2, port 123, addr 192.168.1.218, flags=0
> init_io: maxactivefd 7
> local_clock: at 0 state 0
> bind() fd 9, family 2, port 123, addr 192.168.0.255, flags=8
> io_setbclient: Opened broadcast client on interface 2, socket: 9
> io_setbclient: Opened broadcast clients
> addto_syslog: frequency initialized 10.221 PPM from /etc/ntp/drift
> local_clock: at 0 state 1
> report_event: system event 'event_restart' (0x01) status 'sync_alarm,
> sync_unspec, 1 event, event_unspec' (0xc010)
> auth_agekeys: at 1 keys 2 expired 0
> timer: refresh ts 0
> receive: at 41 192.168.0.193<-192.168.0.190 mode 5 code 5 keyid
> 00000002 len 48 mac 20 auth 1
> Finding addr 192.168.0.190 in list of addresses
> key_expire: at 41
> peer_clear: at 41 assoc ID 26484 refid INIT
> newpeer: 192.168.0.193->192.168.0.190 mode 3 vers 4 poll 6 10 flags
> 0x212 0x20 ttl 0 key 00000002
> receive: at 41 0.0.0.0<-192.168.0.190 mode 5 code 6 keyid 00000002 len
> 48 mac 20 auth 1
> peer 192.168.0.190 event 'event_reach' (0x84) status 'unreach, auth, 1
> event, event_reach' (0x6014)
> auth_agekeys: at 60 keys 2 expired 0
> 

You didn't show enough to tell whether or not you are actually
receiving broadcast packets. The above shows that it was set up
to receive them, but do you have a server sending them? I do note
that you received a broadcast packet on the wildcard interface though
you appear to have the broadcast address opened on interface 2.
Unfortunately you snipped the output so I have no way of knowing
which interface is if 2. 

> 
> Here is my server's configure file:
> 
> restrict default ignore 
> restrict 127.0.0.1
> server  207.126.98.204
> restrict 207.126.98.204 nomodify
> 
> 
> server  127.127.1.0     # local clock
> fudge   127.127.1.0 stratum 10
> 
> driftfile /etc/ntp/drift
> broadcastdelay  0.008
> 
> authenticate yes
> 
> keys            /etc/ntp/keys
> 
> broadcast 192.168.0.255 key 2 ttl 8
> broadcastclient
> trustedkey 2
> 
> Note: the content of /etc/ntp/keys
>    2   M   pass 
>  
> 
> And the ntp broadcast client machine has the following in its ntp.conf
> file:
> 
> enable auth
> broadcastclient
> #restrict 192.168.0.190 nomodify
> broadcastdelay 0.00800
> driftfile /etc/ntp/drift
> keys      /etc/ntp/keys
> trustedkey 2
> 
> 
> Can anyone tell me if there is any problem with the configuration
> files?  As I mentioned earlier, I am able to run a different version
> of ntpd as broadcast client, but have problem with the 4.2.0 version.
> 
> Is there a bug in the code where it sets up the interfaces?
> 

There was. It's been fixed. The latest tarball has some fixes
for broadcast client. For a broadcast server you should see
outgoing packets to the broadcast address. Did they go out?
I also don't see that the broadcast server was actually set up.

Danny

> Thank you in advance,
> 
> /Tina



More information about the questions mailing list