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/01/27 11:23:06  2026/01/27 23:23:06  2026/01/27 11:23:06

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/01/27 11:23:10  2026/01/27 23:23:10  2026/01/27 11:23:10

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/01/27 11:23:10  2026/01/27 23:23:10  2026/01/27 11:23:10

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/01/27 11:23:23  2026/01/27 23:23:23  2026/01/27 11:23:23

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/01/27 11:23:28  2026/01/27 23:23:28  2026/01/27 11:23:28

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
Jan 27 11:23:44.350396 osdx modulelauncher[132515]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76.
Jan 27 11:23:44.351910 osdx modulelauncher[132515]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --
Jan 27 11:23:44.351918 osdx modulelauncher[132515]: Command '/sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --' returned non-zero exit status 75.
Jan 27 11:23:44.494066 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main".
Jan 27 11:23:44.495825 osdx cfgd[1624]: [122962]Completed change to active configuration
Jan 27 11:23:44.496574 osdx dhcpd[132541]: Wrote 0 leases to leases file.
Jan 27 11:23:44.509282 osdx OSDxCLI[122962]: User 'admin' committed the configuration.
Jan 27 11:23:44.524961 osdx OSDxCLI[122962]: User 'admin' left the configuration menu.
Jan 27 11:23:44.553821 osdx dhcpd[132541]: Server starting service.
Jan 27 11:23:44.879777 osdx dhcpd[132541]: 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
Jan 27 11:23:45.570056 osdx systemd[1]: dhcpd@main.service: Deactivated successfully.
Jan 27 11:23:45.570210 osdx systemd[1]: Stopped dhcpd@main.service - "DHCP Server Service instance main".
Jan 27 11:23:45.598143 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main".
Jan 27 11:23:45.599727 osdx cfgd[1624]: [122962]Completed change to active configuration
Jan 27 11:23:45.600641 osdx dhcpd[132592]: Wrote 0 leases to leases file.
Jan 27 11:23:45.602091 osdx OSDxCLI[122962]: User 'admin' committed the configuration.
Jan 27 11:23:45.648890 osdx OSDxCLI[122962]: User 'admin' left the configuration menu.
Jan 27 11:23:45.653876 osdx dhcpd[132592]: Server starting service.
Jan 27 11:23:46.031937 osdx dhcpd[132592]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: wrong network.
Jan 27 11:23:46.031962 osdx dhcpd[132592]: 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
Jan 27 11:23:59.940087 osdx modulelauncher[133181]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --
Jan 27 11:23:59.940098 osdx modulelauncher[133181]: Command '/sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --' returned non-zero exit status 75.
Jan 27 11:23:59.953877 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Jan 27 11:24:00.106188 osdx systemd[1]: Started dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Jan 27 11:24:00.108030 osdx cfgd[1624]: [122962]Completed change to active configuration
Jan 27 11:24:00.108760 osdx dhcpd[133242]: Wrote 0 leases to leases file.
Jan 27 11:24:00.120456 osdx OSDxCLI[122962]: User 'admin' committed the configuration.
Jan 27 11:24:00.158524 osdx OSDxCLI[122962]: User 'admin' left the configuration menu.
Jan 27 11:24:00.173970 osdx dhcpd[133242]: Server starting service.
Jan 27 11:24:00.556148 osdx dhcpd[133242]: 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
Jan 27 11:24:01.302213 osdx systemd[1]: dhcpd@VRF0.service: Deactivated successfully.
Jan 27 11:24:01.302337 osdx systemd[1]: Stopped dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Jan 27 11:24:01.326469 osdx systemd[1]: Started dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Jan 27 11:24:01.329742 osdx cfgd[1624]: [122962]Completed change to active configuration
Jan 27 11:24:01.331406 osdx dhcpd[133293]: Wrote 0 leases to leases file.
Jan 27 11:24:01.334230 osdx OSDxCLI[122962]: User 'admin' committed the configuration.
Jan 27 11:24:01.365988 osdx OSDxCLI[122962]: User 'admin' left the configuration menu.
Jan 27 11:24:01.383066 osdx dhcpd[133293]: Server starting service.
Jan 27 11:24:01.848482 osdx dhcpd[133293]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: wrong network.
Jan 27 11:24:01.848512 osdx dhcpd[133293]: 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