Fallback

Test suite to validate DHCP client IP fallback functionality.

When DHCP fails to obtain an IP address, the client can be configured with a fallback static IP address that will be used temporarily until DHCP becomes available again.

This test suite verifies that: - Fallback IP is applied when DHCP server is unreachable - Fallback IP is removed when DHCP succeeds - Fallback works with VRF - Fallback works with VLAN interfaces

Test DHCP Fallback to Static IP

Description

This scenario checks that when DHCP server is unavailable, the client applies the configured fallback IP address. This ensures the interface has connectivity even without DHCP. This is a single-DUT test (DUT0 only) - no server needed.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 dhcp client fallback 10.95.0.99/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Run command interfaces ethernet eth0 show at DUT0 and expect this output:

Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.95.0.99/24                 up     up
      fe80::dcad:beff:feef:6c00/64

Test DHCP Fallback with VRF

Description

This scenario checks that DHCP fallback works correctly when the interface is in a VRF (Virtual Routing and Forwarding) context. This is a single-DUT test (DUT0 only) - no server needed.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 dhcp client fallback 10.95.0.99/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Run command interfaces ethernet eth0 show at DUT0 and expect this output:

Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.95.0.99/24                 up     up
      fe80::dcad:beff:feef:6c00/64

Test DHCP Fallback with VLAN

Description

This scenario checks that DHCP fallback works correctly on VLAN sub-interfaces (VIF). This is a single-DUT test (DUT0 only) - no server needed.

Scenario

Step 1: Set the following configuration in DUT0 :

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

Step 2: Run command interfaces ethernet eth0 vif 100 show at DUT0 and expect this output:

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

Test DHCP No Fallback When Server Available

Description

This scenario checks that fallback IP is NOT applied when DHCP server is available from the beginning. We verify that DHCP IP is obtained successfully. NOTE: There may be a race condition where fallback briefly appears before DHCP completes - this test focuses on DHCP success.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.95.0.1/24
set service dhcp-server shared-network dhcp subnet 10.95.0.0/24 start 10.95.0.5 stop 10.95.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 interfaces ethernet eth0 dhcp client fallback 10.95.0.99/24
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.95.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.95.0.5/24                  up     up
      fe80::dcad:beff:feef:6c10/64