Link to home
Start Free TrialLog in
Avatar of rajasekarramasamy
rajasekarramasamyFlag for India

asked on

Block list of client based on MAC address using IPTables

I want to block list of client who accessing the port TCP 8080.  Blocking based on MAC address. I having MAC details in text file. It possible to give the MAC input to iptables from a text file?
Avatar of tty2
tty2
Flag of Ukraine image

while read i; do iptables -A INPUT -p tcp -m tcp --dport 8080 -m mac --mac-source "$i" -j DROP; done < mac_list.txt
Avatar of rajasekarramasamy

ASKER

Hi tty2,

 where should i put this script?
ASKER CERTIFIED SOLUTION
Avatar of tty2
tty2
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial