Last active
March 8, 2016 05:00
-
-
Save tzmfreedom/3ae3818b96dc5ce50a7c to your computer and use it in GitHub Desktop.
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
# 詳細はこちらを参照 | |
# https://github.com/suin/iptables/blob/master/iptables.sh | |
# clear | |
iptables -F # テーブル初期化 | |
iptables -X # チェーンを削除 | |
iptables -Z # パケットカウンタ・バイトカウンタをクリア | |
# policy | |
iptables -P INPUT DROP | |
iptables -P OUTPUT ACCEPT | |
iptables -P FORWARD DROP | |
# local | |
iptables -A INPUT -i lo -j ACCEPT | |
# input | |
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT | |
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT | |
# related, established | |
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
# ping death | |
iptables -A INPUT -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT | |
iptables save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment