Created
November 4, 2018 21:35
-
-
Save fabiofdsantos/a86fb7bfda41d530a560ff60f6321e0b to your computer and use it in GitHub Desktop.
Basic iptables to allow http, https and ssh
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
# Generated by iptables-save v1.4.21 on Mon Apr 25 12:53:52 2016 | |
*filter | |
:INPUT ACCEPT [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
-A INPUT -i lo -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 tcp -m tcp -s hostname.com --dport 22 -j ACCEPT | |
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
-A INPUT -j DROP | |
-A OUTPUT -o lo -j ACCEPT | |
-A OUTPUT -j ACCEPT | |
COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment