Skip to content

Instantly share code, notes, and snippets.

@ryuone
Created January 19, 2013 04:32
Show Gist options
  • Save ryuone/4570750 to your computer and use it in GitHub Desktop.
Save ryuone/4570750 to your computer and use it in GitHub Desktop.
こんな感じ
iptables -F
iptables -X
iptables -Z
iptables -P INPUT DROP # 受信はすべて破棄
iptables -P OUTPUT ACCEPT # 送信はすべて許可
iptables -P FORWARD DROP # 通過はすべて破棄
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp -m conntrack --ctstate NEW --dport 80 -j ACCEPT # http
iptables -A INPUT -p tcp -m conntrack --ctstate NEW --dport 22 -j ACCEPT # ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment