Server-Control

These scenarios check DHCP server control options that affect server behavior. This includes: authoritative, one-lease-per-client, lease time, and max-lease time.

Test One Lease Per Client

Description

This scenario checks the one-lease-per-client option. The test simulates a client that moves between networks by using different dhcp-client-identifiers. Without one-lease-per-client, the server keeps both leases active. With the option enabled, when the client requests a new lease, the server automatically frees any other leases the client holds. This is useful for mobile clients that change networks frequently.

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 one-lease subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.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 interfaces ethernet eth0 dhcp client send dhcp-client-identifier string client-A
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
Show 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 ip-address at DUT1 and expect this output:

Show output
10.0.0.5

Step 5: Run command service dhcp-server show leases main at DUT0 and expect this output:

Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.5   de:ad:be:ef:6c:10  2026/03/05 20:27:02  2026/03/06 08:27:02  2026/03/05 20:27:02

Step 6: Modify the following configuration lines in DUT1 :

delete interfaces ethernet eth0 address

Step 7: Modify the following configuration lines in DUT1 :

delete interfaces

Step 8: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 dhcp client send dhcp-client-identifier string client-B
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 9: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.6/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 10: Run command show monitor-db system dhcp interface eth0 ip-address at DUT1 and expect this output:

Show output
10.0.0.6

Step 11: Run command service dhcp-server show leases main at DUT0 and expect this output:

Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.6   de:ad:be:ef:6c:10  2026/03/05 20:27:07  2026/03/06 08:27:07  2026/03/05 20:27:07

Step 12: Modify the following configuration lines in DUT0 :

set service dhcp-server shared-network one-lease subnet 10.0.0.0/24 options one-lease-per-client

Step 13: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:

Show output
Renewing DHCP lease on interface eth0...

Step 14: Run command service dhcp-server show leases main at DUT0 and expect this output:

Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.6   de:ad:be:ef:6c:10  2026/03/05 20:27:07  2026/03/06 08:27:07  2026/03/05 20:27:07

Test One Lease Per Client VRF

Description

This scenario checks the one-lease-per-client option when the server is configured with VRF. Same behavior as the non-VRF test: when enabled, the server frees old leases when a client requests a new one.

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 one-lease local-vrf VRF0
set service dhcp-server shared-network one-lease subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.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 interfaces ethernet eth0 dhcp client send dhcp-client-identifier string client-A
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
Show 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 ip-address at DUT1 and expect this output:

Show output
10.0.0.5

Step 5: Run command service dhcp-server show leases VRF0 at DUT0 and expect this output:

Show output
Instance VRF0:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.5   de:ad:be:ef:6c:10  2026/03/05 20:27:20  2026/03/06 08:27:20  2026/03/05 20:27:20

Step 6: Modify the following configuration lines in DUT1 :

delete interfaces ethernet eth0 address

Step 7: Modify the following configuration lines in DUT1 :

delete interfaces

Step 8: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 dhcp client send dhcp-client-identifier string client-B
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 9: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.6/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 10: Run command show monitor-db system dhcp interface eth0 ip-address at DUT1 and expect this output:

Show output
10.0.0.6

Step 11: Modify the following configuration lines in DUT0 :

set service dhcp-server shared-network one-lease subnet 10.0.0.0/24 options one-lease-per-client

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 service dhcp-server show leases VRF0 at DUT0 and expect this output:

Show output
Instance VRF0:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.6   de:ad:be:ef:6c:10  2026/03/05 20:27:25  2026/03/06 08:27:25  2026/03/05 20:27:25

Test Lease Time

Description

This scenario checks the lease and max-lease options. The DHCP server configures custom lease times (default and maximum). The client should receive a lease with the configured lease time. The lease time determines how long the client can use the IP address before renewal.

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 lease-time subnet 10.0.0.0/24 options lease 120
set service dhcp-server shared-network lease-time subnet 10.0.0.0/24 options max-lease 240
set service dhcp-server shared-network lease-time 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.5
Show 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 lease-time at DUT1 and expect this output:

Show output
240

Test Server-Identifier

Description

This scenario checks the server-identifier option. The DHCP server configures a specific server identifier IP address. The client receives this identifier in the DHCP lease, which identifies the DHCP server. This is useful in environments with multiple DHCP servers.

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 server-id subnet 10.0.0.0/24 options server-identifier 10.0.0.1
set service dhcp-server shared-network server-id 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.5
Show 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 dhcp-server-identifier at DUT1 and expect this output:

Show output
10.0.0.1