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
Apr 10 20:26:39.063959 osdx cfgd[1682]: [464358]Completed change to active configuration Apr 10 20:26:39.065701 osdx dhcpd[470717]: Wrote 0 leases to leases file. Apr 10 20:26:39.075570 osdx OSDxCLI[464358]: User 'admin' committed the configuration. Apr 10 20:26:39.097971 osdx dhcpd[470717]: Server starting service. Apr 10 20:26:39.112843 osdx OSDxCLI[464358]: User 'admin' left the configuration menu. Apr 10 20:26:39.252521 osdx OSDxCLI[464358]: User 'admin' executed a new command: 'system journal show | tail'. Apr 10 20:26:39.873653 osdx dhcpd[470717]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Apr 10 20:26:40.874383 osdx dhcpd[470717]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Apr 10 20:26:40.941340 osdx dhcpd[470717]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Apr 10 20:26:40.941368 osdx dhcpd[470717]: 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
Apr 10 20:26:42.099115 osdx systemd-journald[55338]: Runtime Journal (/run/log/journal/5c505a9749274d37b6c4605b7d8c5dbf) is 2.0M, max 15.3M, 13.3M free. Apr 10 20:26:42.101887 osdx systemd-journald[55338]: Received client request to rotate journal, rotating. Apr 10 20:26:42.101955 osdx systemd-journald[55338]: Vacuuming done, freed 0B of archived journals from /run/log/journal/5c505a9749274d37b6c4605b7d8c5dbf. Apr 10 20:26:42.112157 osdx OSDxCLI[464358]: 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
Apr 10 20:26:42.099115 osdx systemd-journald[55338]: Runtime Journal (/run/log/journal/5c505a9749274d37b6c4605b7d8c5dbf) is 2.0M, max 15.3M, 13.3M free. Apr 10 20:26:42.101887 osdx systemd-journald[55338]: Received client request to rotate journal, rotating. Apr 10 20:26:42.101955 osdx systemd-journald[55338]: Vacuuming done, freed 0B of archived journals from /run/log/journal/5c505a9749274d37b6c4605b7d8c5dbf. Apr 10 20:26:42.112157 osdx OSDxCLI[464358]: User 'admin' executed a new command: 'system journal clear'. Apr 10 20:26:42.180137 osdx OSDxCLI[464358]: User 'admin' executed a new command: 'system journal show | tail'. Apr 10 20:26:42.308732 osdx OSDxCLI[464358]: User 'admin' executed a new command: 'system journal show | tail'. Apr 10 20:26:43.073254 osdx dhcpd[470773]: 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) Apr 10 20:26:44.117277 osdx dhcpd[470773]: 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/04/10 20:26:46 2025/04/11 08:26:46 2025/04/10 20:26:46
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
Apr 10 20:26:55.088775 osdx cfgd[1682]: [464358]Completed change to active configuration Apr 10 20:26:55.090915 osdx dhcpd[471127]: Wrote 0 leases to leases file. Apr 10 20:26:55.103278 osdx OSDxCLI[464358]: User 'admin' committed the configuration. Apr 10 20:26:55.122960 osdx dhcpd[471127]: Server starting service. Apr 10 20:26:55.132157 osdx OSDxCLI[464358]: User 'admin' left the configuration menu. Apr 10 20:26:55.275036 osdx OSDxCLI[464358]: User 'admin' executed a new command: 'system journal show | tail'. Apr 10 20:26:55.517752 osdx dhcpd[471127]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Apr 10 20:26:56.518375 osdx dhcpd[471127]: DHCPOFFER on 10.0.0.5 to 10:00:00:00:00:02 via eth0 Apr 10 20:26:56.565641 osdx dhcpd[471127]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0 Apr 10 20:26:56.565661 osdx dhcpd[471127]: 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
Apr 10 20:26:58.086912 osdx systemd-journald[55338]: Runtime Journal (/run/log/journal/5c505a9749274d37b6c4605b7d8c5dbf) is 2.0M, max 15.3M, 13.3M free. Apr 10 20:26:58.090825 osdx systemd-journald[55338]: Received client request to rotate journal, rotating. Apr 10 20:26:58.090887 osdx systemd-journald[55338]: Vacuuming done, freed 0B of archived journals from /run/log/journal/5c505a9749274d37b6c4605b7d8c5dbf. Apr 10 20:26:58.098580 osdx OSDxCLI[464358]: 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
Apr 10 20:26:58.086912 osdx systemd-journald[55338]: Runtime Journal (/run/log/journal/5c505a9749274d37b6c4605b7d8c5dbf) is 2.0M, max 15.3M, 13.3M free. Apr 10 20:26:58.090825 osdx systemd-journald[55338]: Received client request to rotate journal, rotating. Apr 10 20:26:58.090887 osdx systemd-journald[55338]: Vacuuming done, freed 0B of archived journals from /run/log/journal/5c505a9749274d37b6c4605b7d8c5dbf. Apr 10 20:26:58.098580 osdx OSDxCLI[464358]: User 'admin' executed a new command: 'system journal clear'. Apr 10 20:26:58.163779 osdx OSDxCLI[464358]: User 'admin' executed a new command: 'system journal show | tail'. Apr 10 20:26:58.284763 osdx OSDxCLI[464358]: User 'admin' executed a new command: 'system journal show | tail'. Apr 10 20:26:58.657627 osdx dhcpd[471183]: 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) Apr 10 20:26:59.709630 osdx dhcpd[471183]: 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/04/10 20:27:02 2025/04/11 08:27:02 2025/04/10 20:27:02