Sfoglia il codice sorgente

Create nftables.sh

Add the start of an nftables script. Will need additional work.
FusionPBX 4 anni fa
parent
commit
94fd2d4d39
1 ha cambiato i file con 30 aggiunte e 0 eliminazioni
  1. 30 0
      debian/resources/nftables.sh

+ 30 - 0
debian/resources/nftables.sh

@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#move to script directory so all relative paths work
+cd "$(dirname "$0")"
+
+#add the includes
+. ./config.sh
+. ./colors.sh
+. ./environment.sh
+
+#send a message
+verbose "Configuring nftables"
+
+#run iptables commands
+nft add rule ip filter INPUT iifname "lo" counter accept
+nft add rule ip filter INPUT ct state related,established  counter accept
+nft add rule ip filter INPUT tcp dport 22 counter accept
+nft add rule ip filter INPUT tcp dport 80 counter accept
+nft add rule ip filter INPUT tcp dport 443 counter accept
+nft add rule ip filter INPUT tcp dport 7443 counter accept
+nft add rule ip filter INPUT tcp dport 5060-5091 counter accept
+nft add rule ip filter INPUT udp dport 5060-5091 counter accept
+nft add rule ip filter INPUT udp dport 16384-32768 counter accept
+nft add rule ip filter INPUT icmp type echo-request counter accept
+nft add rule ip filter INPUT udp dport 1194 counter accept
+nft add rule ip mangle OUTPUT udp sport 16384-32768 counter ip dscp set 0x2e
+nft add rule ip mangle OUTPUT tcp sport 5060-5091 counter ip dscp set 0x1a
+nft add rule ip mangle OUTPUT udp sport 5060-5091 counter ip dscp set 0x1a
+
+