Local-Vrf
This scenario checks how a DHCP server configured with VRF behaves.
Test DHCP-Server Multi Instance Over VRF’s
Description
This scenario applies to a DHCP server with multiple VRFs. We have 2 different interfaces with 2 different VRFs asking for leases, and 2 different shared networks with VRF. After setting the configuration, this scenario checks both clients have received the lease and verifies whether both DHCP server instances have leased the IP address.
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 VRF0
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 2025/01/10 12:45:28 2025/01/11 00:45:28 2025/01/10 12:45:28
Step 6: Run command service dhcp-server show leases VRF1
at DUT0
and check if output contains the following tokens:
11.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 2025/01/10 12:45:28 2025/01/11 00:45:28 2025/01/10 12:45:28
Step 7: Run command service dhcp-server show stats VRF0
at DUT0
and expect this output:
Show output
------------------------------------------------------- Instance Total leases Active leases Available leases ------------------------------------------------------- VRF0 1 1 0
Step 8: Run command service dhcp-server show stats VRF1
at DUT0
and expect this output:
Show output
------------------------------------------------------- Instance Total leases Active leases Available leases ------------------------------------------------------- VRF1 1 1 0