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 10 13:24:00.761881 osdx cfgd[1455]: [393881]Completed change to active configuration
Mar 10 13:24:00.762358 osdx dhcpd[395594]: Wrote 0 leases to leases file.
Mar 10 13:24:00.789194 osdx OSDxCLI[393881]: User 'admin' committed the configuration.
Mar 10 13:24:00.818941 osdx OSDxCLI[393881]: User 'admin' left the configuration menu.
Mar 10 13:24:00.823516 osdx dhcpd[395594]: Server starting service.
Mar 10 13:24:00.949483 osdx OSDxCLI[393881]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 10 13:24:01.560499 osdx dhcpd[395594]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Mar 10 13:24:02.561213 osdx dhcpd[395594]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
Mar 10 13:24:02.604184 osdx dhcpd[395594]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Mar 10 13:24:02.604209 osdx dhcpd[395594]: 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 10 13:24:03.732784 osdx systemd-journald[51744]: Runtime Journal (/run/log/journal/3fdd2a0ddf0a4f0d80cd50f7e198c3e6) is 2.0M, max 15.3M, 13.3M free.
Mar 10 13:24:03.735381 osdx systemd-journald[51744]: Received client request to rotate journal, rotating.
Mar 10 13:24:03.735425 osdx systemd-journald[51744]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3fdd2a0ddf0a4f0d80cd50f7e198c3e6.
Mar 10 13:24:03.742208 osdx OSDxCLI[393881]: 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 10 13:24:03.732784 osdx systemd-journald[51744]: Runtime Journal (/run/log/journal/3fdd2a0ddf0a4f0d80cd50f7e198c3e6) is 2.0M, max 15.3M, 13.3M free.
Mar 10 13:24:03.735381 osdx systemd-journald[51744]: Received client request to rotate journal, rotating.
Mar 10 13:24:03.735425 osdx systemd-journald[51744]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3fdd2a0ddf0a4f0d80cd50f7e198c3e6.
Mar 10 13:24:03.742208 osdx OSDxCLI[393881]: User 'admin' executed a new command: 'system journal clear'.
Mar 10 13:24:03.828507 osdx OSDxCLI[393881]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 10 13:24:03.894511 osdx OSDxCLI[393881]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 10 13:24:04.696165 osdx dhcpd[395647]: 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 10 13:24:05.740282 osdx dhcpd[395647]: 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/03/10 13:24:08  2025/03/11 01:24:08  2025/03/10 13:24:08

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 10 13:24:15.028318 osdx cfgd[1455]: [393881]Completed change to active configuration
Mar 10 13:24:15.029703 osdx dhcpd[395956]: Wrote 0 leases to leases file.
Mar 10 13:24:15.054549 osdx OSDxCLI[393881]: User 'admin' committed the configuration.
Mar 10 13:24:15.071226 osdx OSDxCLI[393881]: User 'admin' left the configuration menu.
Mar 10 13:24:15.098439 osdx dhcpd[395956]: Server starting service.
Mar 10 13:24:15.213910 osdx OSDxCLI[393881]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 10 13:24:15.482945 osdx dhcpd[395956]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Mar 10 13:24:16.483148 osdx dhcpd[395956]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0
Mar 10 13:24:16.534625 osdx dhcpd[395956]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Mar 10 13:24:16.534648 osdx dhcpd[395956]: 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 10 13:24:17.941468 osdx systemd-journald[51744]: Runtime Journal (/run/log/journal/3fdd2a0ddf0a4f0d80cd50f7e198c3e6) is 2.0M, max 15.3M, 13.3M free.
Mar 10 13:24:17.942340 osdx systemd-journald[51744]: Received client request to rotate journal, rotating.
Mar 10 13:24:17.942376 osdx systemd-journald[51744]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3fdd2a0ddf0a4f0d80cd50f7e198c3e6.
Mar 10 13:24:17.951192 osdx OSDxCLI[393881]: 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 10 13:24:17.941468 osdx systemd-journald[51744]: Runtime Journal (/run/log/journal/3fdd2a0ddf0a4f0d80cd50f7e198c3e6) is 2.0M, max 15.3M, 13.3M free.
Mar 10 13:24:17.942340 osdx systemd-journald[51744]: Received client request to rotate journal, rotating.
Mar 10 13:24:17.942376 osdx systemd-journald[51744]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3fdd2a0ddf0a4f0d80cd50f7e198c3e6.
Mar 10 13:24:17.951192 osdx OSDxCLI[393881]: User 'admin' executed a new command: 'system journal clear'.
Mar 10 13:24:18.015590 osdx OSDxCLI[393881]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 10 13:24:18.132010 osdx OSDxCLI[393881]: User 'admin' executed a new command: 'system journal show | tail'.
Mar 10 13:24:18.634517 osdx dhcpd[396006]: 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 10 13:24:19.682698 osdx dhcpd[396006]: 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/03/10 13:24:22  2025/03/11 01:24:22  2025/03/10 13:24:22