Ranges-Advanced
These scenarios check advanced DHCP server range functionality. This includes testing edge cases like range exhaustion, where all available IPs in the range have been assigned, and verifying server behavior in such situations.
Test Range Exhaustion
Description
This scenario checks server behavior when all IPs in the range are exhausted. Configure a small range with only 2 IPs (.5 and .6). Two clients should obtain IPs successfully, but a third client should not be able to obtain an IP (range exhausted).
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 small-range subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.6 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: Set the following configuration in DUT2 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 5: Run command interfaces ethernet eth0 show at DUT2 and check if output contains the following tokens:
10.0.0.6Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.6/24 up up fe80::dcad:beff:feef:6c20/64
Step 6: Run command service dhcp-server show stats at DUT0 and expect this output:
Show output
------------------------------------------------------- Instance Total leases Active leases Available leases ------------------------------------------------------- main 2 2 0
Test Client Request When No IPs Available
Description
This scenario checks that a client cannot obtain an IP when range is exhausted. With a range of only 1 IP, after the first client obtains it, a second client should fail to get an IP.
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 tiny-range 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: Set the following configuration in DUT2 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 5: Run command interfaces ethernet eth0 show at DUT2 and expect this output:
Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 fe80::dcad:beff:feef:6c20/64 up up
Step 6: Run command service dhcp-server show stats at DUT0 and expect this output:
Show output
------------------------------------------------------- Instance Total leases Active leases Available leases ------------------------------------------------------- main 1 1 0
Test Range Recovery After Lease Release
Description
This scenario checks that IPs become available again after release. After exhausting a range, releasing one IP should make it available for a new 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 small-range subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.6 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: Set the following configuration in DUT2 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 5: Run command interfaces ethernet eth0 show at DUT2 and check if output contains the following tokens:
10.0.0.6Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.6/24 up up fe80::dcad:beff:feef:6c20/64
Step 6: Run command service dhcp-server show stats at DUT0 and expect this output:
Show output
------------------------------------------------------- Instance Total leases Active leases Available leases ------------------------------------------------------- main 2 2 0
Step 7: Modify the following configuration lines in DUT1 :
delete interfaces
Step 8: Run command service dhcp-server show stats at DUT0 and expect this output:
Show output
------------------------------------------------------- Instance Total leases Active leases Available leases ------------------------------------------------------- main 2 1 1
Step 9: Modify the following configuration lines in DUT2 :
delete interfaces
Step 10: Modify the following configuration lines in DUT2 :
set interfaces ethernet eth0 address dhcp
Step 11: Run command interfaces ethernet eth0 show at DUT2 and expect this output:
Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.6/24 up up fe80::dcad:beff:feef:6c20/64
Test Range Exhaustion with Static Mappings
Description
This scenario checks range exhaustion when static mappings reserve IPs. A static mapping reserves an IP from the range. With a range of 2 IPs where 1 is reserved, only 1 IP is available for dynamic assignment.
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 range-static subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.6 set service dhcp-server shared-network range-static subnet 10.0.0.0/24 static-mapping reserved ip-address 10.0.0.5 set service dhcp-server shared-network range-static subnet 10.0.0.0/24 static-mapping reserved mac-address '10:00:00:00:00:99' 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.6Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.6/24 up up fe80::dcad:beff:feef:6c10/64
Step 4: Set the following configuration in DUT2 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 5: Run command interfaces ethernet eth0 show at DUT2 and expect this output:
Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 fe80::dcad:beff:feef:6c20/64 up up
Step 6: Run command service dhcp-server show stats at DUT0 and expect this output:
Show output
------------------------------------------------------- Instance Total leases Active leases Available leases ------------------------------------------------------- main 1 1 0
Test Range Exhaustion with VRF
Description
This scenario checks that range exhaustion works correctly in VRF context.
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 small-range-vrf local-vrf VRF0 set service dhcp-server shared-network small-range-vrf subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.6 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: Set the following configuration in DUT2 :
set interfaces ethernet eth0 address dhcp set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 5: Run command interfaces ethernet eth0 show at DUT2 and check if output contains the following tokens:
10.0.0.6Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.6/24 up up fe80::dcad:beff:feef:6c20/64
Step 6: Run command service dhcp-server show stats at DUT0 and expect this output:
Show output
------------------------------------------------------- Instance Total leases Active leases Available leases ------------------------------------------------------- VRF0 2 2 0