summaryrefslogtreecommitdiff
path: root/ufw.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ufw.sh')
-rwxr-xr-xufw.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/ufw.sh b/ufw.sh
new file mode 100755
index 0000000..d08acc2
--- /dev/null
+++ b/ufw.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+main() {
+ ufw --force reset
+
+
+ #ufw default allow incoming
+ ufw default deny incoming on enp2s0
+ ufw default allow outgoing
+ ufw allow in on virbr0
+ #ufw allow in on enp2s0 from 95.91.211.71
+
+ ufw allow in on enp2s0 to any port 22
+
+ # nginx
+ ufw allow in on enp2s0 to any port 80
+ ufw allow in on enp2s0 to any port 443
+
+ # dovecot
+ ufw allow in on enp2s0 to any port 143
+ ufw allow in on enp2s0 to any port 993
+ ufw allow in on enp2s0 to any port 4190
+ ufw allow in on enp2s0 to any port 12302
+
+ # postfix
+ ufw allow in on enp2s0 to any port 25
+ ufw allow in on enp2s0 to any port 465
+ ufw allow in on enp2s0 to any port 587
+}
+
+main