Last active
December 28, 2015 10:49
-
-
Save gene1wood/7489372 to your computer and use it in GitHub Desktop.
Example knockd.conf file that creates and destroys iptables rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[options] | |
logfile = /var/log/knockd.log | |
[openSSH] | |
sequence = 10000,20000,30000,40000 | |
seq_timeout = 45 | |
tcpflags = syn | |
command = /sbin/iptables -I INPUT 15 -s %IP% -p tcp -m state --state NEW -m multiport --dports 22,80,443 -j ACCEPT -m comment --comment "knockd added `date +%F_%T` allowing access to SSH, HTTP and HTTPS : `dig -x %IP% +short`" | |
[closeSSH] | |
sequence = 40000,30000,20000,10000 | |
seq_timeout = 45 | |
tcpflags = syn | |
# https://gist.github.com/gene1wood/7489673 | |
command = /usr/local/sbin/delete_knockd_iptables_rule %IP% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment