Having accurate time on interconnected devices is essential for troubleshooting, security and general sanity. Differences in time between machines even if small can lead to increased difficulty in troubleshooting.
Having accurate and synchronized time on all devices should be part of the basic setup of networking devices. In this lab I used a real NTP server on the internet as the master clock for the simulated network that I built.
Let’s start with the following topology:
I have used VLSM on each device and loopback interfaces. OSPFv2 has been configured with all devices in area 0. Loopback interfaces have been set as passive:
!!! R1 config excerpt interface Loopback1 ip address 172.16.0.1 255.255.255.0 ip ospf 1 area 0 ! interface GigabitEthernet0/0 ip address 10.255.255.245 255.255.255.252 ip ospf 1 area 0 duplex full speed 1000 media-type gbic negotiation auto ! router ospf 1 log-adjacency-changes passive-interface Loopback1 !
Next NAT has been configured inside GNS3:
!R1 excerpt interface GigabitEthernet1/0 ip address dhcp negotiation auto ! ip name-server 184.108.40.206
The internal loopbacks of each router have been set to 172.16.0.x (x being the router number):
!R1 r1#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is 192.168.122.1 to network 0.0.0.0 C 192.168.122.0/24 is directly connected, GigabitEthernet1/0 172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks O 172.16.0.4/32 [110/3] via 10.255.255.246, 00:15:08, GigabitEthernet0/0 C 172.16.0.0/24 is directly connected, Loopback1 O 172.16.0.2/32 [110/2] via 10.255.255.246, 00:36:13, GigabitEthernet0/0 O 172.16.0.3/32 [110/3] via 10.255.255.246, 00:36:13, GigabitEthernet0/0 10.0.0.0/30 is subnetted, 3 subnets O 10.255.255.248 [110/2] via 10.255.255.246, 00:36:13, GigabitEthernet0/0 O 10.255.255.252 [110/2] via 10.255.255.246, 00:15:08, GigabitEthernet0/0 C 10.255.255.244 is directly connected, GigabitEthernet0/0 S* 0.0.0.0/0 [254/0] via 192.168.122.1
Next we set R1 as the master and set R1 to get it’s updates from the real world:
ntp master 2 ntp server 0.au.pool.ntp.org
On each router set the timezone (I live in Queensland):
clock timezone AEST 10
Next on all other routers except R1:
ntp server 172.16.0.1
Verify using “show” commands:
r1#show ntp status Clock is synchronized, stratum 3, reference is 220.127.116.11 nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**24 reference time is DF820DE6.0CFC0557 (08:53:26.050 AEST Tue Oct 30 2018) clock offset is -0.0034 msec, root delay is 0.14 msec root dispersion is 0.20 msec, peer dispersion is 0.06 msec loopfilter state is 'CTRL' (Normal Controlled Loop), drift is -0.000000002 s/s system poll interval is 128, last update was 249 sec ago. r1#show ntp associations address ref clock st when poll reach delay offset disp ~127.127.1.1 .LOCL. 1 0 16 377 0.000 0.000 0.232 *~18.104.22.168 22.214.171.124 2 121 128 177 76.126 -3.484 65.310 * sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured r1# r2#show ntp status Clock is synchronized, stratum 3, reference is 127.127.1.1 nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**24 reference time is DF829B5E.91AD1430 (18:57:02.569 AEST Tue Oct 30 2018) clock offset is 0.0000 msec, root delay is 0.00 msec root dispersion is 0.00 msec, peer dispersion is 0.00 msec loopfilter state is 'CTRL' (Normal Controlled Loop), drift is 0.000000003 s/s system poll interval is 16, last update was 5 sec ago. r2#show ntp associations address ref clock st when poll reach delay offset disp *~127.127.1.1 .LOCL. 2 6 16 377 0.000 0.000 0.240 ~172.16.0.1 126.96.36.199 3 40 64 177 4.363 -359793 3.376 * sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured r2#
That’s it! Now enjoy synchronized time.