# Mission 1 — Centraliser l’heure (NTP)

\--&gt; A faire sur les deux switchs et le routeur

Pourquoi : Le **routeur** donne l’heure à tous les **switchs** et hôtes (horodatages cohérents pour les logs et les tests).

Console --&gt; passer en config :

<table border="1" id="bkmrk-enable-configure-ter" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.8765%;"></col></colgroup><tbody><tr><td>enable

configure terminal

</td></tr></tbody></table>

Fuseau horaire (France) :

<table border="1" id="bkmrk-clock-timezone-cet-1" style="border-collapse: collapse; width: 100%; height: 44.5938px;"><colgroup><col style="width: 99.8765%;"></col></colgroup><tbody><tr style="height: 44.5938px;"><td style="height: 44.5938px;"><div class="scriptor-paragraph">clock timezone CET 1</div><div class="scriptor-paragraph">clock summer-time CEST recurring</div></td></tr></tbody></table>

\------------------------------------------------------------------------------------------

Routeur NTP maître (seulement dans le routeur) :

<table border="1" id="bkmrk-ntp-master-3-end-wri" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.8765%;"></col></colgroup><tbody><tr><td>ntp master 3

end

write memory

</td></tr></tbody></table>

Pour vérifier :

<table border="1" id="bkmrk-show-ntp-status-show" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.8765%;"></col></colgroup><tbody><tr><td>show ntp status

show clock

</td></tr></tbody></table>

\------------------------------------------------------------------------------------------

Déclarer le routeur NTP (seulement dans les switchs) :

<table border="1" id="bkmrk-conf-tntp-server-%28ip" style="border-collapse: collapse; width: 100%; height: 29.7969px;"><colgroup><col style="width: 99.8765%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">conf t  
ntp server (IP routeur)  
clock timezone CET 1  
end  
write memory

</td></tr></tbody></table>

Pour vérifier :

<table border="1" id="bkmrk-show-ntp-association" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.8765%;"></col></colgroup><tbody><tr><td>show ntp associations

show clock

</td></tr></tbody></table>

\--&gt; Redémarre un switch --&gt; show clock doit afficher la bonne heure (synchro)

\-------------------------------------------------

Sans internet :

## Bilan complet des commandes

### Routeur

<div class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg" id="bkmrk-"><div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><div class="relative"><div class="transition-all opacity-100 scale-100" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg aria-hidden="true" class="transition-all opacity-100 scale-100" fill="currentColor" height="20" style="flex-shrink: 0;" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"></svg>  
</div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg aria-hidden="true" class="transition-all opacity-0 scale-50" fill="currentColor" height="20" style="flex-shrink: 0;" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"></svg>  
</div></div></div></div></div><div class="overflow-x-auto"></div></div>```
enable
clock set HH:MM:SS 19 March 2026
configure terminal
clock timezone CET 1
ntp master 3
end
write memory
```

**Vérification :**

<div class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg" id="bkmrk--1"><div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><div class="relative"><div class="transition-all opacity-100 scale-100" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg aria-hidden="true" class="transition-all opacity-100 scale-100" fill="currentColor" height="20" style="flex-shrink: 0;" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"></svg>  
</div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg aria-hidden="true" class="transition-all opacity-0 scale-50" fill="currentColor" height="20" style="flex-shrink: 0;" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"></svg>  
</div></div></div></div></div><div class="overflow-x-auto"></div></div>```
show clock
show ntp status
```

---

### Switchs (les deux)

<div class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg" id="bkmrk--3"><div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><div class="relative"><div class="transition-all opacity-100 scale-100" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg aria-hidden="true" class="transition-all opacity-100 scale-100" fill="currentColor" height="20" style="flex-shrink: 0;" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"></svg>  
</div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg aria-hidden="true" class="transition-all opacity-0 scale-50" fill="currentColor" height="20" style="flex-shrink: 0;" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"></svg>  
</div></div></div></div></div><div class="overflow-x-auto"></div></div>```
enable
configure terminal
clock timezone CET 1
ntp server <IP_du_routeur>
end
write memory
```

**Vérification :**

<div class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg" id="bkmrk--4"><div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><div class="relative"><div class="transition-all opacity-100 scale-100" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg aria-hidden="true" class="transition-all opacity-100 scale-100" fill="currentColor" height="20" style="flex-shrink: 0;" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"></svg>  
</div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg aria-hidden="true" class="transition-all opacity-0 scale-50" fill="currentColor" height="20" style="flex-shrink: 0;" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"></svg>  
</div></div></div></div></div><div class="overflow-x-auto"></div></div>```
show clock
show ntp associations
```

---

### Points importants

- Ne pas mettre `clock summer-time CEST recurring` pour l'instant (on est encore en heure d'hiver, ça décalerait d'1h)
- Remplacer `<IP_du_routeur>` par une IP visible dans `show ip interface brief` sur le routeur
- Le `clock set` est à faire **avant** le `configure terminal`, sinon la commande n'est pas disponible