Blocking specific MAC address from contacting me
5,994
You can drop from a source MAC address, yeah:
sudo iptables -A INPUT -m mac --mac-source 00:00:00:00:00:AA -j DROP
Obviously, you'll need to change that address.
If you want to make that permanent, make sure ufw
is installed and then edit /etc/ufw/before.rules
to have something like this before the COMMIT:
-A ufw-before-input -m mac --mac-source 00:00:00:00:00:AA -j DROP
Related videos on Youtube
Comments
-
Maythux over 1 year
Could I block a specific MAC address on my LAN from contacting me?
I know I could do it from router or switch.
But I wanna learn if it is possible in Ubuntu(Linux) commands.
-
Rinzwind over 10 yearsCheck your router manual.
-
Maythux over 10 yearsI want to do it in Ubuntu. Is it possible?
-
Eero Aaltonen over 10 yearsThe
mac
tag is about Macintosh computers... -
Eero Aaltonen over 10 yearsThe tag is about Macintosh computers, see taginfo
-
Maythux over 10 years@EeroAaltonen Ok i got you
-
-
tanius about 6 yearsAnd if your machine has other iptables rules set up (e.g. configured as a router), then to function, the
DROP
rule has to be before them in the list, to take precedence. Then use-I INPUT
("insert at pos 1"), not-A INPUT
("append").