From 266a51a4af626fcd323f8f4122486b1e3c8b91e0 Mon Sep 17 00:00:00 2001 From: fossilfranv Date: Sun, 19 Mar 2023 19:32:38 +0100 Subject: [PATCH] Add 'blockrussia.sh' --- blockrussia.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 blockrussia.sh diff --git a/blockrussia.sh b/blockrussia.sh new file mode 100644 index 0000000..8abdba5 --- /dev/null +++ b/blockrussia.sh @@ -0,0 +1,9 @@ +rm russia.txt +curl https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/ip2location_country/ip2location_country_ru.netset >russia.txt +my_file=$(cat russia.txt |grep -v "#") +/sbin/ipset -q flush russia +/sbin/ipset -q create russia hash:net +for row_data in $my_file; do /sbin/ipset add russia ${row_data}; done +/sbin/iptables -I INPUT -m set --match-set russia src -j DROP +/sbin/iptables -A FORWARD -p tcp --dport 443 -m set --match-set russia dst -j DROP +/sbin/iptables -A FORWARD -p tcp --dport 80 -m set --match-set russia dst -j DROP \ No newline at end of file