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
May 19 16:32:41.670638 osdx cfgd[1649]: [298507]Completed change to active configuration
May 19 16:32:41.672457 osdx dhcpd[302169]: Wrote 0 leases to leases file.
May 19 16:32:41.700087 osdx OSDxCLI[298507]: User 'admin' committed the configuration.
May 19 16:32:41.720000 osdx dhcpd[302169]: Server starting service.
May 19 16:32:41.730503 osdx OSDxCLI[298507]: User 'admin' left the configuration menu.
May 19 16:32:41.867176 osdx OSDxCLI[298507]: User 'admin' executed a new command: 'system journal show | tail'.
May 19 16:32:42.094575 osdx dhcpd[302169]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
May 19 16:32:43.094986 osdx dhcpd[302169]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
May 19 16:32:43.134388 osdx dhcpd[302169]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
May 19 16:32:43.134412 osdx dhcpd[302169]: 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
May 19 16:32:44.556570 osdx systemd-journald[1859]: Runtime Journal (/run/log/journal/dd53a6d251524eaf96fe5f49da605cd5) is 2.0M, max 15.3M, 13.2M free.
May 19 16:32:44.559766 osdx systemd-journald[1859]: Received client request to rotate journal, rotating.
May 19 16:32:44.559825 osdx systemd-journald[1859]: Vacuuming done, freed 0B of archived journals from /run/log/journal/dd53a6d251524eaf96fe5f49da605cd5.
May 19 16:32:44.566061 osdx OSDxCLI[298507]: 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
May 19 16:32:44.556570 osdx systemd-journald[1859]: Runtime Journal (/run/log/journal/dd53a6d251524eaf96fe5f49da605cd5) is 2.0M, max 15.3M, 13.2M free.
May 19 16:32:44.559766 osdx systemd-journald[1859]: Received client request to rotate journal, rotating.
May 19 16:32:44.559825 osdx systemd-journald[1859]: Vacuuming done, freed 0B of archived journals from /run/log/journal/dd53a6d251524eaf96fe5f49da605cd5.
May 19 16:32:44.566061 osdx OSDxCLI[298507]: User 'admin' executed a new command: 'system journal clear'.
May 19 16:32:44.632128 osdx OSDxCLI[298507]: User 'admin' executed a new command: 'system journal show | tail'.
May 19 16:32:44.741207 osdx OSDxCLI[298507]: User 'admin' executed a new command: 'system journal show | tail'.
May 19 16:32:45.230386 osdx dhcpd[302219]: 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)
May 19 16:32:46.262445 osdx dhcpd[302219]: 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  2025/05/19 16:32:48  2025/05/20 04:32:48  2025/05/19 16:32:48

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
May 19 16:32:57.109121 osdx cfgd[1649]: [298507]Completed change to active configuration
May 19 16:32:57.110858 osdx dhcpd[302517]: Wrote 0 leases to leases file.
May 19 16:32:57.135125 osdx OSDxCLI[298507]: User 'admin' committed the configuration.
May 19 16:32:57.163548 osdx dhcpd[302517]: Server starting service.
May 19 16:32:57.165756 osdx OSDxCLI[298507]: User 'admin' left the configuration menu.
May 19 16:32:57.312072 osdx OSDxCLI[298507]: User 'admin' executed a new command: 'system journal show | tail'.
May 19 16:32:57.577939 osdx dhcpd[302517]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
May 19 16:32:58.578621 osdx dhcpd[302517]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
May 19 16:32:58.645804 osdx dhcpd[302517]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
May 19 16:32:58.645831 osdx dhcpd[302517]: 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
May 19 16:33:00.040796 osdx systemd-journald[1859]: Runtime Journal (/run/log/journal/dd53a6d251524eaf96fe5f49da605cd5) is 2.0M, max 15.3M, 13.3M free.
May 19 16:33:00.043403 osdx systemd-journald[1859]: Received client request to rotate journal, rotating.
May 19 16:33:00.043459 osdx systemd-journald[1859]: Vacuuming done, freed 0B of archived journals from /run/log/journal/dd53a6d251524eaf96fe5f49da605cd5.
May 19 16:33:00.051606 osdx OSDxCLI[298507]: 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
May 19 16:33:00.040796 osdx systemd-journald[1859]: Runtime Journal (/run/log/journal/dd53a6d251524eaf96fe5f49da605cd5) is 2.0M, max 15.3M, 13.3M free.
May 19 16:33:00.043403 osdx systemd-journald[1859]: Received client request to rotate journal, rotating.
May 19 16:33:00.043459 osdx systemd-journald[1859]: Vacuuming done, freed 0B of archived journals from /run/log/journal/dd53a6d251524eaf96fe5f49da605cd5.
May 19 16:33:00.051606 osdx OSDxCLI[298507]: User 'admin' executed a new command: 'system journal clear'.
May 19 16:33:00.123966 osdx OSDxCLI[298507]: User 'admin' executed a new command: 'system journal show | tail'.
May 19 16:33:00.226934 osdx OSDxCLI[298507]: User 'admin' executed a new command: 'system journal show | tail'.
May 19 16:33:00.773599 osdx dhcpd[302567]: 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)
May 19 16:33:01.825578 osdx dhcpd[302567]: 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  2025/05/19 16:33:04  2025/05/20 04:33:04  2025/05/19 16:33:04