This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: NTP synchronization issues when using a static IP

Part Number: AM5728


Tool/software: Linux

Hello Ti Team,

I am working on SDK "ti-processor-sdk-linux-am57xx-evm-03.01.00.06-Linux-x86-Install" in which systemD service manager is used instead systemV.

I am Trying to sync Time with my local server (windows ).

Using DHCP I am able to sync time, but when with static IP some how "systemd-timesyncd.service" didn't able to find the network connectivity though i can able to sync using "ntpdate <ip>" (not running ntp daemon just for the testing)


Setup scenario, AM5728 board connected with Ethernet port Windows laptop , laptops WIFI interface is connected to INTERNET network.

below are the chnages i have done for to setup the static IP:

Go to /etc/systemd/network/ and update the “ethernet Network configuration file ”10-eth.network Comment out DHCP and update the Static configuration with NTP server IP.

[Match]
Name=eth0
KernelCommandLine=!root=/dev/nfs

[Network]
#DHCP=yes
DNS=192.168.111.0
Address=192.168.111.3/24
Gateway=192.168.111.245
NTP=192.168.111.5

I have also using comment out the network file available in  /lib/systemd/network like below, only  99-default.link file is active. 

80-container-host0.network_org  80-container-ve.network_org     99-default.link then restart the service and also board.

for NTP setup i have update timesyncd.conf

[Time]
NTP=192.168.111.5
FallbackNTP=192.168.111.5

Static IP of windows Ethernet port is:

  • DNS=192.168.111.0
  • Address=192.168.111.2
  • subnet mask = 255.255.255.0
  • Gateway=192.168.111.245

below are the status of the services:

[[0;1;32m��●[[0m systemd-networkd.service - Network Service
   Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: [[0;1;32mactive (running)[[0m since Wed 2017-02-01 22:39:52 UTC; 4min 20s ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 711 (systemd-network)
   Status: "Processing requests..."
   CGroup: /system.slice/systemd-networkd.service
           ��└��─711 /lib/systemd/systemd-networkd

Feb 01 22:39:52 am57xx-evm systemd[1]: Starting Network Service...
Feb 01 22:39:52 am57xx-evm systemd-networkd[711]: Enumeration completed
Feb 01 22:39:52 am57xx-evm systemd[1]: Started Network Service.
Feb 01 22:39:56 am57xx-evm systemd-networkd[711]: eth0: Gained carrier
Feb 01 22:39:58 am57xx-evm systemd-networkd[711]: eth0: Gained IPv6LL
Feb 01 22:40:10 am57xx-evm systemd-networkd[711]: [[0;1;39meth0: Starting DHCPv6 client after NDisc timeout failed: Invalid argument[[0m
Feb 01 22:40:10 am57xx-evm systemd-networkd[711]: eth0: Configured

��● systemd-timedated.service - Time & Date Service
   Loaded: loaded (/lib/systemd/system/systemd-timedated.service; static; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-timedated.service(8)
           man:localtime(5)
           www.freedesktop.org/.../timedated

[[0;1;32m��●[[0m systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: [[0;1;32mactive (running)[[0m since Wed 2017-02-01 22:39:50 UTC; 4min 23s ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 377 (systemd-timesyn)
   Status: "Idle."
   CGroup: /system.slice/systemd-timesyncd.service
           ��└��─377 /lib/systemd/systemd-timesyncd

Oct 03 21:06:17 am57xx-evm systemd-timesyncd[377]: System clock time unset or jumped backwards, restoring from recorded timestamp: Wed 2017-02-01 22:39:50 UTC
Feb 01 22:39:50 am57xx-evm systemd[1]: Started Network Time Synchronization.
Feb 01 22:39:52 am57xx-evm systemd-timesyncd[377]: No network connectivity, watching for changes.
Feb 01 22:39:52 am57xx-evm systemd-timesyncd[377]: No network connectivity, watching for changes.
Feb 01 22:39:52 am57xx-evm systemd-timesyncd[377]: No network connectivity, watching for changes.
Feb 01 22:39:52 am57xx-evm systemd-timesyncd[377]: No network connectivity, watching for changes.
Feb 01 22:39:52 am57xx-evm systemd-timesyncd[377]: No network connectivity, watching for changes.
Feb 01 22:39:52 am57xx-evm systemd-timesyncd[377]: No network connectivity, watching for changes.
Feb 01 22:39:52 am57xx-evm systemd-timesyncd[377]: No network connectivity, watching for changes.
Feb 01 22:39:52 am57xx-evm systemd-timesyncd[377]: No network connectivity, watching for changes.

 

I have also observed in timesyncd file if i set other IP then the connected laptop (NTP=192.168.111.X), systemd-timesyncd.service try to reach the IP and status will be

[[0;1;32m��●[[0m systemd-networkd.service - Network Service
   Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: [[0;1;32mactive (running)[[0m since Wed 2017-02-01 22:47:46 UTC; 1s ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 1037 (systemd-network)
   Status: "Processing requests..."
   CGroup: /system.slice/systemd-networkd.service
           ��└��─1037 /lib/systemd/systemd-networkd

Feb 01 22:47:46 am57xx-evm systemd[1]: Starting Network Service...
Feb 01 22:47:46 am57xx-evm systemd-networkd[1037]: eth0: Gained IPv6LL
Feb 01 22:47:46 am57xx-evm systemd-networkd[1037]: Enumeration completed
Feb 01 22:47:46 am57xx-evm systemd[1]: Started Network Service.
Feb 01 22:47:46 am57xx-evm systemd-networkd[1037]: [[0;1;39meth0: Could not drop address: No such process[[0m

[[0;1;32m��●[[0m systemd-timedated.service - Time & Date Service
   Loaded: loaded (/lib/systemd/system/systemd-timedated.service; static; vendor preset: enabled)
   Active: [[0;1;32mactive (running)[[0m since Wed 2017-02-01 22:47:46 UTC; 1s ago
     Docs: man:systemd-timedated.service(8)
           man:localtime(5)
           http://www.freedesktop.org/wiki/Software/systemd/timedated
 Main PID: 1039 (systemd-timedat)
   CGroup: /system.slice/systemd-timedated.service
           ��└��─1039 /lib/systemd/systemd-timedated

Feb 01 22:47:46 am57xx-evm systemd[1]: Starting Time & Date Service...
Feb 01 22:47:46 am57xx-evm systemd[1]: Started Time & Date Service.

[[0;1;32m��●[[0m systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: [[0;1;32mactive (running)[[0m since Wed 2017-02-01 22:47:46 UTC; 2s ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 1036 (systemd-timesyn)
   Status: "Connecting to time server 192.168.111.7:123 (192.168.111.7)."
   CGroup: /system.slice/systemd-timesyncd.service
           ��└��─1036 /lib/systemd/systemd-timesyncd

Feb 01 22:47:46 am57xx-evm systemd[1]: Starting Network Time Synchronization...
Feb 01 22:47:46 am57xx-evm systemd[1]: Started Network Time Synchronization.....
Feb 01 22:47:56 am57xx-evm systemd-timesyncd[1036]: Timed out waiting for reply from 192.168.111.7:123 (192.168.111.7).

Please note windows side NTP server is working fine as i have test that using "ntpdate <ip>" please let me know am what could be the possible reason for this behavior. 

Regards,

Shweta Mishra80