Server
These scenarios checks the correct functioning of the basic DHCP functions.
Test DHCP Server
Description
This scenario checks DHCP server is running properly. For this scenario, you need a server and a client, this server will add his configuration and the client will ask for a lease. Then, the server check that has received the leases for the client and the client will check it has received the IP addresses also. Finally, the server will clear his leases and check it has not leases. In addition, the client will check it has not 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
Step 2: Set the following configuration in DUT1
:
set interfaces ethernet eth0 vif 100 address dhcp set interfaces ethernet eth0 vif 101 address dhcp
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:6c20/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:6c20/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:20 2024/06/20 18:06:41 2024/06/21 06:06:41 2024/06/20 18:06:41 11.0.0.5 de:ad:be:ef:6c:20 2024/06/20 18:06:41 2024/06/21 06:06:41 2024/06/20 18:06:41
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:20 2024/06/20 18:06:41 2024/06/21 06:06:41 2024/06/20 18:06:41 11.0.0.5 de:ad:be:ef:6c:20 2024/06/20 18:06:41 2024/06/21 06:06:41 2024/06/20 18:06:41
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*0Show 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:20 2024/06/20 18:06:41 2024/06/21 06:06:41 2024/06/20 18:06:41
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*1Show 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*2Show output
main 2 0 2
Test DHCP Server VRF
Description
This scenario checks DHCP server is running properly. For this scenario, you need a server and a client, this server will add his configuration and the client will ask for a lease. Then, the server check that has received the leases for the client and the client will check it has received the IP addresses also. Finally, the server will clear his leases and check it has not leases. In addition, the client will check it has not 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 subnet 10.0.0.0/24 start 10.0.0.10 stop 10.0.0.10 set service dhcp-server shared-network SH1 subnet 11.0.0.0/24 start 11.0.0.10 stop 11.0.0.10 set service dhcp-server shared-network SH0 local-vrf VRF0 set service dhcp-server shared-network SH1 local-vrf VRF1 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
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:6c20/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:6c20/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:20 2024/06/20 18:06:58 2024/06/21 06:06:58 2024/06/20 18:06:58 Instance VRF1: -------------------------------------------------------------------------------------------- IP Address MAC Address Start Time Expiration Time Last Transaction -------------------------------------------------------------------------------------------- 11.0.0.10 de:ad:be:ef:6c:20 2024/06/20 18:06:58 2024/06/21 06:06:58 2024/06/20 18:06:58
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:20 2024/06/20 18:06:58 2024/06/21 06:06:58 2024/06/20 18:06:58 Instance VRF1: -------------------------------------------------------------------------------------------- IP Address MAC Address Start Time Expiration Time Last Transaction -------------------------------------------------------------------------------------------- 11.0.0.10 de:ad:be:ef:6c:20 2024/06/20 18:06:58 2024/06/21 06:06:58 2024/06/20 18:06:58
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*0Show 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*0Show 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:20 2024/06/20 18:06:58 2024/06/21 06:06:58 2024/06/20 18:06:58
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*1Show 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*0Show 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*1Show 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*1Show output
VRF1 1 0 1