Time-Options
These scenarios check DHCP server time synchronization options. This includes: ntp-server, time-server, and time-offset.
Test NTP-Server Single
Description
This scenario checks the ntp-server option with a single NTP server.
The DHCP server configures one NTP server, and the client receives it in the lease.
Verification is done via monitor-db and packet capture to confirm the server
actually sends NTP (42) option in the DHCP ACK.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.0.0.1/24 set service dhcp-server shared-network ntp-single subnet 10.0.0.0/24 options ntp-server 10.0.0.10 set service dhcp-server shared-network ntp-single subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
10.0.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command show monitor-db system dhcp interface eth0 ntp-servers at DUT1 and expect this output:
Show output
10.0.0.10
Step 5: Run command traffic dump monitor detail interface eth0 filter "port 67 or port 68" packets 10 at DUT0.
Step 6: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:
Show output
Renewing DHCP lease on interface eth0...
Test NTP-Server Multiple
Description
This scenario checks the ntp-server option with multiple NTP servers.
The DHCP server configures three NTP servers, and the client receives all of them.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.0.0.1/24 set service dhcp-server shared-network ntp-multiple subnet 10.0.0.0/24 options ntp-server 10.0.0.10 set service dhcp-server shared-network ntp-multiple subnet 10.0.0.0/24 options ntp-server 10.0.0.11 set service dhcp-server shared-network ntp-multiple subnet 10.0.0.0/24 options ntp-server 10.0.0.12 set service dhcp-server shared-network ntp-multiple subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
10.0.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command show monitor-db system dhcp interface eth0 ntp-servers at DUT1 and expect this output:
Show output
10.0.0.10, 10.0.0.11, 10.0.0.12
Test NTP-Server VRF
Description
This scenario checks the ntp-server option when the DHCP server is configured with VRF.
Multiple NTP servers are configured in a VRF environment, and the client receives them correctly.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.0.0.1/24 set interfaces ethernet eth0 vrf VRF0 set service dhcp-server shared-network ntp-vrf local-vrf VRF0 set service dhcp-server shared-network ntp-vrf subnet 10.0.0.0/24 options ntp-server 10.0.0.10 set service dhcp-server shared-network ntp-vrf subnet 10.0.0.0/24 options ntp-server 10.0.0.11 set service dhcp-server shared-network ntp-vrf subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set system vrf VRF0
Step 2: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
10.0.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command show monitor-db system dhcp interface eth0 ntp-servers at DUT1 and expect this output:
Show output
10.0.0.10, 10.0.0.11
Test Change NTP-Server
Description
This scenario checks that NTP servers can be changed dynamically. Configure initial NTP servers, then change them and verify the client receives the new values.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.0.0.1/24 set service dhcp-server shared-network ntp-single subnet 10.0.0.0/24 options ntp-server 10.0.0.10 set service dhcp-server shared-network ntp-single subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
10.0.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command show monitor-db system dhcp interface eth0 ntp-servers at DUT1 and expect this output:
Show output
10.0.0.10
Step 5: Modify the following configuration lines in DUT0 :
set service dhcp-server shared-network ntp-single subnet 10.0.0.0/24 options ntp-server 10.0.0.11
Step 6: Run command show monitor-db system dhcp interface eth0 ntp-servers at DUT1 and expect this output:
Show output
10.0.0.10, 10.0.0.11
Test Remove NTP-Server
Description
This scenario checks that NTP servers can be removed. Configure NTP servers, then remove them and verify they are no longer sent to the client.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.0.0.1/24 set service dhcp-server shared-network ntp-multiple subnet 10.0.0.0/24 options ntp-server 10.0.0.10 set service dhcp-server shared-network ntp-multiple subnet 10.0.0.0/24 options ntp-server 10.0.0.11 set service dhcp-server shared-network ntp-multiple subnet 10.0.0.0/24 options ntp-server 10.0.0.12 set service dhcp-server shared-network ntp-multiple subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
10.0.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command show monitor-db system dhcp interface eth0 ntp-servers at DUT1 and expect this output:
Show output
10.0.0.10, 10.0.0.11, 10.0.0.12
Step 5: Modify the following configuration lines in DUT0 :
delete service dhcp-server shared-network ntp-multiple subnet 10.0.0.0/24 options
Step 6: Run command show monitor-db system dhcp interface eth0 ntp-servers at DUT1 and expect this output: