Before setting up our NTP service, the first thing we want to do is set our time closer to the real
time so that NTP synchronizes quicker. At the moment
router 2 as an example, still believes that it's in the year 2030, router 2 is in the year and
router 3 is in the year 2002.
Before setting time, however, we want to set a time zone and set summer time because that will affect
the time and the devices some of the time clock and specify a time zone.
This can be any name I'm going to specify GMT in this example, there is no hours or minutes offset
from UTC.
Fortunately, it's a lot simpler in the UK because Greenwich is based in the UK and other time zones
are derived from GMT or Greenwich Meridian Time.
If you are living in the US as an example and let's say you were on the East Coast, you might specify
EST and the offset would be minus 5 hours.
EST is five hours behind UTC or universal coordinated time.
So I'm going to set GMT as my time zone
but what I need to do now is specify summer time.
It's summer at the moment in the UK.
I'm going to specify a name which I'll just specify as British Summer, you can specify when summertime
starts and stops by using either a date, which is an absolute date, or you can specify a recurring
value.
So I'm going to specify recurring being the last Sunday in March
and summertime will start at 1:00 a.m. and will end in the last Sunday in October at 1:00 a.m..
So what you'll notice is the time is updated because it's summertime. So what I've done is
specify the time zone and specify the summer time.
Now, what's interesting is these two commands are done in global config on a router but the clock is
set in privilege mode.
So the correct time at the moment approximately is 23:19 on the 16th of August 2016.
So show clock
shows me that date and time now to simplify things.
I'm going to copy and paste the clock time zone and summertime into the other routers.
So both router 2 and router 3 are now configured with summertime and a time zone.
So there we go, router 2, router 3
and router 1 are configured.
What I do need to do on both router 2 and router 3 is specify the time.
Set it to 21
16TH of August 2016
and I'll do that on router 3 as well. So there's the clock
on router 3, here's the clock on router 2 and there's the clock on router 1.
Now, the clocks are slightly out, so that's close enough for what we're gonna do.
What I want to do is set up router 3 now as a NTP master.
So we would do that by using the command NTP master and specifying a stratum level.
I'm just going to specify stratum level of ten
and in this example, I'm going to specify the loopback as the source of time, loopbacks are good because
once again, loopback interfaces don't go down.
So show IP Interface brief shows me that the router has a loopback configured on quadruple 3 and I've specified
that NTP use that as the source of time.
So show NTP associations at the moment, the local router is associated with itself.
This is just a loopback address on the local router
as we can see, it's configured and at the moment it's synchronized with the master.
In other words, itself, show NTP status.
We can see that the clock is synchronized with a stratum 10 device, which is the local device, show
NTP status on router 2 shows us that NTP is not enabled.
So we could use the command NTP server and point it to router 3
and now we can use the command show NTP status.
At the moment, the clock is unsynchronized.
The local stratum is 16, it has no reference clock show NTP associations, it has now associated with
quadruple three.
You can see that it is synchronized.
So let's look at status again.
There you go.
The clock is synchronized.
The local router has a stratum of 11 because we configured
router 3 with a stratum of 10, the reference device is quadruple 3 we can see what the time is
and we can see that we are using British summertime. On router 1 show NTP status,
NTP is not configured, what I'll do here, however, is tell this router to get its time from router 2 not
router 3. So router 3 got a stratum of 10
this will have a stratum of 11
and this will have a stratum of 12.
Router 1 is getting time from router 2 and router 2 is getting time from router 3, so NTP server 2.
2.2.2 show NTP status.
Clock is still unsynchronized.
Let's look at associations at the moment it's configured
but it's not synchronized.
But there you go, it's now synchronized with the master device, so if we look at the status, we can
see that the clock is synchronized.
Stratum is now 12 as expected,
reference device is router 2.
So show clock,
show clock, we can see that the time is very close between these devices, just depends how quickly
I can type
but we can see that the time is good on the devices, the time is very close.
So notice 11:25, 11:25, 11:25 which is great.
Seconds are a little bit odd because I'm typing a bit slow, but you can see that they're very close
to one another.
So that's an example of how to set up an NTP server
and NTP clients that receive time from an NTP server router 2 is acting as an NTP client and
and NTP server.