Check-Mac-Address

These scenarios show how the check-mac-address feature works for the DHCP server

../../../_images/check-mac-address.svg

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 eth0
Show output
Jun 04 17:46:34.283433 osdx dhcpd[822987]: Wrote 0 static lease entries.
Jun 04 17:46:34.283441 osdx dhcpd[822987]: Wrote 0 leases to leases file.
Jun 04 17:46:34.293522 osdx OSDxCLI[744826]: User 'admin' committed the configuration.
Jun 04 17:46:34.308387 osdx OSDxCLI[744826]: User 'admin' left the configuration menu.
Jun 04 17:46:34.324411 osdx dhcpd[822987]: Server starting service.
Jun 04 17:46:34.443446 osdx OSDxCLI[744826]: User 'admin' executed a new command: 'system journal show | tail'.
Jun 04 17:46:35.263314 osdx dhcpd[822987]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Jun 04 17:46:36.264194 osdx dhcpd[822987]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
Jun 04 17:46:36.311210 osdx dhcpd[822987]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Jun 04 17:46:36.311241 osdx dhcpd[822987]: 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 eth0
Show output
Jun 04 17:46:37.121432 osdx systemd-journald[172397]: Runtime Journal (/run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4) is 1.8M, max 13.8M, 11.9M free.
Jun 04 17:46:37.124315 osdx systemd-journald[172397]: Received client request to rotate journal, rotating.
Jun 04 17:46:37.124381 osdx systemd-journald[172397]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4.
Jun 04 17:46:37.131057 osdx OSDxCLI[744826]: 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
Jun 04 17:46:37.121432 osdx systemd-journald[172397]: Runtime Journal (/run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4) is 1.8M, max 13.8M, 11.9M free.
Jun 04 17:46:37.124315 osdx systemd-journald[172397]: Received client request to rotate journal, rotating.
Jun 04 17:46:37.124381 osdx systemd-journald[172397]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4.
Jun 04 17:46:37.131057 osdx OSDxCLI[744826]: User 'admin' executed a new command: 'system journal clear'.
Jun 04 17:46:37.195343 osdx OSDxCLI[744826]: User 'admin' executed a new command: 'system journal show | tail'.
Jun 04 17:46:37.300958 osdx OSDxCLI[744826]: User 'admin' executed a new command: 'system journal show | tail'.
Jun 04 17:46:37.407148 osdx dhcpd[823044]: 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)
Jun 04 17:46:38.459154 osdx dhcpd[823044]: 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:05
Show output
10.0.0.5   10:00:00:00:00:05  2026/06/04 17:46:41  2026/06/05 05:46:41  2026/06/04 17:46:41

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 eth0
Show output
Jun 04 17:46:48.688484 osdx dhcpd[823426]: Wrote 0 static lease entries.
Jun 04 17:46:48.688489 osdx dhcpd[823426]: Wrote 0 leases to leases file.
Jun 04 17:46:48.700638 osdx OSDxCLI[744826]: User 'admin' committed the configuration.
Jun 04 17:46:48.715862 osdx OSDxCLI[744826]: User 'admin' left the configuration menu.
Jun 04 17:46:48.729681 osdx dhcpd[823426]: Server starting service.
Jun 04 17:46:48.857945 osdx OSDxCLI[744826]: User 'admin' executed a new command: 'system journal show | tail'.
Jun 04 17:46:49.236045 osdx dhcpd[823426]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Jun 04 17:46:50.236419 osdx dhcpd[823426]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
Jun 04 17:46:50.275824 osdx dhcpd[823426]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Jun 04 17:46:50.275847 osdx dhcpd[823426]: 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 eth0
Show output
Jun 04 17:46:51.663826 osdx systemd-journald[172397]: Runtime Journal (/run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4) is 1.8M, max 13.8M, 11.9M free.
Jun 04 17:46:51.665536 osdx systemd-journald[172397]: Received client request to rotate journal, rotating.
Jun 04 17:46:51.665592 osdx systemd-journald[172397]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4.
Jun 04 17:46:51.674308 osdx OSDxCLI[744826]: 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
Jun 04 17:46:51.663826 osdx systemd-journald[172397]: Runtime Journal (/run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4) is 1.8M, max 13.8M, 11.9M free.
Jun 04 17:46:51.665536 osdx systemd-journald[172397]: Received client request to rotate journal, rotating.
Jun 04 17:46:51.665592 osdx systemd-journald[172397]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4.
Jun 04 17:46:51.674308 osdx OSDxCLI[744826]: User 'admin' executed a new command: 'system journal clear'.
Jun 04 17:46:51.736807 osdx OSDxCLI[744826]: User 'admin' executed a new command: 'system journal show | tail'.
Jun 04 17:46:51.878672 osdx OSDxCLI[744826]: User 'admin' executed a new command: 'system journal show | tail'.
Jun 04 17:46:52.371838 osdx dhcpd[823483]: 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)
Jun 04 17:46:53.411760 osdx dhcpd[823483]: 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:05
Show output
10.0.0.5   10:00:00:00:00:05  2026/06/04 17:46:56  2026/06/05 05:46:56  2026/06/04 17:46:56