Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
Check your router manual. –  Rinzwind Jan 24 at 11:09
    
I want to do it in Ubuntu. Is it possible? –  Ask Jan 24 at 11:10
    
The mac tag is about Macintosh computers... –  Eero Aaltonen Jan 24 at 11:52
    
The tag is about Macintosh computers, see taginfo –  Eero Aaltonen Jan 27 at 11:44
    
@EeroAaltonen Ok i got you –  Ask Jan 27 at 11:51

1 Answer 1

up vote 3 down vote accepted

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.