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
Jun 23 09:07:30.084318 osdx OSDxCLI[281947]: User 'admin' added a new cfg line: 'show working'. Jun 23 09:07:30.181681 osdx INFO[283859]: FRR daemons did not change Jun 23 09:07:30.201704 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Jun 23 09:07:30.329963 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main". Jun 23 09:07:30.332164 osdx cfgd[1453]: [281947]Completed change to active configuration Jun 23 09:07:30.332973 osdx dhcpd[283928]: Wrote 0 leases to leases file. Jun 23 09:07:30.367529 osdx OSDxCLI[281947]: User 'admin' committed the configuration. Jun 23 09:07:30.391716 osdx OSDxCLI[281947]: User 'admin' left the configuration menu. Jun 23 09:07:30.409788 osdx dhcpd[283928]: Server starting service. Jun 23 09:07:30.502233 osdx dhcpd[283928]: DHCPDISCOVER from 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
Jun 23 09:07:31.150803 osdx systemd-journald[1747]: Runtime Journal (/run/log/journal/76ff399027db4a3db160ed8651bac52f) is 2.1M, max 15.3M, 13.2M free. Jun 23 09:07:31.153699 osdx systemd-journald[1747]: Received client request to rotate journal, rotating. Jun 23 09:07:31.153757 osdx systemd-journald[1747]: Vacuuming done, freed 0B of archived journals from /run/log/journal/76ff399027db4a3db160ed8651bac52f. Jun 23 09:07:31.160252 osdx OSDxCLI[281947]: 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 23 09:07:31.150803 osdx systemd-journald[1747]: Runtime Journal (/run/log/journal/76ff399027db4a3db160ed8651bac52f) is 2.1M, max 15.3M, 13.2M free. Jun 23 09:07:31.153699 osdx systemd-journald[1747]: Received client request to rotate journal, rotating. Jun 23 09:07:31.153757 osdx systemd-journald[1747]: Vacuuming done, freed 0B of archived journals from /run/log/journal/76ff399027db4a3db160ed8651bac52f. Jun 23 09:07:31.160252 osdx OSDxCLI[281947]: User 'admin' executed a new command: 'system journal clear'. Jun 23 09:07:31.225278 osdx OSDxCLI[281947]: User 'admin' executed a new command: 'system journal show | tail'. Jun 23 09:07:31.342641 osdx OSDxCLI[281947]: User 'admin' executed a new command: 'system journal show | tail'. Jun 23 09:07:31.554260 osdx dhcpd[283973]: 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 23 09:07:32.702047 osdx dhcpd[283973]: 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:05Show output
10.0.0.5 10:00:00:00:00:05 2025/06/23 09:07:35 2025/06/23 21:07:35 2025/06/23 09:07:35
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
Jun 23 09:07:43.634079 osdx cfgd[1453]: [281947]Completed change to active configuration Jun 23 09:07:43.634929 osdx dhcpd[284261]: Wrote 0 leases to leases file. Jun 23 09:07:43.668271 osdx OSDxCLI[281947]: User 'admin' committed the configuration. Jun 23 09:07:43.680320 osdx dhcpd[284261]: Server starting service. Jun 23 09:07:43.686379 osdx OSDxCLI[281947]: User 'admin' left the configuration menu. Jun 23 09:07:43.830093 osdx OSDxCLI[281947]: User 'admin' executed a new command: 'system journal show | tail'. Jun 23 09:07:44.132378 osdx dhcpd[284261]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Jun 23 09:07:45.132989 osdx dhcpd[284261]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Jun 23 09:07:45.176106 osdx dhcpd[284261]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Jun 23 09:07:45.176129 osdx dhcpd[284261]: 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
Jun 23 09:07:46.641333 osdx systemd-journald[1747]: Runtime Journal (/run/log/journal/76ff399027db4a3db160ed8651bac52f) is 2.0M, max 15.3M, 13.3M free. Jun 23 09:07:46.644175 osdx systemd-journald[1747]: Received client request to rotate journal, rotating. Jun 23 09:07:46.644234 osdx systemd-journald[1747]: Vacuuming done, freed 0B of archived journals from /run/log/journal/76ff399027db4a3db160ed8651bac52f. Jun 23 09:07:46.652515 osdx OSDxCLI[281947]: 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 23 09:07:46.641333 osdx systemd-journald[1747]: Runtime Journal (/run/log/journal/76ff399027db4a3db160ed8651bac52f) is 2.0M, max 15.3M, 13.3M free. Jun 23 09:07:46.644175 osdx systemd-journald[1747]: Received client request to rotate journal, rotating. Jun 23 09:07:46.644234 osdx systemd-journald[1747]: Vacuuming done, freed 0B of archived journals from /run/log/journal/76ff399027db4a3db160ed8651bac52f. Jun 23 09:07:46.652515 osdx OSDxCLI[281947]: User 'admin' executed a new command: 'system journal clear'. Jun 23 09:07:46.730782 osdx OSDxCLI[281947]: User 'admin' executed a new command: 'system journal show | tail'. Jun 23 09:07:46.800526 osdx OSDxCLI[281947]: User 'admin' executed a new command: 'system journal show | tail'. Jun 23 09:07:47.276133 osdx dhcpd[284313]: 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 23 09:07:48.332350 osdx dhcpd[284313]: 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:05Show output
10.0.0.5 10:00:00:00:00:05 2025/06/23 09:07:51 2025/06/23 21:07:51 2025/06/23 09:07:51