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  2025/12/11 19:17:33  2025/12/12 07:17:33  2025/12/11 19:17:33

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  2025/12/11 19:17:38  2025/12/12 07:17:38  2025/12/11 19:17:38

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  2025/12/11 19:17:38  2025/12/12 07:17:38  2025/12/11 19:17:38

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  2025/12/11 19:17:51  2025/12/12 07:17:51  2025/12/11 19:17:51

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  2025/12/11 19:17:56  2025/12/12 07:17:56  2025/12/11 19:17:56

Test Authoritative

Description

This scenario checks the authoritative option. First, you need to configure a DHCP server without enabling the option and give a lease to the client. Then, change the configuration of the server for another subnet. The client will refresh his lease and see a problem: the new server is not in the same subnet and is not authorized to give a lease. Finally, if you enable the option and refresh the interface, you will see the server is authorized and can provide the lease 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 authoritative 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 mac '10:00:00:00:00:01'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Modify the following configuration lines in DUT1 :

set interfaces ethernet eth0 address dhcp

Warning

If you do not see changes after enabling the options, refresh all your interfaces

Step 4: 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 5: Modify the following configuration lines in DUT0 :

delete interfaces
delete service

Step 6: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 address 11.0.0.1/24
set service dhcp-server shared-network authoritative subnet 11.0.0.0/24 start 11.0.0.5 stop 11.0.0.5

Step 7: 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 8: Run command system journal show | tail at DUT0 and check if output contains the following tokens:

DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: ignored (not authoritative)
Show output
Dec 11 19:18:12.476370 osdx modulelauncher[525174]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76.
Dec 11 19:18:12.477538 osdx modulelauncher[525174]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --
Dec 11 19:18:12.477547 osdx modulelauncher[525174]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75.
Dec 11 19:18:12.550993 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main".
Dec 11 19:18:12.552441 osdx cfgd[1647]: [523857]Completed change to active configuration
Dec 11 19:18:12.553309 osdx dhcpd[525200]: Wrote 0 leases to leases file.
Dec 11 19:18:12.566440 osdx OSDxCLI[523857]: User 'admin' committed the configuration.
Dec 11 19:18:12.583158 osdx OSDxCLI[523857]: User 'admin' left the configuration menu.
Dec 11 19:18:12.602803 osdx dhcpd[525200]: Server starting service.
Dec 11 19:18:12.958687 osdx dhcpd[525200]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: ignored (not authoritative).

Step 9: Modify the following configuration lines in DUT0 :

set service dhcp-server options authoritative

Step 10: Run command system journal show | tail at DUT0 and check if output contains the following tokens:

DHCPNAK on 10.0.0.5 to 10:00:00:00:00:01 via eth0
Show output
Dec 11 19:18:13.667008 osdx systemd[1]: dhcpd@main.service: Deactivated successfully.
Dec 11 19:18:13.667152 osdx systemd[1]: Stopped dhcpd@main.service - "DHCP Server Service instance main".
Dec 11 19:18:13.694996 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main".
Dec 11 19:18:13.696312 osdx cfgd[1647]: [523857]Completed change to active configuration
Dec 11 19:18:13.697091 osdx dhcpd[525251]: Wrote 0 leases to leases file.
Dec 11 19:18:13.698502 osdx OSDxCLI[523857]: User 'admin' committed the configuration.
Dec 11 19:18:13.713855 osdx OSDxCLI[523857]: User 'admin' left the configuration menu.
Dec 11 19:18:13.750823 osdx dhcpd[525251]: Server starting service.
Dec 11 19:18:14.071073 osdx dhcpd[525251]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: wrong network.
Dec 11 19:18:14.071102 osdx dhcpd[525251]: DHCPNAK on 10.0.0.5 to 10:00:00:00:00:01 via eth0

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

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

Test Authoritative VRF

Description

This scenario checks the authoritative option when the server is configured with VRF instead of regular interfaces. First, configure the server and give a lease to the client. Then, change the configuration of the server and put it on a different subnet. Refresh the interfaces and you will see the server cannot do it. Change the configuration again and add the authoritative option. With this change, the server will be able to give a lease to the client.

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 authoritative local-vrf VRF0
set service dhcp-server shared-network authoritative 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 mac '10:00:00:00:00:01'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Modify the following configuration lines in DUT1 :

set interfaces ethernet eth0 address dhcp

Warning

If you do not see changes after enabling the options, refresh all your interfaces

Step 4: 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 5: Modify the following configuration lines in DUT0 :

delete interfaces
delete service

Step 6: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 address 11.0.0.1/24
set interfaces ethernet eth0 vrf VRF0
set service dhcp-server shared-network authoritative local-vrf VRF0
set service dhcp-server shared-network authoritative subnet 11.0.0.0/24 start 11.0.0.5 stop 11.0.0.5

Step 7: 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 8: Run command system journal show | tail at DUT0 and check if output contains the following tokens:

DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: ignored (not authoritative)
Show output
Dec 11 19:18:27.209490 osdx modulelauncher[525841]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --
Dec 11 19:18:27.209500 osdx modulelauncher[525841]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75.
Dec 11 19:18:27.223507 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Dec 11 19:18:27.311931 osdx systemd[1]: Started dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Dec 11 19:18:27.313646 osdx cfgd[1647]: [523857]Completed change to active configuration
Dec 11 19:18:27.314057 osdx dhcpd[525902]: Wrote 0 leases to leases file.
Dec 11 19:18:27.325265 osdx OSDxCLI[523857]: User 'admin' committed the configuration.
Dec 11 19:18:27.350830 osdx OSDxCLI[523857]: User 'admin' left the configuration menu.
Dec 11 19:18:27.359672 osdx dhcpd[525902]: Server starting service.
Dec 11 19:18:27.687880 osdx dhcpd[525902]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: ignored (not authoritative).

Step 9: Modify the following configuration lines in DUT0 :

set service dhcp-server options authoritative

Step 10: Run command system journal show | tail at DUT0 and check if output contains the following tokens:

DHCPNAK on 10.0.0.5 to 10:00:00:00:00:01 via eth0
Show output
Dec 11 19:18:28.439904 osdx systemd[1]: dhcpd@VRF0.service: Deactivated successfully.
Dec 11 19:18:28.440062 osdx systemd[1]: Stopped dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Dec 11 19:18:28.460011 osdx systemd[1]: Started dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Dec 11 19:18:28.461560 osdx cfgd[1647]: [523857]Completed change to active configuration
Dec 11 19:18:28.462417 osdx dhcpd[525953]: Wrote 0 leases to leases file.
Dec 11 19:18:28.464120 osdx OSDxCLI[523857]: User 'admin' committed the configuration.
Dec 11 19:18:28.499702 osdx dhcpd[525953]: Server starting service.
Dec 11 19:18:28.505229 osdx OSDxCLI[523857]: User 'admin' left the configuration menu.
Dec 11 19:18:28.891536 osdx dhcpd[525953]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: wrong network.
Dec 11 19:18:28.891557 osdx dhcpd[525953]: DHCPNAK on 10.0.0.5 to 10:00:00:00:00:01 via eth0

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

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

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