Bash script to determine from client if MAC filtering is enabled

Prerequisite install arping

ctrl+alt+t

sudo apt install -y arping

make script executable after creating the file

chmod +x mac_filt_test.sh

This is the script

#!/bin/bash

# Get the active network interface
interface=$(ip route | awk '/default/ {print $5}')

# Send an ARP request to a random IP address on the network using the active interface
arping -I $interface $(ip route | awk '/default/ {print $3}' | cut -d"." -f1-3).1

# Check if the ARP request is successful
if [ $? -eq 0 ]; then
  echo "ARP request successful. MAC address filtering may not be enabled."
else
  echo "ARP request failed. MAC address filtering may be enabled."
fi