Multiple-Interfaces

Test suite to validate DHCP client operation on multiple VLAN interfaces simultaneously.

This suite tests a common production scenario where a router has multiple VLAN interfaces (VIFs) on the same physical interface, each configured to obtain an IP address via DHCP from independent DHCP servers (or different subnets on the same server).

Note: Due to the test environment topology where all physical interfaces share the same switch/broadcast domain, we use VLANs (802.1Q) to create separate L2 domains for proper DHCP isolation.

Key scenarios verified: - Both VLAN interfaces successfully obtain IPs from different subnets - Each VLAN interface maintains its own independent DHCP lease - Both interfaces receive their respective default routes - Routing table correctly handles multiple default gateways (with metrics) - DHCP renewals and releases work independently per VLAN interface

This is critical for: - Multi-WAN scenarios with VLAN trunking - Network segmentation with DHCP per VLAN - Management VLAN + data VLAN configurations

Test Simultaneous DHCP on Two Interfaces

Description

This scenario verifies that a DHCP client can successfully obtain IP addresses on two VLAN interfaces (VIFs) simultaneously from independent DHCP servers (or different subnets). Each VLAN interface should: - Obtain an IP in the correct subnet range - Receive its respective default router - Maintain independent lease files - Appear in the DHCP client lease list

This is a fundamental multi-VLAN scenario used in production for dual-WAN setups with VLAN trunking, management VLANs, or network segmentation.

Configuration: - Server VLAN 100: 192.168.10.1/24, DHCP pool 192.168.10.50-60 - Server VLAN 101: 192.168.20.1/24, DHCP pool 192.168.20.50-60 - Client VLAN 100: DHCP (should get 192.168.10.x) - Client VLAN 101: DHCP (should get 192.168.20.x)

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 192.168.10.1/24
set interfaces ethernet eth0 vif 101 address 192.168.20.1/24
set service dhcp-server shared-network net1 subnet 192.168.10.0/24 options default-router 192.168.10.1
set service dhcp-server shared-network net1 subnet 192.168.10.0/24 start 192.168.10.50 stop 192.168.10.60
set service dhcp-server shared-network net2 subnet 192.168.20.0/24 options default-router 192.168.20.1
set service dhcp-server shared-network net2 subnet 192.168.20.0/24 start 192.168.20.50 stop 192.168.20.60
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 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:

192.168.10.
Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
eth0.100  192.168.10.50/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:

192.168.20.
Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
eth0.101  192.168.20.50/24              up     up
          fe80::dcad:beff:feef:6c10/64

Step 5: Run command service dhcp-client show leases at DUT1 and expect this output:

Show output
Interface:     eth2
IP address:
Subnet mask:
Routers:
Name-servers:
Domain-name:
NTP servers:
DHCP server:
Lease time:
Expiry date:
Reason:        RELEASE


Interface:     eth0
IP address:
Subnet mask:
Routers:
Name-servers:
Domain-name:
NTP servers:
DHCP server:
Lease time:
Expiry date:
Reason:        RELEASE


Interface:     eth0.100
IP address:    192.168.10.50
Subnet mask:   255.255.255.0
Routers:       192.168.10.1
Name-servers:
Domain-name:
NTP servers:
DHCP server:   192.168.10.1
Lease time:    43200
Expiry date:   Fri Mar 06 09:01:43 2026
Reason:        BOUND


Interface:     eth0.102
IP address:
Subnet mask:
Routers:
Name-servers:
Domain-name:
NTP servers:
DHCP server:
Lease time:
Expiry date:
Reason:        RELEASE


Interface:     eth0.101
IP address:    192.168.20.50
Subnet mask:   255.255.255.0
Routers:       192.168.20.1
Name-servers:
Domain-name:
NTP servers:
DHCP server:   192.168.20.1
Lease time:    43200
Expiry date:   Fri Mar 06 09:01:43 2026
Reason:        BOUND

Test Independent Lease Management

Description

This scenario verifies that DHCP leases on multiple interfaces are managed independently. When one interface releases its DHCP lease, the other interface should remain unaffected and maintain its active lease and IP address.

This ensures that the DHCP client implementation correctly handles per-interface lease state and doesn’t interfere with other interfaces during operations like release, renew, or configuration changes.

Test flow: 1. Both interfaces obtain DHCP leases 2. Release lease on first interface only 3. Verify first interface loses IP 4. Verify second interface maintains its IP (unaffected) 5. Re-enable DHCP on first interface 6. Verify both interfaces have active leases again

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 192.168.10.1/24
set interfaces ethernet eth0 vif 101 address 192.168.20.1/24
set service dhcp-server shared-network net1 subnet 192.168.10.0/24 options default-router 192.168.10.1
set service dhcp-server shared-network net1 subnet 192.168.10.0/24 start 192.168.10.50 stop 192.168.10.60
set service dhcp-server shared-network net2 subnet 192.168.20.0/24 options default-router 192.168.20.1
set service dhcp-server shared-network net2 subnet 192.168.20.0/24 start 192.168.20.50 stop 192.168.20.60
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 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:

