Check-Mac-Address
These scenarios show how the feature
check-mac-address
works for 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 and see if there are warnings in your logs.
Also, this test check the server’s behaviour in regular 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
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
Oct 09 08:28:14.387174 osdx OSDxCLI[25194]: User 'admin' added a new cfg line: 'set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5'. Oct 09 08:28:14.483349 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Oct 09 08:28:14.545917 osdx systemd[1]: Started "DHCP Server Service instance main". Oct 09 08:28:14.548275 osdx cfgd[1327]: [25194]Completed change to active configuration Oct 09 08:28:14.550550 osdx OSDxCLI[25194]: User 'admin' committed the configuration. Oct 09 08:28:14.551818 osdx dhcpd[29514]: Wrote 0 leases to leases file. Oct 09 08:28:14.583557 osdx OSDxCLI[25194]: User 'admin' left the configuration menu. Oct 09 08:28:14.607516 osdx dhcpd[29514]: Server starting service. Oct 09 08:28:14.710445 osdx OSDxCLI[25194]: User 'admin' executed a new command: 'system journal show | tail'. Oct 09 08:28:15.618332 osdx dhcpd[29514]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Step 3: Set the following configuration 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
-- Logs begin at Wed 2024-10-09 08:28:16 UTC, end at Wed 2024-10-09 08:28:16 UTC. -- Oct 09 08:28:16.303760 osdx systemd-journald[5179]: Runtime journal (/run/log/journal/7b13f98cf6974d34b6af66a5ac8a2ed7) is 2.0M, max 16.0M, 14.0M free. Oct 09 08:28:16.313006 osdx OSDxCLI[25194]: 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
-- Logs begin at Wed 2024-10-09 08:28:16 UTC, end at Wed 2024-10-09 08:28:16 UTC. -- Oct 09 08:28:16.303760 osdx systemd-journald[5179]: Runtime journal (/run/log/journal/7b13f98cf6974d34b6af66a5ac8a2ed7) is 2.0M, max 16.0M, 14.0M free. Oct 09 08:28:16.313006 osdx OSDxCLI[25194]: User 'admin' executed a new command: 'system journal clear'. Oct 09 08:28:16.368951 osdx OSDxCLI[25194]: User 'admin' executed a new command: 'system journal show | tail'. Oct 09 08:28:16.464710 osdx OSDxCLI[25194]: User 'admin' executed a new command: 'system journal show | tail'. Oct 09 08:28:16.654262 osdx dhcpd[29556]: 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 eth0 mac 10:00:00:00:00:05
Step 8: Set the following configuration in DUT1
:
set interfaces 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:6c20/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/10/09 08:28:19 2024/10/09 20:28:19 2024/10/09 08:28:19
Test Check MAC Address VRF
Description
This scenario configures a DHCP server with VRF instead of regular interfaces and checks the option check-mac-address
.
To check this option you will need to send packets with differences in Source MAC for link layer and the client MAC from the application layer.
Scenario
Step 1: Set the following configuration in DUT0
:
set interfaces eth0 address 10.0.0.1/24 set interfaces 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 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
Oct 09 08:28:24.649834 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Oct 09 08:28:24.689824 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Oct 09 08:28:24.724719 osdx systemd[1]: Started "DHCP Server Service instance VRF0". Oct 09 08:28:24.726626 osdx cfgd[1327]: [25194]Completed change to active configuration Oct 09 08:28:24.729037 osdx OSDxCLI[25194]: User 'admin' committed the configuration. Oct 09 08:28:24.731270 osdx dhcpd[29870]: Wrote 0 leases to leases file. Oct 09 08:28:24.744605 osdx OSDxCLI[25194]: User 'admin' left the configuration menu. Oct 09 08:28:24.798201 osdx dhcpd[29870]: Server starting service. Oct 09 08:28:24.872943 osdx OSDxCLI[25194]: User 'admin' executed a new command: 'system journal show | tail'. Oct 09 08:28:25.340680 osdx dhcpd[29870]: DHCPDISCOVER from 10:00:00:00:00:02 via eth0
Step 3: Set the following configuration 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
-- Logs begin at Wed 2024-10-09 08:28:26 UTC, end at Wed 2024-10-09 08:28:26 UTC. -- Oct 09 08:28:26.410457 osdx systemd-journald[5179]: Runtime journal (/run/log/journal/7b13f98cf6974d34b6af66a5ac8a2ed7) is 2.0M, max 16.0M, 14.0M free. Oct 09 08:28:26.438737 osdx OSDxCLI[25194]: 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
-- Logs begin at Wed 2024-10-09 08:28:26 UTC, end at Wed 2024-10-09 08:28:27 UTC. -- Oct 09 08:28:26.410457 osdx systemd-journald[5179]: Runtime journal (/run/log/journal/7b13f98cf6974d34b6af66a5ac8a2ed7) is 2.0M, max 16.0M, 14.0M free. Oct 09 08:28:26.438737 osdx OSDxCLI[25194]: User 'admin' executed a new command: 'system journal clear'. Oct 09 08:28:26.503575 osdx OSDxCLI[25194]: User 'admin' executed a new command: 'system journal show | tail'. Oct 09 08:28:26.603783 osdx OSDxCLI[25194]: User 'admin' executed a new command: 'system journal show | tail'. Oct 09 08:28:27.432504 osdx dhcpd[29912]: 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 eth0 mac 10:00:00:00:00:05
Step 8: Set the following configuration in DUT1
:
set interfaces 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:6c20/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/10/09 08:28:29 2024/10/09 20:28:29 2024/10/09 08:28:29