Skip to content

Instantly share code, notes, and snippets.

@webdevsuperfast
Created November 11, 2021 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdevsuperfast/c55a34a4b3ad3d557e0a98a914b99a45 to your computer and use it in GitHub Desktop.
Save webdevsuperfast/c55a34a4b3ad3d557e0a98a914b99a45 to your computer and use it in GitHub Desktop.
OpenWRT IPTables block devices based on MAC Address
#! /bin/sh
# List of MAC Addresses to drop
mac="XX:XX:XX:XX:XX:XX AA:AA:AA:AA:AA:AA"
set -- $mac
# while [ -n "$1" ]; do
while [ $# -gt 0 ]; do
echo "iptables -I FORWARD -m mac --mac-source $1 -j DROP">>/etc/firewall.user
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment