home · contact · privacy
Add etc files for web server.
[config] / all_new_2018 / linkable_etc_files / web / etc / iptables / rules.v4
diff --git a/all_new_2018/linkable_etc_files/web/etc/iptables/rules.v4 b/all_new_2018/linkable_etc_files/web/etc/iptables/rules.v4
new file mode 100644 (file)
index 0000000..9b714c6
--- /dev/null
@@ -0,0 +1,18 @@
+*filter
+:INPUT DROP [0:0]
+:FORWARD DROP [0:0]
+:OUTPUT ACCEPT [0:0]
+# otherwise self-referential connections to local host will fail
+-A INPUT -i lo -j ACCEPT
+# tolerate any inbound connections requested by our server, no matter the port
+-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
+# this enables ping etc.
+-A INPUT -p icmp -j ACCEPT
+# SSH
+-A INPUT -p tcp --dport 22 -j ACCEPT
+# HTTP
+-A INPUT -p tcp --dport 80 -j ACCEPT
+# HTTPS
+-A INPUT -p tcp --dport 443 -j ACCEPT
+COMMIT
+# this last line is here because iptables-restore ignores the final command if no newline follows it
\ No newline at end of file