Created
November 11, 2021 07:02
-
-
Save webdevsuperfast/c55a34a4b3ad3d557e0a98a914b99a45 to your computer and use it in GitHub Desktop.
OpenWRT IPTables block devices based on MAC Address
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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