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
Oct 10 22:09:41.428239 osdx cfgd[1464]: [438858]Completed change to active configuration Oct 10 22:09:41.429668 osdx dhcpd[446173]: Wrote 0 leases to leases file. Oct 10 22:09:41.441021 osdx OSDxCLI[438858]: User 'admin' committed the configuration. Oct 10 22:09:41.456356 osdx OSDxCLI[438858]: User 'admin' left the configuration menu. Oct 10 22:09:41.466866 osdx dhcpd[446173]: Server starting service. Oct 10 22:09:41.605842 osdx OSDxCLI[438858]: User 'admin' executed a new command: 'system journal show | tail'. Oct 10 22:09:42.167068 osdx dhcpd[446173]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Oct 10 22:09:43.168054 osdx dhcpd[446173]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Oct 10 22:09:43.255110 osdx dhcpd[446173]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Oct 10 22:09:43.255136 osdx dhcpd[446173]: 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
Oct 10 22:09:44.251005 osdx systemd-journald[246736]: Runtime Journal (/run/log/journal/d6792964fe7547c9a60a3d774aa97dac) is 1.8M, max 13.8M, 11.9M free. Oct 10 22:09:44.254759 osdx systemd-journald[246736]: Received client request to rotate journal, rotating. Oct 10 22:09:44.254827 osdx systemd-journald[246736]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d6792964fe7547c9a60a3d774aa97dac. Oct 10 22:09:44.260438 osdx OSDxCLI[438858]: 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
Oct 10 22:09:44.251005 osdx systemd-journald[246736]: Runtime Journal (/run/log/journal/d6792964fe7547c9a60a3d774aa97dac) is 1.8M, max 13.8M, 11.9M free. Oct 10 22:09:44.254759 osdx systemd-journald[246736]: Received client request to rotate journal, rotating. Oct 10 22:09:44.254827 osdx systemd-journald[246736]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d6792964fe7547c9a60a3d774aa97dac. Oct 10 22:09:44.260438 osdx OSDxCLI[438858]: User 'admin' executed a new command: 'system journal clear'. Oct 10 22:09:44.323281 osdx OSDxCLI[438858]: User 'admin' executed a new command: 'system journal show | tail'. Oct 10 22:09:44.330798 osdx dhcpd[446229]: 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 2025/10/10 22:09:46 2025/10/11 10:09:46 2025/10/10 22:09:46
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
Oct 10 22:09:53.644712 osdx cfgd[1464]: [438858]Completed change to active configuration Oct 10 22:09:53.645559 osdx dhcpd[446580]: Wrote 0 leases to leases file. Oct 10 22:09:53.657720 osdx OSDxCLI[438858]: User 'admin' committed the configuration. Oct 10 22:09:53.672995 osdx OSDxCLI[438858]: User 'admin' left the configuration menu. Oct 10 22:09:53.683287 osdx dhcpd[446580]: Server starting service. Oct 10 22:09:53.805182 osdx OSDxCLI[438858]: User 'admin' executed a new command: 'system journal show | tail'. Oct 10 22:09:54.158764 osdx dhcpd[446580]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Oct 10 22:09:55.159408 osdx dhcpd[446580]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Oct 10 22:09:55.210884 osdx dhcpd[446580]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Oct 10 22:09:55.210918 osdx dhcpd[446580]: 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
Oct 10 22:09:56.530996 osdx systemd-journald[246736]: Runtime Journal (/run/log/journal/d6792964fe7547c9a60a3d774aa97dac) is 1.8M, max 13.8M, 11.9M free. Oct 10 22:09:56.531600 osdx systemd-journald[246736]: Received client request to rotate journal, rotating. Oct 10 22:09:56.531643 osdx systemd-journald[246736]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d6792964fe7547c9a60a3d774aa97dac. Oct 10 22:09:56.542377 osdx OSDxCLI[438858]: 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
Oct 10 22:09:56.530996 osdx systemd-journald[246736]: Runtime Journal (/run/log/journal/d6792964fe7547c9a60a3d774aa97dac) is 1.8M, max 13.8M, 11.9M free. Oct 10 22:09:56.531600 osdx systemd-journald[246736]: Received client request to rotate journal, rotating. Oct 10 22:09:56.531643 osdx systemd-journald[246736]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d6792964fe7547c9a60a3d774aa97dac. Oct 10 22:09:56.542377 osdx OSDxCLI[438858]: User 'admin' executed a new command: 'system journal clear'. Oct 10 22:09:56.605736 osdx OSDxCLI[438858]: User 'admin' executed a new command: 'system journal show | tail'. Oct 10 22:09:56.700996 osdx OSDxCLI[438858]: User 'admin' executed a new command: 'system journal show | tail'. Oct 10 22:09:57.302889 osdx dhcpd[446636]: 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) Oct 10 22:09:58.358766 osdx dhcpd[446636]: 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 2025/10/10 22:10:00 2025/10/11 10:10:00 2025/10/10 22:10:00