Question

Is it possible to programmatically block MAC addresses on Linux that are stored in a file?

No correct solution

OTHER TIPS

You can block traffic from specific MAC addresses using iptables. If the MACs are in a file macs.txt, you can add iptables rules to drop them with the bash one-liner:

while read mac; do iptables -I INPUT -m mac --mac-source $mac -j DROP; done < macs.txt
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top