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
Sep 05 09:56:03.370574 osdx cfgd[1461]: [2038]Completed change to active configuration Sep 05 09:56:03.381672 osdx OSDxCLI[2038]: User 'admin' committed the configuration. Sep 05 09:56:03.411983 osdx OSDxCLI[2038]: User 'admin' left the configuration menu. Sep 05 09:56:03.437445 osdx dhcpd[169651]: Wrote 0 leases to leases file. Sep 05 09:56:03.512613 osdx dhcpd[169651]: Server starting service. Sep 05 09:56:03.567251 osdx OSDxCLI[2038]: User 'admin' executed a new command: 'system journal show | tail'. Sep 05 09:56:04.215594 osdx dhcpd[169651]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Sep 05 09:56:05.215885 osdx dhcpd[169651]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Sep 05 09:56:05.259507 osdx dhcpd[169651]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Sep 05 09:56:05.259530 osdx dhcpd[169651]: 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
Sep 05 09:56:06.318605 osdx systemd-journald[1764]: Runtime Journal (/run/log/journal/8e652e5518b84f0bb5a60f6ad502329f) is 1.9M, max 13.8M, 11.8M free. Sep 05 09:56:06.320461 osdx systemd-journald[1764]: Received client request to rotate journal, rotating. Sep 05 09:56:06.320521 osdx systemd-journald[1764]: Vacuuming done, freed 0B of archived journals from /run/log/journal/8e652e5518b84f0bb5a60f6ad502329f. Sep 05 09:56:06.328967 osdx OSDxCLI[2038]: 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
Sep 05 09:56:06.318605 osdx systemd-journald[1764]: Runtime Journal (/run/log/journal/8e652e5518b84f0bb5a60f6ad502329f) is 1.9M, max 13.8M, 11.8M free. Sep 05 09:56:06.320461 osdx systemd-journald[1764]: Received client request to rotate journal, rotating. Sep 05 09:56:06.320521 osdx systemd-journald[1764]: Vacuuming done, freed 0B of archived journals from /run/log/journal/8e652e5518b84f0bb5a60f6ad502329f. Sep 05 09:56:06.328967 osdx OSDxCLI[2038]: User 'admin' executed a new command: 'system journal clear'. Sep 05 09:56:06.395356 osdx OSDxCLI[2038]: User 'admin' executed a new command: 'system journal show | tail'. Sep 05 09:56:06.492171 osdx OSDxCLI[2038]: User 'admin' executed a new command: 'system journal show | tail'. Sep 05 09:56:07.351498 osdx dhcpd[169708]: 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) Sep 05 09:56:08.403592 osdx dhcpd[169708]: 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.5
Show 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 2025/09/05 09:56:10 2025/09/05 21:56:10 2025/09/05 09:56:10
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
Sep 05 09:56:17.632137 osdx cfgd[1461]: [2038]Completed change to active configuration Sep 05 09:56:17.634468 osdx dhcpd[170056]: Wrote 0 leases to leases file. Sep 05 09:56:17.650486 osdx OSDxCLI[2038]: User 'admin' committed the configuration. Sep 05 09:56:17.667561 osdx OSDxCLI[2038]: User 'admin' left the configuration menu. Sep 05 09:56:17.675739 osdx dhcpd[170056]: Server starting service. Sep 05 09:56:17.815037 osdx OSDxCLI[2038]: User 'admin' executed a new command: 'system journal show | tail'. Sep 05 09:56:18.066304 osdx dhcpd[170056]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Sep 05 09:56:19.067045 osdx dhcpd[170056]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Sep 05 09:56:19.138551 osdx dhcpd[170056]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Sep 05 09:56:19.138577 osdx dhcpd[170056]: 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
Sep 05 09:56:20.628206 osdx systemd-journald[1764]: Runtime Journal (/run/log/journal/8e652e5518b84f0bb5a60f6ad502329f) is 1.8M, max 13.8M, 11.9M free. Sep 05 09:56:20.631625 osdx systemd-journald[1764]: Received client request to rotate journal, rotating. Sep 05 09:56:20.631689 osdx systemd-journald[1764]: Vacuuming done, freed 0B of archived journals from /run/log/journal/8e652e5518b84f0bb5a60f6ad502329f. Sep 05 09:56:20.638996 osdx OSDxCLI[2038]: 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
Sep 05 09:56:20.628206 osdx systemd-journald[1764]: Runtime Journal (/run/log/journal/8e652e5518b84f0bb5a60f6ad502329f) is 1.8M, max 13.8M, 11.9M free. Sep 05 09:56:20.631625 osdx systemd-journald[1764]: Received client request to rotate journal, rotating. Sep 05 09:56:20.631689 osdx systemd-journald[1764]: Vacuuming done, freed 0B of archived journals from /run/log/journal/8e652e5518b84f0bb5a60f6ad502329f. Sep 05 09:56:20.638996 osdx OSDxCLI[2038]: User 'admin' executed a new command: 'system journal clear'. Sep 05 09:56:20.714177 osdx OSDxCLI[2038]: User 'admin' executed a new command: 'system journal show | tail'. Sep 05 09:56:20.780581 osdx OSDxCLI[2038]: User 'admin' executed a new command: 'system journal show | tail'. Sep 05 09:56:21.258153 osdx dhcpd[170112]: 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) Sep 05 09:56:22.298105 osdx dhcpd[170112]: 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.5
Show 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 2025/09/05 09:56:25 2025/09/05 21:56:25 2025/09/05 09:56:25