Last active
August 29, 2015 14:06
-
-
Save kawahiro311/26b63b68cac16e0188a7 to your computer and use it in GitHub Desktop.
最低限のiptables
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
*filter | |
# 受信/転送を破棄・送信を許可 | |
:INPUT DROP [0:0] | |
:FORWARD DROP [0:0] | |
:OUTPUT ACCEPT [0:0] | |
# ループバックアドレスからの送受信を許可 | |
-A INPUT -i lo -j ACCEPT | |
-A OUTPUT -o lo -j ACCEPT | |
# ssh | |
-A INPUT -m state --state NEW -p tcp --dport 22 -s xxx.xxx.xxx.xxx -j ACCEPT | |
# http, https | |
-A INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT | |
-A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT | |
# smtp | |
-A INPUT -m state --state NEW -p tcp --dport 25 -j ACCEPT | |
# 接続済みパケットの送受信を許可 | |
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
-A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment