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
Nov 25 09:39:51.418082 osdx cfgd[1655]: [2774]Completed change to active configuration Nov 25 09:39:51.432443 osdx OSDxCLI[2774]: User 'admin' committed the configuration. Nov 25 09:39:51.456590 osdx OSDxCLI[2774]: User 'admin' left the configuration menu. Nov 25 09:39:51.480869 osdx dhcpd[8538]: Wrote 0 leases to leases file. Nov 25 09:39:51.515652 osdx dhcpd[8538]: Server starting service. Nov 25 09:39:51.591947 osdx OSDxCLI[2774]: User 'admin' executed a new command: 'system journal show | tail'. Nov 25 09:39:52.440151 osdx dhcpd[8538]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Nov 25 09:39:53.440553 osdx dhcpd[8538]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Nov 25 09:39:53.488198 osdx dhcpd[8538]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Nov 25 09:39:53.488235 osdx dhcpd[8538]: 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
Nov 25 09:39:54.297591 osdx systemd-journald[1857]: Runtime Journal (/run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32) is 1.8M, max 13.8M, 11.9M free. Nov 25 09:39:54.299532 osdx systemd-journald[1857]: Received client request to rotate journal, rotating. Nov 25 09:39:54.299594 osdx systemd-journald[1857]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32. Nov 25 09:39:54.306855 osdx OSDxCLI[2774]: 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
Nov 25 09:39:54.297591 osdx systemd-journald[1857]: Runtime Journal (/run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32) is 1.8M, max 13.8M, 11.9M free. Nov 25 09:39:54.299532 osdx systemd-journald[1857]: Received client request to rotate journal, rotating. Nov 25 09:39:54.299594 osdx systemd-journald[1857]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32. Nov 25 09:39:54.306855 osdx OSDxCLI[2774]: User 'admin' executed a new command: 'system journal clear'. Nov 25 09:39:54.371695 osdx OSDxCLI[2774]: User 'admin' executed a new command: 'system journal show | tail'. Nov 25 09:39:54.500615 osdx OSDxCLI[2774]: User 'admin' executed a new command: 'system journal show | tail'. Nov 25 09:39:54.539819 osdx dhcpd[8594]: 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) Nov 25 09:39:55.588617 osdx dhcpd[8594]: 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/11/25 09:39:58 2025/11/25 21:39:58 2025/11/25 09:39:58
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
Nov 25 09:40:05.767983 osdx cfgd[1655]: [2774]Completed change to active configuration Nov 25 09:40:05.769185 osdx dhcpd[8943]: Wrote 0 leases to leases file. Nov 25 09:40:05.779507 osdx OSDxCLI[2774]: User 'admin' committed the configuration. Nov 25 09:40:05.806439 osdx OSDxCLI[2774]: User 'admin' left the configuration menu. Nov 25 09:40:05.810376 osdx dhcpd[8943]: Server starting service. Nov 25 09:40:05.945639 osdx OSDxCLI[2774]: User 'admin' executed a new command: 'system journal show | tail'. Nov 25 09:40:06.122163 osdx dhcpd[8943]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Nov 25 09:40:07.122313 osdx dhcpd[8943]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Nov 25 09:40:07.170084 osdx dhcpd[8943]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Nov 25 09:40:07.170113 osdx dhcpd[8943]: 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
Nov 25 09:40:08.679650 osdx systemd-journald[1857]: Runtime Journal (/run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32) is 1.8M, max 13.8M, 11.9M free. Nov 25 09:40:08.682280 osdx systemd-journald[1857]: Received client request to rotate journal, rotating. Nov 25 09:40:08.682341 osdx systemd-journald[1857]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32. Nov 25 09:40:08.691540 osdx OSDxCLI[2774]: 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
Nov 25 09:40:08.679650 osdx systemd-journald[1857]: Runtime Journal (/run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32) is 1.8M, max 13.8M, 11.9M free. Nov 25 09:40:08.682280 osdx systemd-journald[1857]: Received client request to rotate journal, rotating. Nov 25 09:40:08.682341 osdx systemd-journald[1857]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32. Nov 25 09:40:08.691540 osdx OSDxCLI[2774]: User 'admin' executed a new command: 'system journal clear'. Nov 25 09:40:08.758699 osdx OSDxCLI[2774]: User 'admin' executed a new command: 'system journal show | tail'. Nov 25 09:40:08.876532 osdx OSDxCLI[2774]: User 'admin' executed a new command: 'system journal show | tail'. Nov 25 09:40:09.262033 osdx dhcpd[8999]: 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) Nov 25 09:40:10.310084 osdx dhcpd[8999]: 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/11/25 09:40:13 2025/11/25 21:40:13 2025/11/25 09:40:13