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/02/19 10:04:02  2026/02/19 22:04:02  2026/02/19 10:04: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/02/19 10:04:06  2026/02/19 22:04:06  2026/02/19 10:04:06

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/02/19 10:04:06  2026/02/19 22:04:06  2026/02/19 10:04:06

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/02/19 10:04:19  2026/02/19 22:04:19  2026/02/19 10:04:19

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/02/19 10:04:23  2026/02/19 22:04:23  2026/02/19 10:04:23

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
Feb 19 10:04:38.302811 osdx modulelauncher[260151]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76.
Feb 19 10:04:38.304427 osdx modulelauncher[260151]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --
Feb 19 10:04:38.304436 osdx modulelauncher[260151]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75.
Feb 19 10:04:38.397533 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main".
Feb 19 10:04:38.399008 osdx cfgd[1859]: [258822]Completed change to active configuration
Feb 19 10:04:38.399692 osdx dhcpd[260177]: Wrote 0 leases to leases file.
Feb 19 10:04:38.412603 osdx OSDxCLI[258822]: User 'admin' committed the configuration.
Feb 19 10:04:38.451792 osdx OSDxCLI[258822]: User 'admin' left the configuration menu.
Feb 19 10:04:38.465358 osdx dhcpd[260177]: Server starting service.
Feb 19 10:04:38.758682 osdx dhcpd[260177]: 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
Feb 19 10:04:39.657464 osdx systemd[1]: dhcpd@main.service: Deactivated successfully.
Feb 19 10:04:39.657591 osdx systemd[1]: Stopped dhcpd@main.service - "DHCP Server Service instance main".
Feb 19 10:04:39.681628 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main".
Feb 19 10:04:39.683073 osdx cfgd[1859]: [258822]Completed change to active configuration
Feb 19 10:04:39.684101 osdx dhcpd[260228]: Wrote 0 leases to leases file.
Feb 19 10:04:39.685600 osdx OSDxCLI[258822]: User 'admin' committed the configuration.
Feb 19 10:04:39.729653 osdx OSDxCLI[258822]: User 'admin' left the configuration menu.
Feb 19 10:04:39.737321 osdx dhcpd[260228]: Server starting service.
Feb 19 10:04:40.098411 osdx dhcpd[260228]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: wrong network.
Feb 19 10:04:40.098437 osdx dhcpd[260228]: 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
Feb 19 10:04:53.786939 osdx modulelauncher[260823]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --
Feb 19 10:04:53.786946 osdx modulelauncher[260823]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75.
Feb 19 10:04:53.797456 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Feb 19 10:04:53.901805 osdx systemd[1]: Started dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Feb 19 10:04:53.903120 osdx cfgd[1859]: [258822]Completed change to active configuration
Feb 19 10:04:53.904360 osdx dhcpd[260884]: Wrote 0 leases to leases file.
Feb 19 10:04:53.914930 osdx OSDxCLI[258822]: User 'admin' committed the configuration.
Feb 19 10:04:53.931396 osdx OSDxCLI[258822]: User 'admin' left the configuration menu.
Feb 19 10:04:53.937599 osdx dhcpd[260884]: Server starting service.
Feb 19 10:04:54.314625 osdx dhcpd[260884]: 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
Feb 19 10:04:55.001831 osdx systemd[1]: dhcpd@VRF0.service: Deactivated successfully.
Feb 19 10:04:55.001937 osdx systemd[1]: Stopped dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Feb 19 10:04:55.025963 osdx systemd[1]: Started dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Feb 19 10:04:55.027306 osdx cfgd[1859]: [258822]Completed change to active configuration
Feb 19 10:04:55.028069 osdx dhcpd[260935]: Wrote 0 leases to leases file.
Feb 19 10:04:55.029696 osdx OSDxCLI[258822]: User 'admin' committed the configuration.
Feb 19 10:04:55.054120 osdx OSDxCLI[258822]: User 'admin' left the configuration menu.
Feb 19 10:04:55.077711 osdx dhcpd[260935]: Server starting service.
Feb 19 10:04:55.398613 osdx dhcpd[260935]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: wrong network.
Feb 19 10:04:55.398637 osdx dhcpd[260935]: 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