Check-Mac-Address
These scenarios show how the
check-mac-address feature works for the DHCP server
Test Check MAC Address
Description
The check-mac-address option filters packets if there are differences between the MAC address found at the ethernet header and the MAC address found in the DHCP packet.
To check this option, you should send packets with these differences and enable this option to see if warnings appear in your logs.
Also, this test checks how the server behaves under normal conditions.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.0.0.1/24 set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Run command system journal show | tail at DUT0 and check if output contains the following tokens:
DHCPDISCOVER from 10:00:00:00:00:02 via eth0Show output
Mar 05 20:35:24.482461 osdx cfgd[1863]: [750942]Completed change to active configuration Mar 05 20:35:24.483100 osdx dhcpd[812867]: Wrote 0 leases to leases file. Mar 05 20:35:24.494547 osdx OSDxCLI[750942]: User 'admin' committed the configuration. Mar 05 20:35:24.512472 osdx OSDxCLI[750942]: User 'admin' left the configuration menu. Mar 05 20:35:24.532727 osdx dhcpd[812867]: Server starting service. Mar 05 20:35:24.663749 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal show | tail'. Mar 05 20:35:25.466829 osdx dhcpd[812867]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Mar 05 20:35:26.467421 osdx dhcpd[812867]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Mar 05 20:35:26.522654 osdx dhcpd[812867]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Mar 05 20:35:26.522683 osdx dhcpd[812867]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
Step 3: Modify the following configuration lines in DUT0 :
set service dhcp-server check-mac-address
Step 4: Run command system journal clear at DUT0.
Step 5: Run command system journal show | tail at DUT0 and check if output does not contain the following tokens:
DHCPDISCOVER from 10:00:00:00:00:02 via eth0Show output
Mar 05 20:35:27.406176 osdx systemd-journald[466780]: Runtime Journal (/run/log/journal/78445f9299f9414990e66dc8aa510838) is 1.8M, max 13.8M, 11.9M free. Mar 05 20:35:27.408586 osdx systemd-journald[466780]: Received client request to rotate journal, rotating. Mar 05 20:35:27.408630 osdx systemd-journald[466780]: Vacuuming done, freed 0B of archived journals from /run/log/journal/78445f9299f9414990e66dc8aa510838. Mar 05 20:35:27.416299 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal clear'.
Step 6: Run command system journal show | tail at DUT0 and check if output contains the following tokens:
MAC received in DHCP packet (10:00:00:00:00:02) is different than source MAC in ethernet header (10:00:00:00:00:01)Show output
Mar 05 20:35:27.406176 osdx systemd-journald[466780]: Runtime Journal (/run/log/journal/78445f9299f9414990e66dc8aa510838) is 1.8M, max 13.8M, 11.9M free. Mar 05 20:35:27.408586 osdx systemd-journald[466780]: Received client request to rotate journal, rotating. Mar 05 20:35:27.408630 osdx systemd-journald[466780]: Vacuuming done, freed 0B of archived journals from /run/log/journal/78445f9299f9414990e66dc8aa510838. Mar 05 20:35:27.416299 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal clear'. Mar 05 20:35:27.489537 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal show | tail'. Mar 05 20:35:27.565435 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal show | tail'. Mar 05 20:35:27.566650 osdx dhcpd[812923]: MAC received in DHCP packet (10:00:00:00:00:02) is different than source MAC in ethernet header (10:00:00:00:00:01) Mar 05 20:35:28.610694 osdx dhcpd[812923]: MAC received in DHCP packet (10:00:00:00:00:02) is different than source MAC in ethernet header (10:00:00:00:00:01) Mar 05 20:35:29.658569 osdx dhcpd[812923]: MAC received in DHCP packet (10:00:00:00:00:02) is different than source MAC in ethernet header (10:00:00:00:00:01)
Step 7: Set the following configuration in DUT1 :
set interfaces ethernet eth0 mac '10:00:00:00:00:05' set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 8: Modify the following configuration lines in DUT1 :
set interfaces ethernet eth0 address dhcp
Step 9: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
10.0.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 10: Run command service dhcp-server show leases main | grep 10.0.0.5 at DUT0 and check if output contains the following tokens:
10:00:00:00:00:05Show output
10.0.0.5 10:00:00:00:00:05 2026/03/05 20:35:31 2026/03/06 08:35:31 2026/03/05 20:35:31
Test Check MAC Address VRF
Description
This scenario configures a DHCP server with VRF instead of regular interfaces and checks the check-mac-address option.
To check this option, you will need to send packets with differences in the Source MAC for the link layer and the client MAC from the application layer.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.0.0.1/24 set interfaces ethernet eth0 vrf VRF0 set service dhcp-server shared-network dhcp local-vrf VRF0 set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.6 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set system vrf VRF0
Step 2: Run command system journal show | tail at DUT0 and check if output contains the following tokens:
DHCPDISCOVER from 10:00:00:00:00:02 via eth0Show output
Mar 05 20:35:38.839414 osdx cfgd[1863]: [750942]Completed change to active configuration Mar 05 20:35:38.840596 osdx dhcpd[813301]: Wrote 0 leases to leases file. Mar 05 20:35:38.852783 osdx OSDxCLI[750942]: User 'admin' committed the configuration. Mar 05 20:35:38.874338 osdx OSDxCLI[750942]: User 'admin' left the configuration menu. Mar 05 20:35:38.885519 osdx dhcpd[813301]: Server starting service. Mar 05 20:35:39.050716 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal show | tail'. Mar 05 20:35:39.355202 osdx dhcpd[813301]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Mar 05 20:35:40.356228 osdx dhcpd[813301]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Mar 05 20:35:40.439032 osdx dhcpd[813301]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Mar 05 20:35:40.439065 osdx dhcpd[813301]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
Step 3: Modify the following configuration lines in DUT0 :
set service dhcp-server check-mac-address
Step 4: Run command system journal clear at DUT0.
Step 5: Run command system journal show | tail at DUT0 and check if output does not contain the following tokens:
DHCPDISCOVER from 10:00:00:00:00:02 via eth0Show output
Mar 05 20:35:41.808643 osdx systemd-journald[466780]: Runtime Journal (/run/log/journal/78445f9299f9414990e66dc8aa510838) is 1.8M, max 13.8M, 11.9M free. Mar 05 20:35:41.809394 osdx systemd-journald[466780]: Received client request to rotate journal, rotating. Mar 05 20:35:41.809436 osdx systemd-journald[466780]: Vacuuming done, freed 0B of archived journals from /run/log/journal/78445f9299f9414990e66dc8aa510838. Mar 05 20:35:41.818165 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal clear'.
Step 6: Run command system journal show | tail at DUT0 and check if output contains the following tokens:
MAC received in DHCP packet (10:00:00:00:00:02) is different than source MAC in ethernet header (10:00:00:00:00:01)Show output
Mar 05 20:35:41.808643 osdx systemd-journald[466780]: Runtime Journal (/run/log/journal/78445f9299f9414990e66dc8aa510838) is 1.8M, max 13.8M, 11.9M free. Mar 05 20:35:41.809394 osdx systemd-journald[466780]: Received client request to rotate journal, rotating. Mar 05 20:35:41.809436 osdx systemd-journald[466780]: Vacuuming done, freed 0B of archived journals from /run/log/journal/78445f9299f9414990e66dc8aa510838. Mar 05 20:35:41.818165 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal clear'. Mar 05 20:35:41.879982 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal show | tail'. Mar 05 20:35:41.989388 osdx OSDxCLI[750942]: User 'admin' executed a new command: 'system journal show | tail'. Mar 05 20:35:42.542941 osdx dhcpd[813357]: MAC received in DHCP packet (10:00:00:00:00:02) is different than source MAC in ethernet header (10:00:00:00:00:01) Mar 05 20:35:43.598861 osdx dhcpd[813357]: MAC received in DHCP packet (10:00:00:00:00:02) is different than source MAC in ethernet header (10:00:00:00:00:01)
Step 7: Set the following configuration in DUT1 :
set interfaces ethernet eth0 mac '10:00:00:00:00:05' set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 8: Modify the following configuration lines in DUT1 :
set interfaces ethernet eth0 address dhcp
Step 9: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:
10.0.0.5Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.5/24 up up fe80::dcad:beff:feef:6c10/64
Step 10: Run command service dhcp-server show leases VRF0 | grep 10.0.0.5 at DUT0 and check if output contains the following tokens:
10:00:00:00:00:05Show output
10.0.0.5 10:00:00:00:00:05 2026/03/05 20:35:46 2026/03/06 08:35:46 2026/03/05 20:35:46