Created
May 1, 2021 22:06
-
-
Save ph1048/b8743b180e423383741fbaff37c255d1 to your computer and use it in GitHub Desktop.
keenetic port knocking for vpn
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
#!/bin/sh | |
[ "$table" != "filter" ] && exit 0 | |
/opt/sbin/ipset create knockd hash:ip -exist | |
/opt/sbin/iptables -I _NDM_IP_PUBLIC -p udp --dport 1701 -j DROP | |
/opt/sbin/iptables -I _NDM_IP_PUBLIC -p udp --dport 500 -j DROP | |
/opt/sbin/iptables -I _NDM_IP_PUBLIC -p udp --dport 4500 -j DROP | |
/opt/sbin/iptables -I _NDM_IP_PUBLIC -m set --match-set knockd src -p udp --dport 1701 -j ACCEPT | |
/opt/sbin/iptables -I _NDM_IP_PUBLIC -m set --match-set knockd src -p udp --dport 500 -j ACCEPT | |
/opt/sbin/iptables -I _NDM_IP_PUBLIC -m set --match-set knockd src -p udp --dport 4500 -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment