Local-Vrf

This scenario checks the behaviour of a DHCP server configured with VRF.

Test DHCP-Server Multi Instance Over VRF’s

Description

This scenario checks DHCP server with multiple VRF’s. We have 2 different interfaces with 2 different VRF asking for leases and 2 different shared networks with VRF. After setting the configurations, this scenario checks both clients have received his lease and then checks if both instances of DHCP server has 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 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 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:20  2024/02/26 18:58:20  2024/02/27 06:58:20  2024/02/26 18:58:20

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:20  2024/02/26 18:58:19  2024/02/27 06:58:19  2024/02/26 18:58:19

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