Ntp Server
This scenario shows how to configure a DHCP client to receive information about an NTP server.
Test NTP Server
Description
DUT0 is configured to obtain some information over DHCP: IP address and NTP host.
Scenario
Step 1: Run command set date 2019-02-01 12:00:00 at DUT0.
Step 2: Run command show date at DUT0 and check if output contains the following tokens:
FriShow output
Fri 01 Feb 2019 12:00:00 +00:00
Step 3: Run command set date 2019-01-01 10:00:00 at DUT1.
Step 4: Run command show date at DUT1 and check if output contains the following tokens:
TueShow output
Tue 01 Jan 2019 10:00:00 +00:00
Step 5: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address 10.215.200.100/24 set service dhcp-server shared-network dhcpserver subnet 10.215.200.0/24 options default-router 10.215.200.100 set service dhcp-server shared-network dhcpserver subnet 10.215.200.0/24 options ntp-server 10.215.200.100 set service dhcp-server shared-network dhcpserver subnet 10.215.200.0/24 start 10.215.200.50 stop 10.215.200.50 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set system ntp master prefer set system ntp master stratum 3
Step 6: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set system ntp server dhcp
Step 7: Ping IP address 10.215.200.50 from DUT1:
admin@DUT1$ ping 10.215.200.50 count 1 size 56 timeout 1Show output
PING 10.215.200.50 (10.215.200.50) 56(84) bytes of data. 64 bytes from 10.215.200.50: icmp_seq=1 ttl=64 time=174 ms --- 10.215.200.50 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 173.777/173.777/173.777/0.000 ms
Step 8: Run command interfaces ethernet eth0 show at DUT0 and check if output contains the following tokens:
10.215.200.50/24Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.215.200.50/24 up up fe80::dcad:beff:feef:6c00/64
Step 9: Run command system ntp status at DUT0 and check if output contains the following tokens:
10.215.200.100Show output
remote refid st t when poll reach delay offset jitter =============================================================================== 10.215.200.100 127.127.1.0 4 u - 64 1 0.2348 -2685600177 0.0000
Step 10: Run command show date at DUT0 and check if output contains the following tokens:
TueShow output
Tue 01 Jan 2019 10:00:10 +00:00