Skip to content

Instantly share code, notes, and snippets.

@JarenGlover
Last active August 29, 2015 14:24
Show Gist options
  • Save JarenGlover/6118a897c6198a07cfd8 to your computer and use it in GitHub Desktop.
Save JarenGlover/6118a897c6198a07cfd8 to your computer and use it in GitHub Desktop.
iptables CoreOS with rules for etcd
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A OUTPUT -o eth1 -p tcp --dport 4001 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -i eth1 -p tcp --sport 4001 -m state --state ESTABLISHED -j ACCEPT
-A INPUT -i eth1 -p tcp --dport 4001 -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -o eth1 -p tcp --sport 4001 -m state --state ESTABLISHED -j ACCEPT
-A OUTPUT -o eth1 -p tcp --dport 7001 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -i eth1 -p tcp --sport 7001 -m state --state ESTABLISHED -j ACCEPT
-A INPUT -i eth1 -p tcp --dport 7001 -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -o eth1 -p tcp --sport 7001 -m state --state ESTABLISHED -j ACCEPT
COMMIT
@JarenGlover
Copy link
Author

works in vagrant - trying to get to work with stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment