Посмотрим все доступные интерфейсы
ip route show | grep default
Для установки самого OPENVPN сервера воспользуйтесь статьей - OPENVPN - vpn для linux систем
Установим GIT
apt install git
Скопируем с GIT
git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole
Перейдем в папку
cd Pi-hole/automated\ install/
Установим PI Hole
bash basic-install.sh
Проверим доступность обычного домена
host google.com 10.8.0.1
Вот какой должен быть выход команды
google.com has address 216.58.194.174
Проверим рекламный домен
host pagead2.googlesyndication.com 10.8.0.1
Вот какой должен быть выход команды
pagead2.googlesyndication.com has address 10.8.0.1
Заходим в файл server.conf
nano /etc/openvpn/server.conf
Находим такие строки
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
И после них добавляем
push "dhcp-option DNS 10.8.0.1"
Сменим пароль Админа
pihole -a -p
Перезапускаем OpenVPN
systemctl restart openvpn@server
systemctl status openvpn@server
Добавим списки доменов для блокировки
cd /etc/pihole/
nano adlists.list
Вы можете скопировать списки подписок с сайта:
После имеющихся добавим:
https://hosts-file.net/ad_servers.txt https://hosts-file.net/grm.txt https://reddestdream.github.io/Projects/MinimalHosts/etc/MinimalHostsBlocker/minimalhosts https://raw.githubusercontent.com/StevenBlack/hosts/master/data/KADhosts/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/data/add.Spam/hosts https://v.firebog.net/hosts/static/w3kbl.txt https://v.firebog.net/hosts/BillStearns.txt http://sysctl.org/cameleon/hosts https://www.dshield.org/feeds/suspiciousdomains_Low.txt https://www.dshield.org/feeds/suspiciousdomains_Medium.txt https://www.dshield.org/feeds/suspiciousdomains_High.txt https://www.joewein.net/dl/bl/dom-bl-base.txt https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt https://hostsfile.org/Downloads/hosts.txt https://someonewhocares.org/hosts/zero/hosts https://raw.githubusercontent.com/Dawsey21/Lists/master/main-blacklist.txt https://raw.githubusercontent.com/vokins/yhosts/master/hosts http://winhelp2002.mvps.org/hosts.txt https://hostsfile.mine.nu/hosts0.txt https://v.firebog.net/hosts/Kowabit.txt https://adblock.mahakala.is https://adaway.org/hosts.txt https://v.firebog.net/hosts/AdguardDNS.txt https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt https://hosts-file.net/ad_servers.txt https://v.firebog.net/hosts/Easylist.txt https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts;showintro=0 https://raw.githubusercontent.com/StevenBlack/hosts/master/data/UncheckyAds/hosts https://www.squidblacklist.org/downloads/dg-ads.acl https://v.firebog.net/hosts/Easyprivacy.txt https://v.firebog.net/hosts/Prigent-Ads.txt https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt https://raw.githubusercontent.com/StevenBlack/hosts/master/data/add.2o7Net/hosts https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt https://v.firebog.net/hosts/Airelle-trc.txt https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt https://mirror1.malwaredomains.com/files/justdomains https://hosts-file.net/exp.txt https://hosts-file.net/emd.txt https://hosts-file.net/psh.txt https://mirror.cedia.org.ec/malwaredomains/immortal_domains.txt https://www.malwaredomainlist.com/hostslist/hosts.txt https://bitbucket.org/ethanr/dns-blacklists/raw/8575c9f96e5b4a1308f2f12394abd86d0927a4a0/bad_lists/Mandiant_APT1_Report_Ap$ https://v.firebog.net/hosts/Prigent-Malware.txt https://v.firebog.net/hosts/Prigent-Phishing.txt https://phishing.army/download/phishing_army_blocklist_extended.txt https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-malware.txt https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt https://ransomwaretracker.abuse.ch/downloads/CW_C2_DOMBL.txt https://ransomwaretracker.abuse.ch/downloads/LY_C2_DOMBL.txt https://ransomwaretracker.abuse.ch/downloads/TC_C2_DOMBL.txt https://ransomwaretracker.abuse.ch/downloads/TL_C2_DOMBL.txt https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist https://v.firebog.net/hosts/Shalla-mal.txt
Загрузим отдельно для блокировки рекламы на Ютуб
cd
wget https://github.com/kboghdady/youTube_ads_4_pi-hole/archive/master.zip
unzip mast*
cd you*/
Выполним
bash youtube.sh
И добавим автообновление для Ютуба
crontab -e
В самое начало
0 */4 * * * sudo /root/youTube_ads_4_pi-hole-master/youtube.sh >/dev/null
Изменим пароль для GUI
pihole -a -p
Заходим либо подключившись через VPN по адресу 10.8.0.1/admin
Либо в локальной сети 192.X.X.X/admin
Далее Login
И обновим списки это займет какое то время
Tools -> Update Gravity