Lifecycle
Test suite to validate DHCP client lifecycle operations.
The DHCP client supports various lifecycle operations: - RENEW: Request renewal of existing lease - RELEASE: Release current lease back to server - RESTART: Stop and start DHCP client - STOP: Stop DHCP client completely
This test suite verifies that: - RENEW maintains the same IP address - RELEASE properly frees the IP on server - RESTART can obtain same or different IP - Operations work with VRF and VLAN
Test DHCP Client RENEW Maintains IP
Description
This scenario checks that DHCP client RENEW maintains the same IP address. When a client renews its lease, it should keep the same IP it already has. This is critical for maintaining stable network connectivity. Verification includes packet capture to confirm DHCPREQUEST/DHCPACK exchange.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.16.0.1/24 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 start 172.16.0.5 stop 172.16.0.10 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:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command traffic dump monitor detail interface eth0 filter "port 67 or port 68" packets 10 at DUT0.
Step 5: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:
Show output
Renewing DHCP lease on interface eth0...
Step 6: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 7: Run command service dhcp-server show leases at DUT0 and check if output contains the following tokens:
172.16.0.5Show output
Instance main: -------------------------------------------------------------------------------------------- IP Address MAC Address Start Time Expiration Time Last Transaction -------------------------------------------------------------------------------------------- 172.16.0.5 de:ad:be:ef:6c:10 2026/03/05 21:09:45 2026/03/06 09:09:45 2026/03/05 21:09:45
Test DHCP Client RELEASE Frees IP
Description
This scenario checks that DHCP client RELEASE properly frees the IP. When a client releases its lease, the server should mark it as free and the client should no longer have the IP address. We release by removing DHCP configuration. Verification includes packet capture to confirm DHCPRELEASE is sent.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.16.0.1/24 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 start 172.16.0.5 stop 172.16.0.10 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:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command service dhcp-server show leases at DUT0 and check if output contains the following tokens:
172.16.0.5Show output
Instance main: -------------------------------------------------------------------------------------------- IP Address MAC Address Start Time Expiration Time Last Transaction -------------------------------------------------------------------------------------------- 172.16.0.5 de:ad:be:ef:6c:10 2026/03/05 21:10:02 2026/03/06 09:10:02 2026/03/05 21:10:02
Step 5: Run command traffic dump monitor detail interface eth0 filter "port 67 or port 68" packets 10 at DUT0.
Step 6: Modify the following configuration lines in DUT1 :
delete interfaces
Step 7: Run command interfaces ethernet eth0 show at DUT1 and expect this output:
Show output
----------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------- eth0 down down
Step 8: Run command service dhcp-server show leases at DUT0 and expect this output:
Test DHCP Client RESTART
Description
This scenario checks that DHCP client RESTART works correctly. RESTART stops and starts the DHCP client, which may result in the same IP (if available) or a different IP from the pool. We restart by removing and re-adding DHCP configuration.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.16.0.1/24 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 start 172.16.0.5 stop 172.16.0.10 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:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command interfaces ethernet eth0 show at DUT1 and expect this output:
Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 5: Modify the following configuration lines in DUT1 :
delete interfaces
Step 6: Modify the following configuration lines in DUT1 :
set interfaces ethernet eth0 address dhcp
Step 7: Run command interfaces ethernet eth0 show at DUT1 and expect this output:
Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Test DHCP Client STOP
Description
This scenario checks that DHCP client STOP removes the IP address. When DHCP client is stopped, the interface should no longer have the DHCP-assigned IP address. We stop by removing DHCP configuration.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.16.0.1/24 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 start 172.16.0.5 stop 172.16.0.10 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:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Modify the following configuration lines in DUT1 :
delete interfaces
Step 5: Run command interfaces ethernet eth0 show at DUT1 and expect this output:
Show output
----------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------- eth0 down down
Test DHCP Client RENEW with VRF
Description
This scenario checks that DHCP client RENEW works in VRF context.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.16.0.1/24 set interfaces ethernet eth0 vrf VRF0 set service dhcp-server shared-network dhcp local-vrf VRF0 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 start 172.16.0.5 stop 172.16.0.10 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:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:
Show output
Renewing DHCP lease on interface eth0...
Step 5: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Test DHCP Client RENEW with VLAN
Description
This scenario checks that DHCP client RENEW works on VLAN sub-interfaces.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 vif 100 address 172.16.0.1/24 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 start 172.16.0.5 stop 172.16.0.10 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Set the following configuration in DUT1 :
set interfaces ethernet eth0 vif 100 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Run command interfaces ethernet eth0 vif 100 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
--------------------------------------------------------------------- Name IP Address Admin Oper Vrf Description --------------------------------------------------------------------- eth0.100 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command service dhcp-client renew interface eth0.100 at DUT1 and expect this output:
Show output
Renewing DHCP lease on interface eth0.100...
Step 5: Run command interfaces ethernet eth0 vif 100 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
--------------------------------------------------------------------- Name IP Address Admin Oper Vrf Description --------------------------------------------------------------------- eth0.100 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Test Multiple RENEW Operations
Description
This scenario checks that multiple consecutive RENEW operations work correctly. Performing multiple renewals should not cause any issues.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.16.0.1/24 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 start 172.16.0.5 stop 172.16.0.10 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:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:
Show output
Renewing DHCP lease on interface eth0...
Step 5: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 6: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:
Show output
Renewing DHCP lease on interface eth0...
Step 7: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 8: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:
Show output
Renewing DHCP lease on interface eth0...
Step 9: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 10: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:
Show output
Renewing DHCP lease on interface eth0...
Step 11: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 12: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:
Show output
Renewing DHCP lease on interface eth0...
Step 13: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Test RELEASE and Request New Lease
Description
This scenario checks that after RELEASE, client can request a new lease. This verifies the complete lifecycle: obtain → release → obtain again. We release by removing DHCP and then re-adding it.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.16.0.1/24 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 start 172.16.0.5 stop 172.16.0.10 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:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Modify the following configuration lines in DUT1 :
delete interfaces
Step 5: Run command interfaces ethernet eth0 show at DUT1 and expect this output:
Show output
----------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------- eth0 down down
Step 6: Modify the following configuration lines in DUT1 :
set interfaces ethernet eth0 address dhcp
Step 7: Run command interfaces ethernet eth0 show at DUT1 and expect this output:
Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 8: Run command service dhcp-server show leases at DUT0 and expect this output:
Show output
Instance main: -------------------------------------------------------------------------------------------- IP Address MAC Address Start Time Expiration Time Last Transaction -------------------------------------------------------------------------------------------- 172.16.0.5 de:ad:be:ef:6c:10 2026/03/05 21:11:55 2026/03/06 09:11:55 2026/03/05 21:11:55
Test Lease Expiration and Auto-Renewal
Description
This scenario checks that client automatically renews lease before expiration. With a short lease time (60s), the client should automatically renew at T1 (30s) without manual intervention.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.16.0.1/24 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 options lease 60 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 options max-lease 120 set service dhcp-server shared-network dhcp subnet 172.16.0.0/24 start 172.16.0.5 stop 172.16.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:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Run command interfaces ethernet eth0 show at DUT1 and expect this output:
Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 5: Run command interfaces ethernet eth0 show at DUT1 and expect this output:
Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 6: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
172.16.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 172.16.0.5/24 up up fe80::dcad:beff:feef:6c10/64