Last active
November 8, 2018 13:47
-
-
Save micw/c2449be2c94d0c2bf80278982e1bbc7a to your computer and use it in GitHub Desktop.
Minimal iptables for rancher 2 agent/kubernetes
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
*nat | |
:PREROUTING ACCEPT [0:0] | |
:INPUT ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:POSTROUTING ACCEPT [0:0] | |
# Masquerading all outgoing routet traffic | |
-A POSTROUTING -o eth0 -j MASQUERADE | |
COMMIT | |
*filter | |
:INPUT DROP [10518:47789289] | |
:FORWARD ACCEPT [6:345] | |
:OUTPUT ACCEPT [9713:1032463] | |
# Cleanup | |
-F INPUT | |
# Allow traffic of existing connections | |
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
# Allow all traffic from localhost | |
-A INPUT -i lo -j ACCEPT | |
# Allow ICMP | |
-A INPUT -p icmp -j ACCEPT | |
# Allow SSH | |
-A INPUT -p tcp --dport 22 -j ACCEPT | |
# Allow HTTP | |
-A INPUT -p tcp --dport 80 -j ACCEPT | |
# Allow HTTPS | |
-A INPUT -p tcp --dport 443 -j ACCEPT | |
# Allow wireguard | |
-A INPUT -p tcp --dport 51820 -j ACCEPT | |
# Allow rancher server | |
-A INPUT -p tcp --dport 8443 -j ACCEPT | |
COMMIT |
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 ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment