fix
This commit is contained in:
parent
70db85789c
commit
87cef8f390
15
firewall2.sh
15
firewall2.sh
@ -3,7 +3,7 @@ MY_IP="47.5.115.173"
|
||||
ATTACK_THRESHOLD="50"
|
||||
SERVER_IP='192.168.0.55'
|
||||
NGINX_ACCESS="/tmp/access.log"
|
||||
#WIREGUARD=(51820)
|
||||
#Firewall Port Configuration
|
||||
WIREGUARD=(57692)
|
||||
WEB=(80 443)
|
||||
ADGUARD=(3000 8082 853)
|
||||
@ -16,8 +16,8 @@ SYNCTHING=(22000 8384 21027)
|
||||
NFS=(2049 111)
|
||||
JELLYFIN=(8096 7359)
|
||||
MACHINES=(127.0.0.1)
|
||||
VIRT_BRIDGE="virbr0"
|
||||
ADMIN=(22)
|
||||
VIRT_BRIDGE="virbr0"
|
||||
#### NFT CONFIG ####
|
||||
NFT='/usr/bin/nft'
|
||||
NFT_TCP="$NFT add rule ip filter input tcp dport"
|
||||
@ -41,16 +41,17 @@ CRAWLER_TMP='/tmp/crawlers.txt'
|
||||
RULE_SET='/opt/firewall/nft.rules'
|
||||
MENU_TOP="=============================FireWall================================="
|
||||
MENU_BOTTOM="====================================================================="
|
||||
DATE="$(date +%d/%b/%Y:%H:%M -d '15 seconds ago')"
|
||||
#DATE="$(date +%d/%b/%Y:%H:%M:%S -d '15 seconds ago')"
|
||||
echo $DATE
|
||||
|
||||
#Cache the Date and Current Firewall Rules at every launch
|
||||
DATE="$(date +%d/%b/%Y:%H:%M -d '1 minute ago')"
|
||||
nft list table filter >$NFT_CACHE
|
||||
|
||||
#Countries to Block
|
||||
COUNTRY=(
|
||||
https://www.ipdeny.com/ipblocks/data/countries/il.zone
|
||||
https://www.ipdeny.com/ipblocks/data/countries/cn.zone
|
||||
)
|
||||
|
||||
nft list table filter >$NFT_CACHE
|
||||
|
||||
ipBlockParser(){
|
||||
if [[ "$1" == *":"* ]]; then
|
||||
$NFT add rule ip6 filter input position 0 ip6 saddr $1 $NFT_DROP
|
||||
|
Loading…
x
Reference in New Issue
Block a user