Options
These scenarios check the functionality of different DHCP server options.
Test One Lease Per Client
Description
This scenario checks the one-lease-per-client
option. In this scenario, you need
two active leases at the same time. First, check those leases are active and then activate
this option and check that no two leases belonging to the same client (same MAC address) are active at the same time.
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 200 address 10.0.0.2/24 set interfaces ethernet eth1 address 10.215.168.64/24 set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 options lease 4 set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 options max-lease 4 set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.6 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 mac '10:00:00:00:00:01' set interfaces ethernet eth0 vif 200 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 vif 100 address dhcp set interfaces ethernet eth0 vif 200 address dhcp
Warning
If you do not see changes after enabling the options, refresh all your interfaces
Step 4: Run command service dhcp-server show leases main | grep 10.0.0.5
at DUT0
and check if output contains the following tokens:
10:00:00:00:00:01Show output
10.0.0.5 10:00:00:00:00:01 2020/11/08 08:43:51
Step 5: Run command service dhcp-server show leases main | grep 10.0.0.6
at DUT0
and check if output contains the following tokens:
10:00:00:00:00:01Show output
10.0.0.6 10:00:00:00:00:01 2024/10/07 13:10:32 2024/10/07 13:10:36 2024/10/07 13:10:32
Step 6: Modify the following configuration lines in DUT0
:
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 options one-lease-per-client
Step 7: Run command service dhcp-server show leases main | grep 10.0.0.5
at DUT0
and check if output does not contain the following tokens:
10:00:00:00:00:01
Step 8: Run command service dhcp-server show leases main | grep 10.0.0.6
at DUT0
and check if output contains the following tokens:
10:00:00:00:00:01Show output
10.0.0.6 10:00:00:00:00:01 2024/10/07 13:10:34 2024/10/07 13:10:38 2024/10/07 13:10:34
Step 9: Run command service dhcp-server clear main lease all
at DUT0
.
Step 10: Run command interfaces show detailed
at DUT1
and check if output does not contain the following tokens:
10.0.0.5
Show output
-------------------------------------------------------------------------------------------------------------------- Name Idx IP Address Admin Oper Link MTU Vrf Upper Lower Type Phys addr -------------------------------------------------------------------------------------------------------------------- eth0 2 fe80::dcad:beff:feef:6c20/64 up up up 1500 ethernet de:ad:be:ef:6c:20 eth0.100 320 10.0.0.6/24 up up up 1500 eth0 ethernet 10:00:00:00:00:01 fe80::dcad:beff:feef:6c20/64 eth0.200 321 10.0.0.6/24 up up up 1500 eth0 ethernet 10:00:00:00:00:01 fe80::dcad:beff:feef:6c20/64 eth1 3 down down down 1500 ethernet de:ad:be:ef:6c:21
Step 11: Run command interfaces show detailed
at DUT1
and check if output contains the following tokens:
10.0.0.6
Show output
-------------------------------------------------------------------------------------------------------------------- Name Idx IP Address Admin Oper Link MTU Vrf Upper Lower Type Phys addr -------------------------------------------------------------------------------------------------------------------- eth0 2 fe80::dcad:beff:feef:6c20/64 up up up 1500 ethernet de:ad:be:ef:6c:20 eth0.100 320 10.0.0.6/24 up up up 1500 eth0 ethernet 10:00:00:00:00:01 fe80::dcad:beff:feef:6c20/64 eth0.200 321 10.0.0.6/24 up up up 1500 eth0 ethernet 10:00:00:00:00:01 fe80::dcad:beff:feef:6c20/64 eth1 3 down down down 1500 ethernet de:ad:be:ef:6c:21
Test One Lease Per Client VRF
Description
This scenario checks the one-lease-per-client
option for DHCP-server, but it is configured with VRF instead of regular interfaces.
It first checks whether there are 2 simultaneous leases for the same client. When the option is enabled, it checks there are no
two active leases for the same client at the same time.
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 200 address 10.0.0.2/24 set interfaces ethernet eth0 vif 200 vrf VRF0 set interfaces ethernet eth1 address 10.215.168.64/24 set service dhcp-server shared-network dhcp local-vrf VRF0 set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 options lease 4 set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 options max-lease 4 set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.6 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 vif 100 mac '10:00:00:00:00:01' set interfaces ethernet eth0 vif 200 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 vif 100 address dhcp set interfaces ethernet eth0 vif 200 address dhcp
Warning
If you do not see changes after enabling the options, refresh all your interfaces
Step 4: Run command service dhcp-server show leases VRF0 | grep 10.0.0.5
at DUT0
and check if output contains the following tokens:
10:00:00:00:00:01Show output
10.0.0.5 10:00:00:00:00:01 2020/11/08 08:43:51
Step 5: Run command service dhcp-server show leases VRF0 | grep 10.0.0.6
at DUT0
and check if output contains the following tokens:
10:00:00:00:00:01Show output
10.0.0.6 10:00:00:00:00:01 2024/10/07 13:10:50 2024/10/07 13:10:54 2024/10/07 13:10:50
Step 6: Modify the following configuration lines in DUT0
:
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 options one-lease-per-client
Step 7: Run command service dhcp-server show leases VRF0 | grep 10.0.0.5
at DUT0
and check if output does not contain the following tokens:
10:00:00:00:00:01
Step 8: Run command service dhcp-server show leases VRF0 | grep 10.0.0.6
at DUT0
and check if output contains the following tokens:
10:00:00:00:00:01Show output
10.0.0.6 10:00:00:00:00:01 2024/10/07 13:10:52 2024/10/07 13:10:56 2024/10/07 13:10:52
Step 9: Run command service dhcp-server clear VRF0 lease all
at DUT0
.
Step 10: Run command interfaces show detailed
at DUT1
and check if output does not contain the following tokens:
10.0.0.5
Show output
-------------------------------------------------------------------------------------------------------------------- Name Idx IP Address Admin Oper Link MTU Vrf Upper Lower Type Phys addr -------------------------------------------------------------------------------------------------------------------- eth0 2 fe80::dcad:beff:feef:6c20/64 up up up 1500 ethernet de:ad:be:ef:6c:20 eth0.100 322 10.0.0.6/24 up up up 1500 eth0 ethernet 10:00:00:00:00:01 fe80::dcad:beff:feef:6c20/64 eth0.200 323 10.0.0.6/24 up up up 1500 eth0 ethernet 10:00:00:00:00:01 fe80::dcad:beff:feef:6c20/64 eth1 3 down down down 1500 ethernet de:ad:be:ef:6c:21
Step 11: Run command interfaces show detailed
at DUT1
and check if output contains the following tokens:
10.0.0.6
Show output
-------------------------------------------------------------------------------------------------------------------- Name Idx IP Address Admin Oper Link MTU Vrf Upper Lower Type Phys addr -------------------------------------------------------------------------------------------------------------------- eth0 2 fe80::dcad:beff:feef:6c20/64 up up up 1500 ethernet de:ad:be:ef:6c:20 eth0.100 322 10.0.0.6/24 up up up 1500 eth0 ethernet 10:00:00:00:00:01 fe80::dcad:beff:feef:6c20/64 eth0.200 323 10.0.0.6/24 up up up 1500 eth0 ethernet 10:00:00:00:00:01 fe80::dcad:beff:feef:6c20/64 eth1 3 down down down 1500 ethernet de:ad:be:ef:6c:21