Configuration du NTP
Network Time Protocol
Introduction
Pour effectuer une synchronisation NTP, il faut tout d'abord que le switch puisse aller sur internet
-> ip interface "vlan1" address 192.168.10.100 mask 255.255.255.0 vlan 1 ifindex 1
-> ip static-route 0.0.0.0/0 gateway 192.168.10.1 metric 1
Passons à la configuration du NTP
-> ntp server 194.2.0.28 prefer
-> ntp server 38.229.59.9
-> ntp server enable
-> ntp server synchronised
Configuration de la timezone
-> system timezone CET
-> system daylight savings time start last sunday in march at 02:00 end last sunday in october at 03:00
-> system daylight savings time enable
ou
-> system timezone +01:00
-> system daylight savings time start last sunday in march at 02:00 end last sunday in october at 03:00
-> system daylight savings time enable
Vérification
-> show ntp server status
IP address = 38.229.59.9,
Host mode = client,
Peer mode = server,
Prefer = yes,
Version = 4,
Key = 0,
Stratum = 2,
Minpoll = 6 (64 seconds),
Maxpoll = 10 (1024 seconds),
Delay = 0.167 seconds,
Offset = 660733522.277 seconds,
Dispersion = 0.953 seconds
Root distance = 0.083,
Precision = -20,
Reference IP = 172.16.21.35,
Status = configured : reachable : rejected,
Uptime count = 1402 seconds,
Reachability = f,
Unreachable count = 0,
Stats reset count = 1043 seconds,
Packets sent = 6,
Packets received = 4,
Duplicate packets = 0,
Bogus origin = 0,
Bad authentication = 0,
Bad dispersion = 0,
Last Event = peer changed to reachable,
IP address = 194.2.0.28,
Host mode = client,
Peer mode = server,
Prefer = no,
Version = 4,
Key = 0,
Stratum = 2,
Minpoll = 6 (64 seconds),
Maxpoll = 10 (1024 seconds),
Delay = 0.017 seconds,
Offset = 660733522.272 seconds,
Dispersion = 1.952 seconds
Root distance = 0.000,
Precision = -23,
Reference IP = 172.19.123.3,
Status = configured : reachable : rejected,
Uptime count = 1402 seconds,
Reachability = 7,
Unreachable count = 0,
Stats reset count = 1261 seconds,
Packets sent = 3,
Packets received = 3,
Duplicate packets = 0,
Bogus origin = 0,
Bad authentication = 0,
Bad dispersion = 0,
Last Event = peer changed to reachable,
et
-> show ntp client
Current time: Wed, Dec 8 2021 9:47:58.667 (UTC),
Last NTP update: Wed, Dec 8 2021 9:47:28.033 (UTC),
Server reference: 38.229.59.9,
Client mode: enabled,
Broadcast client mode: disabled,
Broadcast delay (microseconds): 4000,
Server qualification: synchronized
Il est aussi possible de régler l'heure et la date à la main
-> system date 08/12/2021
-> system time 10:48:00
Supprimer un serveur NTP :
-> no ntp server 194.2.0.28 prefer