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
Mar 20 11:59:49.469946 osdx cfgd[1833]: [449014]Completed change to active configuration
Mar 20 11:59:49.471551 osdx dhcpd[487814]: Wrote 0 leases to leases file.
Mar 20 11:59:49.483172 osdx OSDxCLI[449014]: User 'admin' committed the configuration.
Mar 20 11:59:49.497970 osdx OSDxCLI[449014]: User 'admin' left the configuration menu.
Mar 20 11:59:49.523429 osdx dhcpd[487814]: Server starting service.
Mar 20 11:59:49.638789 osdx OSDxCLI[449014]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 20 11:59:50.483355 osdx dhcpd[487814]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Mar 20 11:59:51.484468 osdx dhcpd[487814]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
Mar 20 11:59:51.523323 osdx dhcpd[487814]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Mar 20 11:59:51.523347 osdx dhcpd[487814]: 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
Mar 20 11:59:52.300841 osdx systemd-journald[2054]: Runtime Journal (/run/log/journal/ba147585e3944580985006d3d45a280a) is 2.3M, max 17.2M, 14.8M free.
Mar 20 11:59:52.303287 osdx systemd-journald[2054]: Received client request to rotate journal, rotating.
Mar 20 11:59:52.303347 osdx systemd-journald[2054]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ba147585e3944580985006d3d45a280a.
Mar 20 11:59:52.312562 osdx OSDxCLI[449014]: 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 20 11:59:52.300841 osdx systemd-journald[2054]: Runtime Journal (/run/log/journal/ba147585e3944580985006d3d45a280a) is 2.3M, max 17.2M, 14.8M free.
Mar 20 11:59:52.303287 osdx systemd-journald[2054]: Received client request to rotate journal, rotating.
Mar 20 11:59:52.303347 osdx systemd-journald[2054]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ba147585e3944580985006d3d45a280a.
Mar 20 11:59:52.312562 osdx OSDxCLI[449014]: User 'admin' executed a new command: 'system journal clear'.
Mar 20 11:59:52.378011 osdx OSDxCLI[449014]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 20 11:59:52.479586 osdx OSDxCLI[449014]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 20 11:59:52.563325 osdx dhcpd[487870]: 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 20 11:59:53.608103 osdx dhcpd[487870]: 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/03/20 11:59:56  2026/03/20 23:59:56  2026/03/20 11:59:56

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
Mar 20 12:00:03.825756 osdx cfgd[1833]: [449014]Completed change to active configuration
Mar 20 12:00:03.826793 osdx dhcpd[488252]: Wrote 0 leases to leases file.
Mar 20 12:00:03.839017 osdx OSDxCLI[449014]: User 'admin' committed the configuration.
Mar 20 12:00:03.854835 osdx OSDxCLI[449014]: User 'admin' left the configuration menu.
Mar 20 12:00:03.872264 osdx dhcpd[488252]: Server starting service.
Mar 20 12:00:04.001446 osdx OSDxCLI[449014]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 20 12:00:04.392009 osdx dhcpd[488252]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Mar 20 12:00:05.392266 osdx dhcpd[488252]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
Mar 20 12:00:05.479673 osdx dhcpd[488252]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Mar 20 12:00:05.479698 osdx dhcpd[488252]: 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
Mar 20 12:00:06.755906 osdx systemd-journald[2054]: Runtime Journal (/run/log/journal/ba147585e3944580985006d3d45a280a) is 2.2M, max 17.2M, 14.9M free.
Mar 20 12:00:06.756408 osdx systemd-journald[2054]: Received client request to rotate journal, rotating.
Mar 20 12:00:06.756439 osdx systemd-journald[2054]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ba147585e3944580985006d3d45a280a.
Mar 20 12:00:06.767383 osdx OSDxCLI[449014]: 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 20 12:00:06.755906 osdx systemd-journald[2054]: Runtime Journal (/run/log/journal/ba147585e3944580985006d3d45a280a) is 2.2M, max 17.2M, 14.9M free.
Mar 20 12:00:06.756408 osdx systemd-journald[2054]: Received client request to rotate journal, rotating.
Mar 20 12:00:06.756439 osdx systemd-journald[2054]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ba147585e3944580985006d3d45a280a.
Mar 20 12:00:06.767383 osdx OSDxCLI[449014]: User 'admin' executed a new command: 'system journal clear'.
Mar 20 12:00:06.834537 osdx OSDxCLI[449014]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 20 12:00:06.938099 osdx OSDxCLI[449014]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 20 12:00:07.579569 osdx dhcpd[488308]: 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 20 12:00:08.639611 osdx dhcpd[488308]: 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/03/20 12:00:11  2026/03/21 00:00:11  2026/03/20 12:00:11