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
Dec 04 15:53:58.504892 osdx OSDxCLI[257063]: User 'admin' added a new cfg line: 'show working'. Dec 04 15:53:58.596906 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Dec 04 15:53:58.817358 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main". Dec 04 15:53:58.819007 osdx cfgd[1239]: [257063]Completed change to active configuration Dec 04 15:53:58.820610 osdx dhcpd[259613]: Wrote 0 leases to leases file. Dec 04 15:53:58.858005 osdx OSDxCLI[257063]: User 'admin' committed the configuration. Dec 04 15:53:58.881125 osdx dhcpd[259613]: Server starting service. Dec 04 15:53:58.886687 osdx OSDxCLI[257063]: User 'admin' left the configuration menu. Dec 04 15:53:59.051033 osdx OSDxCLI[257063]: User 'admin' executed a new command: 'system journal show | tail'. Dec 04 15:53:59.237413 osdx dhcpd[259613]: 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
Dec 04 15:54:00.800016 osdx systemd-journald[1574]: Runtime Journal (/run/log/journal/2754912ae611401eb118833e63cf0c07) is 2.0M, max 15.3M, 13.3M free. Dec 04 15:54:00.800891 osdx systemd-journald[1574]: Received client request to rotate journal, rotating. Dec 04 15:54:00.800936 osdx systemd-journald[1574]: Vacuuming done, freed 0B of archived journals from /run/log/journal/2754912ae611401eb118833e63cf0c07. Dec 04 15:54:00.811971 osdx OSDxCLI[257063]: 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
Dec 04 15:54:00.800016 osdx systemd-journald[1574]: Runtime Journal (/run/log/journal/2754912ae611401eb118833e63cf0c07) is 2.0M, max 15.3M, 13.3M free. Dec 04 15:54:00.800891 osdx systemd-journald[1574]: Received client request to rotate journal, rotating. Dec 04 15:54:00.800936 osdx systemd-journald[1574]: Vacuuming done, freed 0B of archived journals from /run/log/journal/2754912ae611401eb118833e63cf0c07. Dec 04 15:54:00.811971 osdx OSDxCLI[257063]: User 'admin' executed a new command: 'system journal clear'. Dec 04 15:54:00.901813 osdx OSDxCLI[257063]: User 'admin' executed a new command: 'system journal show | tail'. Dec 04 15:54:00.999440 osdx OSDxCLI[257063]: User 'admin' executed a new command: 'system journal show | tail'. Dec 04 15:54:01.321271 osdx dhcpd[259658]: 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 2024/12/04 15:54:04 2024/12/05 03:54:04 2024/12/04 15:54:04
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
Dec 04 15:54:09.643092 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Dec 04 15:54:09.711090 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Dec 04 15:54:09.779339 osdx systemd[1]: Started dhcpd@VRF0.service - "DHCP Server Service instance VRF0". Dec 04 15:54:09.780936 osdx cfgd[1239]: [257063]Completed change to active configuration Dec 04 15:54:09.782992 osdx dhcpd[259936]: Wrote 0 leases to leases file. Dec 04 15:54:09.806748 osdx OSDxCLI[257063]: User 'admin' committed the configuration. Dec 04 15:54:09.830343 osdx OSDxCLI[257063]: User 'admin' left the configuration menu. Dec 04 15:54:09.871255 osdx dhcpd[259936]: Server starting service. Dec 04 15:54:09.985151 osdx OSDxCLI[257063]: User 'admin' executed a new command: 'system journal show | tail'. Dec 04 15:54:10.355066 osdx dhcpd[259936]: 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
Dec 04 15:54:11.675411 osdx systemd-journald[1574]: Runtime Journal (/run/log/journal/2754912ae611401eb118833e63cf0c07) is 2.0M, max 15.3M, 13.3M free. Dec 04 15:54:11.679093 osdx systemd-journald[1574]: Received client request to rotate journal, rotating. Dec 04 15:54:11.679152 osdx systemd-journald[1574]: Vacuuming done, freed 0B of archived journals from /run/log/journal/2754912ae611401eb118833e63cf0c07. Dec 04 15:54:11.685427 osdx OSDxCLI[257063]: 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
Dec 04 15:54:11.675411 osdx systemd-journald[1574]: Runtime Journal (/run/log/journal/2754912ae611401eb118833e63cf0c07) is 2.0M, max 15.3M, 13.3M free. Dec 04 15:54:11.679093 osdx systemd-journald[1574]: Received client request to rotate journal, rotating. Dec 04 15:54:11.679152 osdx systemd-journald[1574]: Vacuuming done, freed 0B of archived journals from /run/log/journal/2754912ae611401eb118833e63cf0c07. Dec 04 15:54:11.685427 osdx OSDxCLI[257063]: User 'admin' executed a new command: 'system journal clear'. Dec 04 15:54:11.748717 osdx OSDxCLI[257063]: User 'admin' executed a new command: 'system journal show | tail'. Dec 04 15:54:11.879739 osdx OSDxCLI[257063]: User 'admin' executed a new command: 'system journal show | tail'. Dec 04 15:54:12.450849 osdx dhcpd[259981]: 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 2024/12/04 15:54:15 2024/12/05 03:54:15 2024/12/04 15:54:15