Skip to content

Instantly share code, notes, and snippets.

@kakoni
Last active August 30, 2018 10:56
Show Gist options
  • Save kakoni/f21ee1953e827c9a4456cba31cc1e1bd to your computer and use it in GitHub Desktop.
Save kakoni/f21ee1953e827c9a4456cba31cc1e1bd to your computer and use it in GitHub Desktop.
IPtables family filter
iptables -A INPUT -p ALL -m mac --mac-source xx:xx:xx:xx:xx:xx -j blocked_access
iptables -N blocked_access #Create new chain
iptables -A blocked_access --protocol ALL #Rule all protocols
iptables -A blocked_access -m mac --mac-source xx:xx:xx:xx:xx:xx #limit by mac
iptables -A blocked_access -m time --timestart 23:00 --timestop 6:00 --days Mon,Tue,Wed,Thu,Fri,Sat,Sun #limit by time
iptables -A blocked_access -j DROP #if match, drop
https://www.digitalocean.com/community/tutorials/how-to-list-and-delete-iptables-firewall-
#thinking also limit per time
iptables -A OUTPUT -p tcp --dport 25 -m state --state RELATED,ESTABLISHED -m limit --limit 10/minute -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment