.. _example_service_dhcp-client_custom-mac: ########## Custom-Mac ########## Test suite to validate DHCP client with custom MAC address configuration. This test suite verifies that custom MAC addresses are correctly applied to interfaces before starting the DHCP client, ensuring that: - VLAN interfaces inherit parent MAC correctly - VLAN interfaces with own MAC work correctly - Physical interfaces with custom MAC work correctly - Bridge interfaces with custom MAC work correctly - Runtime MAC changes restart DHCP client properly - Removing MAC configuration works correctly - Default MAC operation is not affected ************************************* Test VLAN Inherits Parent MAC on Boot ************************************* Description =========== This test verifies that a VLAN interface correctly inherits and applies the custom MAC configured on its parent interface during boot. When a parent interface has a custom MAC, VLAN sub-interfaces should inherit that MAC address and use it for DHCP operations. Configuration: - set interfaces ethernet eth0 mac '10:00:00:00:00:10' - set interfaces ethernet eth0 vif 100 address dhcp Expected behavior: - eth0.100 uses MAC 10:00:00:00:00:10 (inherited from parent) - DHCP client starts with correct MAC - DHCP server receives requests with custom MAC - Client obtains IP successfully - Packet capture confirms MAC in DHCP packets Scenario ======== .. include:: custom-mac/testvlaninheritsparentmaconboot .. raw:: html
*********************************** Test Physical Interface MAC on Boot *********************************** Description =========== This test verifies that a physical interface with custom MAC correctly applies the MAC before starting DHCP client. Configuration: - set interfaces ethernet eth0 mac '10:00:00:00:00:30' - set interfaces ethernet eth0 address dhcp Expected behavior: - eth0 boots with custom MAC 10:00:00:00:00:30 - DHCP client starts with correct MAC - Client obtains IP successfully - Packet capture confirms MAC in DHCP packets Scenario ======== .. include:: custom-mac/testphysicalinterfacemaconboot .. raw:: html
********************************* Test Bridge Interface MAC on Boot ********************************* Description =========== This test verifies that a bridge interface with custom MAC correctly applies the MAC before starting DHCP client. A bridge interface can have an explicit MAC address configured, which should be applied before the DHCP client starts, ensuring that DHCP requests are sent with the correct MAC address. Configuration: - set interfaces ethernet eth1 bridge-group bridge br0 - set interfaces bridge br0 mac '10:00:00:00:00:40' - set interfaces bridge br0 address dhcp Expected behavior: - br0 boots with custom MAC 10:00:00:00:00:40 - DHCP client starts with correct MAC - DHCP server receives requests with custom MAC - Client obtains IP successfully - Packet capture confirms MAC in DHCP packets Scenario ======== .. include:: custom-mac/testbridgeinterfacemaconboot .. raw:: html