-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·21 lines (21 loc) · 1.33 KB
/
setup.sh
File metadata and controls
executable file
·21 lines (21 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
clear;
echo Anti internet nuisance filter by independent.;
echo https://github.com/independentcod/iptables_CIDR_drop;
echo Twitter and Instagram: @independentcod;
echo Facebook: https://fb.me/remi.girard2;
echo LinkedIn: https://rebrand.ly/1091c;
echo "---IMPORTANT--- If you do not wish to block Google (because blocking Google will break viewing many websites) Simply delete first line in CIDR.txt and execute setup.sh";
echo "---TIP--- You should replace your DNS nameserver from 8.8.8.8 & 8.8.4.4 to 1.1.1.1 & 1.0.0.1 to avoid Google tracking your DNS queries.";
echo "---TRICK--- If you have a problem connecting a certain website, go to https://hackertarget.com/find-dns-host-records/ find all corresponding CIDR, delete them and re-run setup.sh.";
read -r -p "Do you want to continue? [Y/n] " input
sudo apt update && sudo apt install iptables -y;
echo Flushing INPUT and OUTPUT tables.;
sudo iptables -F INPUT;
sudo iptables -F OUTPUT;
echo Now adding CIDR IP blocks to iptables.;
for i in `cat CIDR.txt`; do iptables -I OUTPUT -s $i -j DROP -w && iptables -I INPUT -s $i -j DROP -w | echo $i was successfully added to iptables configuration. ; done;
echo Saving iptables configuration permanently.;
sudo iptables-save >config.log;
echo Configuration log file generated to ./config.log;
echo ALL DONE! Enjoy blocking most internet nuisances.;