192.168.10.
Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
eth0.100  192.168.10.50/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:

192.168.20.
Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
eth0.101  192.168.20.50/24              up     up
          fe80::dcad:beff:feef:6c10/64

Step 5: Run command interfaces ethernet eth0 vif 100 show at DUT1 and expect this output:

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

Step 6: Run command interfaces ethernet eth0 vif 101 show at DUT1 and expect this output:

Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
eth0.101  192.168.20.50/24              up     up
          fe80::dcad:beff:feef:6c10/64

Step 7: Modify the following configuration lines in DUT1 :

delete interfaces ethernet eth0 vif 100

Step 8: Run command interfaces show detailed at DUT1 and expect this output:

Show output
--------------------------------------------------------------------------------------------------------------------
  Name    Idx           IP Address           Admin  Oper  Link  MTU   Vrf  Upper  Lower    Type        Phys addr
--------------------------------------------------------------------------------------------------------------------
    eth0  2    fe80::dcad:beff:feef:6c10/64  up     up    up    1500                     ethernet  de:ad:be:ef:6c:10
eth0.101  708  192.168.20.50/24              up     up    up    1500              eth0   ethernet  de:ad:be:ef:6c:10
               fe80::dcad:beff:feef:6c10/64
    eth1  3                                  down   down  down  1500                     ethernet  de:ad:be:ef:6c:11
    eth2  4                                  down   down  down  1500                     ethernet  de:ad:be:ef:6c:12
    eth3  5                                  down   down  down  1500                     ethernet  de:ad:be:ef:6c:13

Step 9: Run command interfaces ethernet eth0 vif 101 show at DUT1 and check if output contains the following tokens:

192.168.20.50
Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
eth0.101  192.168.20.50/24              up     up
          fe80::dcad:beff:feef:6c10/64

Step 10: Modify the following configuration lines in DUT1 :

set interfaces ethernet eth0 vif 100 address dhcp

Step 11: Run command interfaces ethernet eth0 vif 100 show at DUT1 and check if output contains the following tokens:

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

Step 12: Run command interfaces ethernet eth0 vif 101 show at DUT1 and check if output contains the following tokens:

192.168.20.50
Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
eth0.101  192.168.20.50/24              up     up
          fe80::dcad:beff:feef:6c10/64

Test Multiple Default Routes with Metrics

Description

This scenario verifies that when multiple VLAN interfaces on the same physical interface receive default routes via DHCP, the routing table correctly handles both routes. The kernel may use ECMP (Equal-Cost Multi-Path) to create a single default route with multiple nexthops, or install separate routes with different metrics.

When both VLANs are on the same physical interface, Linux typically creates an ECMP route with multiple nexthops instead of separate routes. This allows load balancing across both gateways.

Expected behavior (ECMP scenario): - Single default route with multiple nexthops - Both gateways (192.168.10.1 and 192.168.20.1) appear as nexthops - Both VLAN interfaces appear in the routing table - Traffic can use either gateway for load balancing

This test verifies the routing table structure includes both gateways, regardless of whether they appear as separate routes or ECMP nexthops.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 192.168.10.1/24
set interfaces ethernet eth0 vif 101 address 192.168.20.1/24
set service dhcp-server shared-network net1 subnet 192.168.10.0/24 options default-router 192.168.10.1
set service dhcp-server shared-network net1 subnet 192.168.10.0/24 start 192.168.10.50 stop 192.168.10.60
set service dhcp-server shared-network net2 subnet 192.168.20.0/24 options default-router 192.168.20.1
set service dhcp-server shared-network net2 subnet 192.168.20.0/24 start 192.168.20.50 stop 192.168.20.60
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 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:

192.168.10.
Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
eth0.100  192.168.10.50/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:

192.168.20.
Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
eth0.101  192.168.20.50/24              up     up
          fe80::dcad:beff:feef:6c10/64

Step 5: Run command protocols ip show route at DUT1 and expect this output:

Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
S>* 0.0.0.0/0 [1/0] via 192.168.10.1, eth0.100, weight 1, 00:00:01
  *                 via 192.168.20.1, eth0.101, weight 1, 00:00:01
L   10.215.168.21/32 is directly connected, eth0 inactive, weight 1, 01:28:35
C>* 192.168.10.0/24 is directly connected, eth0.100, weight 1, 00:00:01
K * 192.168.10.0/24 [0/0] is directly connected, eth0.100, weight 1, 00:00:01
L>* 192.168.10.50/32 is directly connected, eth0.100, weight 1, 00:00:01
C>* 192.168.20.0/24 is directly connected, eth0.101, weight 1, 00:00:01
K * 192.168.20.0/24 [0/0] is directly connected, eth0.101, weight 1, 00:00:01
L>* 192.168.20.50/32 is directly connected, eth0.101, weight 1, 00:00:01

Step 6: Ping IP address 192.168.10.1 from DUT1:

admin@DUT1$ ping 192.168.10.1 count 1 size 56 timeout 1
Show output
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=0.284 ms

--- 192.168.10.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.284/0.284/0.284/0.000 ms