Server

These scenarios check the basic DHCP functions operate correctly.

Test DHCP Server

Description

This scenario checks the DHCP server is running properly. For this scenario, you need a server and a client. The server will add its configuration and the client will ask for a lease. The server will check it has received the leases for the client and the client will check whether it has also received the IP addresses. Finally, the server will clear its leases and verify it has none. In turn, the client will check it has no IP addresses for the interfaces requested.

Scenario

Step 1: Set the following configuration in DUT0:

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 101 address 11.0.0.1/24
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set service dhcp-server shared-network dhcp-2 subnet 11.0.0.0/24 start 11.0.0.5 stop 11.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 vif 100 address dhcp
set interfaces ethernet eth0 vif 101 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 vif 100 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.100  10.0.0.5/24                   up     up
          fe80::dcad:beff:feef:6c10/64

Step 4: Run command interfaces ethernet eth0 vif 101 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.101  11.0.0.5/24                   up     up
          fe80::dcad:beff:feef:6c10/64

Step 5: Run command service dhcp-server show leases at DUT0 and check if output contains the following tokens:

10.0.0.5
Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.5   de:ad:be:ef:6c:10  2024/12/04 15:53:16  2024/12/05 03:53:16  2024/12/04 15:53:16
 11.0.0.5   de:ad:be:ef:6c:10  2024/12/04 15:53:16  2024/12/05 03:53:16  2024/12/04 15:53:16

Step 6: Run command service dhcp-server show leases at DUT0 and check if output contains the following tokens:

11.0.0.5
Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.5   de:ad:be:ef:6c:10  2024/12/04 15:53:16  2024/12/05 03:53:16  2024/12/04 15:53:16
 11.0.0.5   de:ad:be:ef:6c:10  2024/12/04 15:53:16  2024/12/05 03:53:16  2024/12/04 15:53:16

Step 7: Run command service dhcp-server show stats | grep main at DUT0 and check if output matches the following regular expressions:

\s*main\s*2\s*2\s*0
Show output
main         2              2               0

Step 8: Run command service dhcp-server clear main lease 10.0.0.5 at DUT0.

Step 9: Run command service dhcp-server show leases at DUT0 and check if output does not contain the following tokens:

10.0.0.5
Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 11.0.0.5   de:ad:be:ef:6c:10  2024/12/04 15:53:16  2024/12/05 03:53:16  2024/12/04 15:53:16

Step 10: Run command service dhcp-server show stats | grep main at DUT0 and check if output matches the following regular expressions:

\s*main\s*2\s*1\s*1
Show output
main         2              1               1

Step 11: Run command service dhcp-server clear main lease 11.0.0.5 at DUT0.

Step 12: Run command service dhcp-server show leases at DUT0 and check if output does not contain the following tokens:

11.0.0.5

Step 13: Run command service dhcp-server show stats | grep main at DUT0 and check if output matches the following regular expressions:

\s*main\s*2\s*0\s*2
Show output
main         2              0               2

Test DHCP Server VRF

Description

This scenario checks the DHCP server is running properly. For this scenario, you need a server and a client. The server will add its configuration and the client will ask for a lease. The server will then check it has received the leases for the client and the client will check whether it has also received the IP addresses. Finally, the server will clear its leases and check it has none. In turn, the client will check it has no IP addresses for the interfaces requested.

Scenario

Step 1: Set the following configuration in DUT0:

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 vrf VRF0
set interfaces ethernet eth0 vif 101 address 11.0.0.1/24
set interfaces ethernet eth0 vif 101 vrf VRF1
set service dhcp-server shared-network SH0 local-vrf VRF0
set service dhcp-server shared-network SH0 subnet 10.0.0.0/24 start 10.0.0.10 stop 10.0.0.10
set service dhcp-server shared-network SH1 local-vrf VRF1
set service dhcp-server shared-network SH1 subnet 11.0.0.0/24 start 11.0.0.10 stop 11.0.0.10
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrf VRF0
set system vrf VRF1

Step 2: Set the following configuration in DUT1:

set interfaces ethernet eth0 vif 100 address dhcp
set interfaces ethernet eth0 vif 101 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

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

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

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

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

Step 5: Run command service dhcp-server show leases at DUT0 and check if output contains the following tokens:

10.0.0.10
Show output
Instance VRF0:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
10.0.0.10   de:ad:be:ef:6c:10  2024/12/04 15:53:30  2024/12/05 03:53:30  2024/12/04 15:53:30

Instance VRF1:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
11.0.0.10   de:ad:be:ef:6c:10  2024/12/04 15:53:30  2024/12/05 03:53:30  2024/12/04 15:53:30

Step 6: Run command service dhcp-server show leases at DUT0 and check if output contains the following tokens:

11.0.0.10
Show output
Instance VRF0:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
10.0.0.10   de:ad:be:ef:6c:10  2024/12/04 15:53:30  2024/12/05 03:53:30  2024/12/04 15:53:30

Instance VRF1:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
11.0.0.10   de:ad:be:ef:6c:10  2024/12/04 15:53:30  2024/12/05 03:53:30  2024/12/04 15:53:30

Step 7: Run command service dhcp-server show stats | grep VRF0 at DUT0 and check if output matches the following regular expressions:

\s*VRF0\s*1\s*1\s*0
Show output
VRF0         1              1               0

Step 8: Run command service dhcp-server show stats | grep VRF1 at DUT0 and check if output matches the following regular expressions:

\s*VRF1\s*1\s*1\s*0
Show output
VRF1         1              1               0

Step 9: Run command service dhcp-server clear VRF0 lease 10.0.0.10 at DUT0.

Step 10: Run command service dhcp-server show leases at DUT0 and check if output does not contain the following tokens:

10.0.0.10
Show output
Instance VRF1:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
11.0.0.10   de:ad:be:ef:6c:10  2024/12/04 15:53:30  2024/12/05 03:53:30  2024/12/04 15:53:30

Step 11: Run command service dhcp-server show stats | grep VRF0 at DUT0 and check if output matches the following regular expressions:

\s*VRF0\s*1\s*0\s*1
Show output
VRF0         1              0               1

Step 12: Run command service dhcp-server show stats | grep VRF1 at DUT0 and check if output matches the following regular expressions:

\s*VRF1\s*1\s*1\s*0
Show output
VRF1         1              1               0

Step 13: Run command service dhcp-server clear VRF1 lease 11.0.0.10 at DUT0.

Step 14: Run command service dhcp-server show leases at DUT0 and check if output does not contain the following tokens:

11.0.0.10

Step 15: Run command service dhcp-server show stats | grep VRF0 at DUT0 and check if output matches the following regular expressions:

\s*VRF0\s*1\s*0\s*1
Show output
VRF0         1              0               1

Step 16: Run command service dhcp-server show stats | grep VRF1 at DUT0 and check if output matches the following regular expressions:

\s*VRF1\s*1\s*0\s*1
Show output
VRF1         1              0               1

Test DHCP Server Disable

Description

This scenario checks some operational commands when the DHCP server is disabled.

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 dhcp 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 service dhcp-server show leases at DUT0 and check if output contains the following tokens:

10.0.0.5
Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.5   de:ad:be:ef:6c:10  2024/12/04 15:53:43  2024/12/05 03:53:43  2024/12/04 15:53:43

Step 5: Modify the following configuration lines in DUT0:

set service dhcp-server disable

Step 6: Run command service dhcp-server show leases at DUT0 and check if output contains the following tokens:

DHCP-Server is not running
Show output
DHCP-Server is not running